Bug 1225877 - Part 0: Test-case updates. r=mjf
authorByron Campen [:bwc] <docfaraday@gmail.com>
Tue, 23 Apr 2019 12:43:01 +0000
changeset 470476 17c6c03c439e2e4b99dbe53414a4c96c56741528
parent 470475 401f2be1ced14464292c27ac0a563650ecd3f8c0
child 470477 1fb8d0d598d0c4c681320bb0ee0dfafecb3caad9
push id35906
push useraciure@mozilla.com
push dateTue, 23 Apr 2019 22:14:56 +0000
treeherdermozilla-central@0ce3633f8b80 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmjf
bugs1225877
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1225877 - Part 0: Test-case updates. r=mjf Differential Revision: https://phabricator.services.mozilla.com/D28243
media/webrtc/signaling/gtest/sdp_unittests.cpp
--- a/media/webrtc/signaling/gtest/sdp_unittests.cpp
+++ b/media/webrtc/signaling/gtest/sdp_unittests.cpp
@@ -1921,17 +1921,17 @@ const std::string kBasicAudioVideoOffer 
     "162.222.183.171 rport 61026" CRLF "a=rtcp:61026" CRLF
     "a=end-of-candidates" CRLF "a=ssrc:1111 foo" CRLF "a=ssrc:1111 foo:bar" CRLF
     "a=ssrc:1111 msid:1d0cdb4e-5934-4f0f-9f88-40392cb60d31 "
     "315b086a-5cb6-4221-89de-caf0b038c79d" CRLF
     "a=imageattr:120 send * recv *" CRLF
     "a=imageattr:121 send [x=640,y=480] recv [x=640,y=480]" CRLF
     "a=rid:bar recv pt=120;max-width=800;max-height=600" CRLF
     "a=rid:bar123 recv max-width=1920;max-height=1080" CRLF
-    "a=simulcast:recv rid=bar;bar123" CRLF "m=audio 9 RTP/SAVPF 0" CRLF
+    "a=simulcast:recv bar;bar123" CRLF "m=audio 9 RTP/SAVPF 0" CRLF
     "a=mid:third" CRLF "a=rtpmap:0 PCMU/8000" CRLF "a=ice-options:foo bar" CRLF
     "a=msid:noappdata" CRLF "a=bundle-only" CRLF;
 
 TEST_P(NewSdpTest, BasicAudioVideoSdpParse) { ParseSdp(kBasicAudioVideoOffer); }
 
 TEST_P(NewSdpTest, CheckRemoveFmtp) {
   ParseSdp(kBasicAudioVideoOffer);
   ASSERT_TRUE(!!mSdp)
@@ -4935,41 +4935,67 @@ TEST(NewSdpTestNoFixture, CheckSimulcast
     SdpSimulcastAttribute::Versions versions(ParseSimulcastVersions("rid=8"));
     ASSERT_EQ(1U, versions.size());
     ASSERT_EQ(SdpSimulcastAttribute::Versions::kRid, versions.type);
     ASSERT_EQ(1U, versions[0].choices.size());
     ASSERT_EQ("8", versions[0].choices[0]);
   }
 
   {
+    SdpSimulcastAttribute::Versions versions(ParseSimulcastVersions("8"));
+    ASSERT_EQ(1U, versions.size());
+    ASSERT_EQ(SdpSimulcastAttribute::Versions::kRid, versions.type);
+    ASSERT_EQ(1U, versions[0].choices.size());
+    ASSERT_EQ("8", versions[0].choices[0]);
+  }
+
+  {
     SdpSimulcastAttribute::Versions versions(ParseSimulcastVersions("pt=8,9"));
     ASSERT_EQ(1U, versions.size());
     ASSERT_EQ(2U, versions[0].choices.size());
     ASSERT_EQ("8", versions[0].choices[0]);
     ASSERT_EQ("9", versions[0].choices[1]);
   }
 
   {
+    SdpSimulcastAttribute::Versions versions(ParseSimulcastVersions("8,9"));
+    ASSERT_EQ(1U, versions.size());
+    ASSERT_EQ(SdpSimulcastAttribute::Versions::kRid, versions.type);
+    ASSERT_EQ(2U, versions[0].choices.size());
+    ASSERT_EQ("8", versions[0].choices[0]);
+    ASSERT_EQ("9", versions[0].choices[1]);
+  }
+
+  {
     SdpSimulcastAttribute::Versions versions(
         ParseSimulcastVersions("pt=8,9;10"));
     ASSERT_EQ(2U, versions.size());
     ASSERT_EQ(2U, versions[0].choices.size());
     ASSERT_EQ("8", versions[0].choices[0]);
     ASSERT_EQ("9", versions[0].choices[1]);
     ASSERT_EQ(1U, versions[1].choices.size());
     ASSERT_EQ("10", versions[1].choices[0]);
   }
+
+  {
+    SdpSimulcastAttribute::Versions versions(ParseSimulcastVersions("8,9;10"));
+    ASSERT_EQ(2U, versions.size());
+    ASSERT_EQ(SdpSimulcastAttribute::Versions::kRid, versions.type);
+    ASSERT_EQ(2U, versions[0].choices.size());
+    ASSERT_EQ("8", versions[0].choices[0]);
+    ASSERT_EQ("9", versions[0].choices[1]);
+    ASSERT_EQ(1U, versions[1].choices.size());
+    ASSERT_EQ("10", versions[1].choices[0]);
+  }
 }
 
 TEST(NewSdpTestNoFixture, CheckSimulcastVersionsInvalidParse)
 {
   ParseInvalid<SdpSimulcastAttribute::Versions>("", 0);
-  ParseInvalid<SdpSimulcastAttribute::Versions>("x", 1);
-  ParseInvalid<SdpSimulcastAttribute::Versions>(";", 1);
-  ParseInvalid<SdpSimulcastAttribute::Versions>("8", 1);
+  ParseInvalid<SdpSimulcastAttribute::Versions>(";", 0);
   ParseInvalid<SdpSimulcastAttribute::Versions>("foo=", 4);
   ParseInvalid<SdpSimulcastAttribute::Versions>("foo=8", 4);
   ParseInvalid<SdpSimulcastAttribute::Versions>("pt=9999", 7);
   ParseInvalid<SdpSimulcastAttribute::Versions>("pt=-1", 5);
   ParseInvalid<SdpSimulcastAttribute::Versions>("pt=x", 4);
   ParseInvalid<SdpSimulcastAttribute::Versions>("pt=8;", 5);
   ParseInvalid<SdpSimulcastAttribute::Versions>("pt=8;x", 6);
   ParseInvalid<SdpSimulcastAttribute::Versions>("pt=8;;", 5);
@@ -5001,16 +5027,26 @@ static SdpSimulcastAttribute ParseSimulc
   EXPECT_TRUE(simulcast.Parse(is, &error)) << error;
   EXPECT_TRUE(is.eof());
   return simulcast;
 }
 
 TEST(NewSdpTestNoFixture, CheckSimulcastValidParse)
 {
   {
+    SdpSimulcastAttribute simulcast(ParseSimulcast("send 8"));
+    ASSERT_EQ(1U, simulcast.sendVersions.size());
+    ASSERT_EQ(SdpSimulcastAttribute::Versions::kRid,
+              simulcast.sendVersions.type);
+    ASSERT_EQ(1U, simulcast.sendVersions[0].choices.size());
+    ASSERT_EQ("8", simulcast.sendVersions[0].choices[0]);
+    ASSERT_EQ(0U, simulcast.recvVersions.size());
+  }
+
+  {
     SdpSimulcastAttribute simulcast(ParseSimulcast(" send pt=8"));
     ASSERT_EQ(1U, simulcast.sendVersions.size());
     ASSERT_EQ(SdpSimulcastAttribute::Versions::kPt,
               simulcast.sendVersions.type);
     ASSERT_EQ(1U, simulcast.sendVersions[0].choices.size());
     ASSERT_EQ("8", simulcast.sendVersions[0].choices[0]);
     ASSERT_EQ(0U, simulcast.recvVersions.size());
   }
@@ -5032,16 +5068,40 @@ TEST(NewSdpTestNoFixture, CheckSimulcast
               simulcast.recvVersions.type);
     ASSERT_EQ(1U, simulcast.recvVersions[0].choices.size());
     ASSERT_EQ("8", simulcast.recvVersions[0].choices[0]);
     ASSERT_EQ(0U, simulcast.sendVersions.size());
   }
 
   {
     SdpSimulcastAttribute simulcast(
+        ParseSimulcast("send 8,9;101;97,98 recv 101,120;97"));
+    ASSERT_EQ(3U, simulcast.sendVersions.size());
+    ASSERT_EQ(SdpSimulcastAttribute::Versions::kRid,
+              simulcast.sendVersions.type);
+    ASSERT_EQ(2U, simulcast.sendVersions[0].choices.size());
+    ASSERT_EQ("8", simulcast.sendVersions[0].choices[0]);
+    ASSERT_EQ("9", simulcast.sendVersions[0].choices[1]);
+    ASSERT_EQ(1U, simulcast.sendVersions[1].choices.size());
+    ASSERT_EQ("101", simulcast.sendVersions[1].choices[0]);
+    ASSERT_EQ(2U, simulcast.sendVersions[2].choices.size());
+    ASSERT_EQ("97", simulcast.sendVersions[2].choices[0]);
+    ASSERT_EQ("98", simulcast.sendVersions[2].choices[1]);
+
+    ASSERT_EQ(2U, simulcast.recvVersions.size());
+    ASSERT_EQ(SdpSimulcastAttribute::Versions::kRid,
+              simulcast.recvVersions.type);
+    ASSERT_EQ(2U, simulcast.recvVersions[0].choices.size());
+    ASSERT_EQ("101", simulcast.recvVersions[0].choices[0]);
+    ASSERT_EQ("120", simulcast.recvVersions[0].choices[1]);
+    ASSERT_EQ(1U, simulcast.recvVersions[1].choices.size());
+    ASSERT_EQ("97", simulcast.recvVersions[1].choices[0]);
+  }
+  {
+    SdpSimulcastAttribute simulcast(
         ParseSimulcast(" send pt=8,9;101;97,98 recv pt=101,120;97"));
     ASSERT_EQ(3U, simulcast.sendVersions.size());
     ASSERT_EQ(SdpSimulcastAttribute::Versions::kPt,
               simulcast.sendVersions.type);
     ASSERT_EQ(2U, simulcast.sendVersions[0].choices.size());
     ASSERT_EQ("8", simulcast.sendVersions[0].choices[0]);
     ASSERT_EQ("9", simulcast.sendVersions[0].choices[1]);
     ASSERT_EQ(1U, simulcast.sendVersions[1].choices.size());
@@ -5061,18 +5121,16 @@ TEST(NewSdpTestNoFixture, CheckSimulcast
   }
 }
 
 TEST(NewSdpTestNoFixture, CheckSimulcastInvalidParse)
 {
   ParseInvalid<SdpSimulcastAttribute>("", 0);
   ParseInvalid<SdpSimulcastAttribute>(" ", 1);
   ParseInvalid<SdpSimulcastAttribute>("vcer ", 4);
-  ParseInvalid<SdpSimulcastAttribute>(" send x", 7);
-  ParseInvalid<SdpSimulcastAttribute>(" recv x", 7);
   ParseInvalid<SdpSimulcastAttribute>(" send pt=8 send ", 15);
   ParseInvalid<SdpSimulcastAttribute>(" recv pt=8 recv ", 15);
 }
 
 static SdpRidAttributeList::Rid ParseRid(const std::string& input) {
   std::istringstream is(input);
   std::string error;
   SdpRidAttributeList::Rid rid;