Bug 1531075: Allow offers to be created/set without any transceivers, re-enable some tests, and fix a mochitest. r=jib
authorByron Campen [:bwc] <docfaraday@gmail.com>
Wed, 13 Mar 2019 16:46:40 +0000
changeset 521733 7314b493edd359db107d335fb79adbc73e30bfd1
parent 521732 9c7c3ca1638713bec7857c25eafa4b2099594d29
child 521734 9867bfb9fb4dcfc8259eafd2630ec2e51c28dd0c
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1531075
milestone67.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 1531075: Allow offers to be created/set without any transceivers, re-enable some tests, and fix a mochitest. r=jib Differential Revision: https://phabricator.services.mozilla.com/D23022
dom/media/tests/mochitest/mochitest.ini
dom/media/tests/mochitest/test_peerConnection_bug1064223.html
dom/media/tests/mochitest/test_peerConnection_throwInCallbacks.html
media/webrtc/signaling/gtest/jsep_session_unittest.cpp
media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
testing/web-platform/meta/webrtc/RTCPeerConnection-createOffer.html.ini
testing/web-platform/meta/webrtc/RTCPeerConnection-setLocalDescription-answer.html.ini
testing/web-platform/meta/webrtc/RTCPeerConnection-setLocalDescription-rollback.html.ini
testing/web-platform/meta/webrtc/RTCPeerConnection-setLocalDescription.html.ini
testing/web-platform/meta/webrtc/RTCPeerConnection-setRemoteDescription-answer.html.ini
testing/web-platform/meta/webrtc/RTCPeerConnection-setRemoteDescription-offer.html.ini
--- a/dom/media/tests/mochitest/mochitest.ini
+++ b/dom/media/tests/mochitest/mochitest.ini
@@ -176,17 +176,16 @@ skip-if = toolkit == 'android' # Bug 104
 [test_peerConnection_bug825703.html]
 [test_peerConnection_bug827843.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_bug834153.html]
 [test_peerConnection_bug1013809.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_bug1042791.html]
 skip-if = toolkit == 'android' # Bug 1043403, Bug 1355786, Bug 1149374
-[test_peerConnection_bug1064223.html]
 [test_peerConnection_capturedVideo.html]
 tags=capturestream
 skip-if = toolkit == 'android' # android(Bug 1189784, timeouts on 4.3 emulator), Bug 1264340
 [test_peerConnection_captureStream_canvas_2d.html]
 skip-if = android_version == '18' # android(Bug 1319019, timeouts on 4.3 emulator)
 [test_peerConnection_captureStream_canvas_2d_noSSRC.html]
 skip-if = android_version == '18' # android(Bug 1319019, timeouts on 4.3 emulator)
 [test_peerConnection_multiple_captureStream_canvas_2d.html]
deleted file mode 100644
--- a/dom/media/tests/mochitest/test_peerConnection_bug1064223.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <script type="application/javascript" src="pc.js"></script>
-</head>
-<body>
-<pre id="test">
-<script type="application/javascript">
-  createHTML({
-    bug: "1064223",
-    title: "CreateOffer fails without streams or modern RTCOfferOptions"
-  });
-
-  runNetworkTest(function () {
-    var pc = new mozRTCPeerConnection();
-    var options = { mandatory: { OfferToReceiveVideo: true } }; // obsolete
-
-    pc.createOffer(options).then(() => ok(false, "createOffer must fail"),
-                                 e => is(e.name, "InvalidStateError",
-                                         "createOffer must fail"))
-    .catch(e => ok(false, e.message))
-    .then(() => {
-      pc.close();
-      networkTestFinished();
-    })
-    .catch(e => ok(false, e.message));
-  });
-</script>
-</pre>
-</body>
-</html>
--- a/dom/media/tests/mochitest/test_peerConnection_throwInCallbacks.html
+++ b/dom/media/tests/mochitest/test_peerConnection_throwInCallbacks.html
@@ -38,16 +38,17 @@ runNetworkTest(function () {
     }
     throw new Error("window.onerror may throw");
     return false;
   }
 
   let pc0, pc1, pc2;
   // Test failure callbacks (limited to 1 for now)
   pc0 = new RTCPeerConnection();
+  pc0.close();
   pc0.createOffer(getFail(), function(err) {
     pc1 = new RTCPeerConnection();
     pc2 = new RTCPeerConnection();
 
     // Test success callbacks (happy path)
     navigator.mozGetUserMedia({video:true}, function(video1) {
       pc1.addStream(video1);
       pc1.createOffer(function(offer) {
--- a/media/webrtc/signaling/gtest/jsep_session_unittest.cpp
+++ b/media/webrtc/signaling/gtest/jsep_session_unittest.cpp
@@ -4031,23 +4031,17 @@ TEST_P(JsepSessionTest, TestRejectMline)
     ASSERT_EQ(types.size(), GetLocalTracks(*mSessionOff).size());
     ASSERT_EQ(numAccepted, GetRemoteTracks(*mSessionOff).size());
 
     ASSERT_EQ(types.size(), GetLocalTracks(*mSessionAns).size());
     ASSERT_EQ(types.size(), GetRemoteTracks(*mSessionAns).size());
   }
 }
 
-TEST_F(JsepSessionTest, CreateOfferNoMlines) {
-  JsepOfferOptions options;
-  std::string offer;
-  nsresult rv = mSessionOff->CreateOffer(options, &offer);
-  ASSERT_NE(NS_OK, rv);
-  ASSERT_NE("", mSessionOff->GetLastError());
-}
+TEST_F(JsepSessionTest, NegotiationNoMlines) { OfferAnswer(); }
 
 TEST_F(JsepSessionTest, TestIceLite) {
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
   std::string offer = CreateOffer();
   SetLocalOffer(offer, CHECK_SUCCESS);
 
   UniquePtr<Sdp> parsedOffer(Parse(offer));
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
@@ -410,21 +410,16 @@ nsresult JsepSessionImpl::CreateOffer(co
   NS_ENSURE_SUCCESS(rv, rv);
 
   for (size_t level = 0;
        JsepTransceiver* transceiver = GetTransceiverForLocal(level); ++level) {
     rv = CreateOfferMsection(options, *transceiver, sdp.get());
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
-  if (!sdp->GetMediaSectionCount()) {
-    JSEP_SET_ERROR("Cannot create offer when there are no valid transceivers.");
-    return NS_ERROR_UNEXPECTED;
-  }
-
   SetupBundle(sdp.get());
 
   rv = RemoveDuplicateTrackIds(sdp.get());
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (mCurrentLocalDescription) {
     rv = CopyPreviousTransportParams(*GetAnswer(), *mCurrentLocalDescription,
                                      *sdp, sdp.get());
@@ -1257,21 +1252,16 @@ nsresult JsepSessionImpl::ParseSdp(const
         comparer.Compare(*rustParsed, *parsed, sdp);
       } else {
         comparer.TrackRustParsingFailed(mSipccParser.GetParseErrors().size());
       }
     }
   }
 
   // Verify that the JSEP rules for all SDP are followed
-  if (!parsed->GetMediaSectionCount()) {
-    JSEP_SET_ERROR("Description has no media sections");
-    return NS_ERROR_INVALID_ARG;
-  }
-
   for (size_t i = 0; i < parsed->GetMediaSectionCount(); ++i) {
     if (mSdpHelper.MsectionIsDisabled(parsed->GetMediaSection(i))) {
       // Disabled, let this stuff slide.
       continue;
     }
 
     const SdpMediaSection& msection(parsed->GetMediaSection(i));
     auto& mediaAttrs = msection.GetAttributeList();
deleted file mode 100644
--- a/testing/web-platform/meta/webrtc/RTCPeerConnection-createOffer.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[RTCPeerConnection-createOffer.html]
-  [createOffer() with no argument from newly created RTCPeerConnection should succeed]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531075
-
--- a/testing/web-platform/meta/webrtc/RTCPeerConnection-setLocalDescription-answer.html.ini
+++ b/testing/web-platform/meta/webrtc/RTCPeerConnection-setLocalDescription-answer.html.ini
@@ -2,16 +2,8 @@
   [setLocalDescription() with type answer and null sdp should use lastAnswer generated from createAnswer]
     expected: FAIL
     bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531110
 
   [setLocalDescription() with answer not created by own createAnswer() should reject with InvalidModificationError]
     expected: FAIL
     bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531118, https://bugzilla.mozilla.org/show_bug.cgi?id=1531122, https://bugzilla.mozilla.org/show_bug.cgi?id=1095226
 
-  [Calling setLocalDescription(answer) from stable state should reject with InvalidStateError]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531075
-
-  [Calling setLocalDescription(answer) from have-local-offer state should reject with InvalidStateError]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531075
-
deleted file mode 100644
--- a/testing/web-platform/meta/webrtc/RTCPeerConnection-setLocalDescription-rollback.html.ini
+++ /dev/null
@@ -1,9 +0,0 @@
-[RTCPeerConnection-setLocalDescription-rollback.html]
-  [setLocalDescription(rollback) from have-local-offer state should reset back to stable state]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531075
-
-  [setLocalDescription(rollback) should ignore invalid sdp content and succeed]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531075
-
deleted file mode 100644
--- a/testing/web-platform/meta/webrtc/RTCPeerConnection-setLocalDescription.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[RTCPeerConnection-setLocalDescription.html]
-  [onsignalingstatechange fires before setLocalDescription resolves]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531075
-
deleted file mode 100644
--- a/testing/web-platform/meta/webrtc/RTCPeerConnection-setRemoteDescription-answer.html.ini
+++ /dev/null
@@ -1,9 +0,0 @@
-[RTCPeerConnection-setRemoteDescription-answer.html]
-  [Calling setRemoteDescription(answer) from stable state should reject with InvalidStateError]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531075
-
-  [Calling setRemoteDescription(answer) from have-remote-offer state should reject with InvalidStateError]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531075
-
--- a/testing/web-platform/meta/webrtc/RTCPeerConnection-setRemoteDescription-offer.html.ini
+++ b/testing/web-platform/meta/webrtc/RTCPeerConnection-setRemoteDescription-offer.html.ini
@@ -6,12 +6,8 @@
   [setRemoteDescription multiple times with different offer should succeed]
     expected: FAIL
     bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1072388
 
   [setRemoteDescription(offer) with invalid SDP should reject with RTCError]
     expected: FAIL
     bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1527916
 
-  [setRemoteDescription(offer) from have-local-offer state should reject with InvalidStateError]
-    expected: FAIL
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531075
-