Backed out changeset add69e4bd9af (bug 1531075) for wpt failures at RTCPeerConnection-setRemoteDescription-offer.html. CLOSED TREE
authorBrindusan Cristian <cbrindusan@mozilla.com>
Wed, 13 Mar 2019 18:22:39 +0200
changeset 521720 5899671d28c9c424f549666af6749ef93da8c92a
parent 521719 6bb6c4d3a048831ca9ea1d2c51ce1007ea6b070b
child 521721 0e32509a083f4bea24aec97a01fee14888572053
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)
bugs1531075
milestone67.0a1
backs outadd69e4bd9af8b952a29e66b6cf0df33be47f214
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
Backed out changeset add69e4bd9af (bug 1531075) for wpt failures at RTCPeerConnection-setRemoteDescription-offer.html. CLOSED TREE
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
--- a/dom/media/tests/mochitest/mochitest.ini
+++ b/dom/media/tests/mochitest/mochitest.ini
@@ -176,16 +176,17 @@ 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]
new file mode 100644
--- /dev/null
+++ b/dom/media/tests/mochitest/test_peerConnection_bug1064223.html
@@ -0,0 +1,31 @@
+<!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,17 +38,16 @@ 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,17 +4031,23 @@ 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, NegotiationNoMlines) { OfferAnswer(); }
+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, 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,16 +410,21 @@ 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());
@@ -1252,16 +1257,21 @@ 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();
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/webrtc/RTCPeerConnection-createOffer.html.ini
@@ -0,0 +1,5 @@
+[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,8 +2,16 @@
   [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
+
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/webrtc/RTCPeerConnection-setLocalDescription-rollback.html.ini
@@ -0,0 +1,9 @@
+[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
+
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/webrtc/RTCPeerConnection-setLocalDescription.html.ini
@@ -0,0 +1,5 @@
+[RTCPeerConnection-setLocalDescription.html]
+  [onsignalingstatechange fires before setLocalDescription resolves]
+    expected: FAIL
+    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531075
+
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/webrtc/RTCPeerConnection-setRemoteDescription-answer.html.ini
@@ -0,0 +1,9 @@
+[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
+