Bug 1439076 - P2 - csrc-audio-level jsep gtest fixes r=jib

MozReview-Commit-ID: 1ZHK4TFIc9E

--HG--
extra : rebase_source : 897ceea8637b15b9a3872c86a2c8b3ac551e096d
This commit is contained in:
Nico Grunbaum 2018-02-20 17:00:27 -08:00
Родитель 3a07a6a7ec
Коммит 4e323cc913
1 изменённых файлов: 16 добавлений и 10 удалений

Просмотреть файл

@ -4296,17 +4296,20 @@ TEST_F(JsepSessionTest, TestExtmap)
auto& offerMediaAttrs = parsedOffer->GetMediaSection(0).GetAttributeList();
ASSERT_TRUE(offerMediaAttrs.HasAttribute(SdpAttribute::kExtmapAttribute));
auto& offerExtmap = offerMediaAttrs.GetExtmap().mExtmaps;
ASSERT_EQ(4U, offerExtmap.size());
ASSERT_EQ(5U, offerExtmap.size());
ASSERT_EQ("urn:ietf:params:rtp-hdrext:ssrc-audio-level",
offerExtmap[0].extensionname);
ASSERT_EQ(1U, offerExtmap[0].entry);
ASSERT_EQ("urn:ietf:params:rtp-hdrext:sdes:mid",
ASSERT_EQ("urn:ietf:params:rtp-hdrext:csrc-audio-level",
offerExtmap[1].extensionname);
ASSERT_EQ(2U, offerExtmap[1].entry);
ASSERT_EQ("foo", offerExtmap[2].extensionname);
ASSERT_EQ("urn:ietf:params:rtp-hdrext:sdes:mid",
offerExtmap[2].extensionname);
ASSERT_EQ(3U, offerExtmap[2].entry);
ASSERT_EQ("bar", offerExtmap[3].extensionname);
ASSERT_EQ("foo", offerExtmap[3].extensionname);
ASSERT_EQ(4U, offerExtmap[3].entry);
ASSERT_EQ("bar", offerExtmap[4].extensionname);
ASSERT_EQ(5U, offerExtmap[4].entry);
UniquePtr<Sdp> parsedAnswer(Parse(answer));
ASSERT_EQ(1U, parsedAnswer->GetMediaSectionCount());
@ -4323,7 +4326,7 @@ TEST_F(JsepSessionTest, TestExtmap)
ASSERT_EQ(2U, offerExtmap[1].entry);
// We ensure that the entry for "bar" matches what was in the offer
ASSERT_EQ("bar", answerExtmap[2].extensionname);
ASSERT_EQ(4U, answerExtmap[2].entry);
ASSERT_EQ(5U, answerExtmap[2].entry);
}
TEST_F(JsepSessionTest, TestExtmapWithDuplicates)
@ -4345,19 +4348,22 @@ TEST_F(JsepSessionTest, TestExtmapWithDuplicates)
auto& offerMediaAttrs = parsedOffer->GetMediaSection(0).GetAttributeList();
ASSERT_TRUE(offerMediaAttrs.HasAttribute(SdpAttribute::kExtmapAttribute));
auto& offerExtmap = offerMediaAttrs.GetExtmap().mExtmaps;
ASSERT_EQ(5U, offerExtmap.size());
ASSERT_EQ(6U, offerExtmap.size());
ASSERT_EQ("urn:ietf:params:rtp-hdrext:ssrc-audio-level",
offerExtmap[0].extensionname);
ASSERT_EQ(1U, offerExtmap[0].entry);
ASSERT_EQ("urn:ietf:params:rtp-hdrext:sdes:mid",
ASSERT_EQ("urn:ietf:params:rtp-hdrext:csrc-audio-level",
offerExtmap[1].extensionname);
ASSERT_EQ(2U, offerExtmap[1].entry);
ASSERT_EQ("foo", offerExtmap[2].extensionname);
ASSERT_EQ("urn:ietf:params:rtp-hdrext:sdes:mid",
offerExtmap[2].extensionname);
ASSERT_EQ(3U, offerExtmap[2].entry);
ASSERT_EQ("bar", offerExtmap[3].extensionname);
ASSERT_EQ("foo", offerExtmap[3].extensionname);
ASSERT_EQ(4U, offerExtmap[3].entry);
ASSERT_EQ("baz", offerExtmap[4].extensionname);
ASSERT_EQ("bar", offerExtmap[4].extensionname);
ASSERT_EQ(5U, offerExtmap[4].entry);
ASSERT_EQ("baz", offerExtmap[5].extensionname);
ASSERT_EQ(6U, offerExtmap[5].entry);
}