mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1147919 - Part 1: Make sure content gets an error callback when it does not use a fingerprint algorithm we support. r=drno
This commit is contained in:
parent
75d2653edb
commit
0484bd79e4
@ -1936,6 +1936,14 @@ JsepSessionImpl::ParseSdp(const std::string& sdp, UniquePtr<Sdp>* parsedp)
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
const SdpFingerprintAttributeList& fingerprints(
|
||||
mediaAttrs.GetFingerprint());
|
||||
if (fingerprints.mFingerprints.empty()) {
|
||||
JSEP_SET_ERROR("Invalid description, no supported fingerprint algorithms "
|
||||
"present");
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
if (mediaAttrs.HasAttribute(SdpAttribute::kSetupAttribute) &&
|
||||
mediaAttrs.GetSetup().mRole == SdpSetupAttribute::kHoldconn) {
|
||||
JSEP_SET_ERROR("Description has illegal setup attribute "
|
||||
|
@ -2460,6 +2460,15 @@ Replace(const std::string& toReplace,
|
||||
in->replace(pos, toReplace.size(), with);
|
||||
}
|
||||
|
||||
static void ReplaceAll(const std::string& toReplace,
|
||||
const std::string& with,
|
||||
std::string* in)
|
||||
{
|
||||
while (in->find(toReplace) != std::string::npos) {
|
||||
Replace(toReplace, with, in);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
GetCodec(JsepSession& session,
|
||||
size_t pairIndex,
|
||||
@ -3034,6 +3043,20 @@ TEST_F(JsepSessionTest, TestUniquePayloadTypes)
|
||||
GetUniquePayloadTypes().size());
|
||||
}
|
||||
|
||||
TEST_F(JsepSessionTest, UnknownFingerprintAlgorithm)
|
||||
{
|
||||
types.push_back(SdpMediaSection::kAudio);
|
||||
AddTracks(mSessionOff, "audio");
|
||||
AddTracks(mSessionAns, "audio");
|
||||
|
||||
std::string offer(CreateOffer());
|
||||
SetLocalOffer(offer);
|
||||
ReplaceAll("fingerprint:sha", "fingerprint:foo", &offer);
|
||||
nsresult rv = mSessionAns.SetRemoteDescription(kJsepSdpOffer, offer);
|
||||
ASSERT_NE(NS_OK, rv);
|
||||
ASSERT_NE("", mSessionAns.GetLastError());
|
||||
}
|
||||
|
||||
TEST(H264ProfileLevelIdTest, TestLevelComparisons)
|
||||
{
|
||||
ASSERT_LT(JsepVideoCodecDescription::GetSaneH264Level(0x421D0B), // 1b
|
||||
|
Loading…
Reference in New Issue
Block a user