Bug 1504513 [wpt PR 13901] - Use addTransceiver instead of offerToReceive options if possible, a=testonly
authorYouenn Fablet <youennf@gmail.com>
Tue, 13 Nov 2018 11:11:15 +0000
changeset 446175 65e6ca6d7aff6a8e159465bf1329cb22e2b56acc
parent 446174 bd6652ebe170de6ed964fe7a2985c5de87f77903
child 446176 21ea2095c51e0b9dd5d65ea1810eadcca520c3a1
push id109847
push userwptsync@mozilla.com
push dateWed, 14 Nov 2018 13:43:00 +0000
treeherdermozilla-inbound@0b40f405c457 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1504513, 13901
milestone65.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 1504513 [wpt PR 13901] - Use addTransceiver instead of offerToReceive options if possible, a=testonly Automatic update from web-platform-testsUse addTransceiver instead of offerToReceive options if possible -- Merge pull request #13901 from youennf/remove-further-offerToReceiveXX Use addTransceiver instead of offerToReceive options if possible -- wpt-commits: 7b1635867dd746977895bfe1bb5a7f2d0afaffe7, c273f76920c9a675c639a049e1e778cfb8c6fbf5 wpt-pr: 13901
testing/web-platform/tests/webrtc/RTCPeerConnection-createAnswer.html
testing/web-platform/tests/webrtc/RTCPeerConnection-setLocalDescription-answer.html
testing/web-platform/tests/webrtc/RTCPeerConnection-setLocalDescription-offer.html
testing/web-platform/tests/webrtc/RTCPeerConnection-setLocalDescription-pranswer.html
testing/web-platform/tests/webrtc/RTCPeerConnection-setLocalDescription.html
testing/web-platform/tests/webrtc/RTCPeerConnection-setRemoteDescription-answer.html
testing/web-platform/tests/webrtc/RTCPeerConnection-setRemoteDescription-pranswer.html
testing/web-platform/tests/webrtc/no-media-call.html
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-createAnswer.html
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-createAnswer.html
@@ -34,17 +34,17 @@
    *  4. Let answer be a newly created RTCSessionDescriptionInit dictionary with its
    *     type member initialized to the string "answer" and its sdp member initialized to sdpString.
    */
   promise_test(t => {
     const pc = new RTCPeerConnection();
 
     t.add_cleanup(() => pc.close());
 
-    return pc.createOffer({ offerToReceiveVideo: true })
+    return generateVideoReceiveOnlyOffer(pc)
     .then(offer => pc.setRemoteDescription(offer))
     .then(() => pc.createAnswer())
     .then(answer => {
       assert_equals(typeof answer, 'object',
         'Expect answer to be plain object dictionary RTCSessionDescriptionInit');
 
       assert_false(answer instanceof RTCSessionDescription,
         'Expect answer to not be instance of RTCSessionDescription')
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-setLocalDescription-answer.html
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-setLocalDescription-answer.html
@@ -60,17 +60,17 @@
    */
   promise_test(t => {
     const pc = new RTCPeerConnection();
     t.add_cleanup(() => pc.close());
 
     const states = [];
     pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState));
 
-    return pc.createOffer({ offerToReceiveVideo: true })
+    return generateVideoReceiveOnlyOffer(pc)
     .then(offer =>
       pc.setRemoteDescription(offer)
       .then(() => pc.createAnswer())
       .then(answer =>
         pc.setLocalDescription(answer)
         .then(() => {
           assert_equals(pc.signalingState, 'stable');
           assert_session_desc_similar(pc.localDescription, answer);
@@ -92,17 +92,17 @@
       4.  If description.sdp is null and description.type is answer, set description.sdp
           to lastAnswer.
    */
   promise_test(t => {
     const pc = new RTCPeerConnection();
 
     t.add_cleanup(() => pc.close());
 
-    return pc.createOffer({ offerToReceiveVideo: true })
+    return generateVideoReceiveOnlyOffer(pc)
     .then(offer =>
       pc.setRemoteDescription(offer)
       .then(() => pc.createAnswer())
       .then(answer =>
         pc.setLocalDescription({ type: 'answer' })
         .then(() => {
           assert_equals(pc.signalingState, 'stable');
           assert_session_desc_similar(pc.localDescription, answer);
@@ -123,17 +123,17 @@
           reject the promise with a newly created InvalidModificationError and abort these
           steps.
    */
   promise_test(t => {
     const pc = new RTCPeerConnection();
 
     t.add_cleanup(() => pc.close());
 
-    return pc.createOffer({ offerToReceiveVideo: true })
+    return generateVideoReceiveOnlyOffer(pc)
     .then(offer =>
       pc.setRemoteDescription(offer)
       .then(() => generateAnswer(offer))
       .then(answer =>
         promise_rejects(t, 'InvalidModificationError',
           pc.setLocalDescription(answer))));
   }, 'setLocalDescription() with answer not created by own createAnswer() should reject with InvalidModificationError');
 
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-setLocalDescription-offer.html
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-setLocalDescription-offer.html
@@ -57,17 +57,17 @@
    */
   promise_test(t => {
     const pc = new RTCPeerConnection();
     t.add_cleanup(() => pc.close());
 
     const states = [];
     pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState));
 
-    return pc.createOffer({ offerToReceiveAudio: true })
+    return generateAudioReceiveOnlyOffer(pc)
     .then(offer =>
       pc.setLocalDescription(offer)
       .then(() => {
         assert_equals(pc.signalingState, 'have-local-offer');
         assert_session_desc_similar(pc.localDescription, offer);
         assert_session_desc_similar(pc.pendingLocalDescription, offer);
         assert_equals(pc.currentLocalDescription, null);
 
@@ -79,17 +79,17 @@
     4.3.2.  setLocalDescription
       2.  Let lastOffer be the result returned by the last call to createOffer.
       5.  If description.sdp is null and description.type is offer, set description.sdp
           to lastOffer.
    */
   promise_test(t => {
     const pc = new RTCPeerConnection();
     t.add_cleanup(() => pc.close());
-    return pc.createOffer({ offerToReceiveAudio: true })
+    return generateAudioReceiveOnlyOffer(pc)
     .then(offer =>
       pc.setLocalDescription({ type: 'offer' })
       .then(() => {
         assert_equals(pc.signalingState, 'have-local-offer');
         assert_session_desc_similar(pc.localDescription, offer);
         assert_session_desc_similar(pc.pendingLocalDescription, offer);
         assert_equals(pc.currentLocalDescription, null);
       }));
@@ -117,38 +117,38 @@
 
   promise_test(t => {
     // Create first offer with audio line, then second offer with
     // both audio and video line. Since the second offer is the
     // last offer, setLocalDescription would reject when setting
     // with the first offer
     const pc = new RTCPeerConnection();
     t.add_cleanup(() => pc.close());
-    return pc.createOffer({ offerToReceiveAudio: true })
+    return generateAudioReceiveOnlyOffer(pc)
     .then(offer1 =>
-      pc.createOffer({ offerToReceiveVideo: true })
+      generateVideoReceiveOnlyOffer(pc)
       .then(offer2 => {
         assert_session_desc_not_similar(offer1, offer2);
         return promise_rejects(t, 'InvalidModificationError',
           pc.setLocalDescription(offer1));
       }));
   }, 'Set created offer other than last offer should reject with InvalidModificationError');
 
   promise_test(t => {
     const pc = new RTCPeerConnection();
     t.add_cleanup(() => pc.close());
 
     const states = [];
     pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState));
 
-    return pc.createOffer({ offerToReceiveAudio: true })
+    return generateAudioReceiveOnlyOffer(pc)
     .then(offer1 =>
       pc.setLocalDescription(offer1)
       .then(() =>
-        pc.createOffer({ offerToReceiveVideo: true })
+        generateVideoReceiveOnlyOffer(pc)
         .then(offer2 =>
           pc.setLocalDescription(offer2)
           .then(offer2 => {
             assert_session_desc_not_similar(offer1, offer2);
             assert_equals(pc.signalingState, 'have-local-offer');
             assert_session_desc_similar(pc.localDescription, offer2);
             assert_session_desc_similar(pc.pendingLocalDescription, offer2);
             assert_equals(pc.currentLocalDescription, null);
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-setLocalDescription-pranswer.html
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-setLocalDescription-pranswer.html
@@ -81,17 +81,17 @@
    */
   promise_test(t => {
     const pc = new RTCPeerConnection();
     t.add_cleanup(() => pc.close());
 
     const states = [];
     pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState));
 
-    return pc.createOffer({ offerToReceiveVideo: true })
+    return generateVideoReceiveOnlyOffer(pc)
     .then(offer =>
       pc.setRemoteDescription(offer)
       .then(() => pc.createAnswer())
       .then(answer => {
         const pranswer = { type: 'pranswer', sdp: answer.sdp };
 
         return pc.setLocalDescription(pranswer)
         .then(() => {
@@ -114,17 +114,17 @@
 
   promise_test(t => {
     const pc = new RTCPeerConnection();
     t.add_cleanup(() => pc.close());
 
     const states = [];
     pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState));
 
-    return pc.createOffer({ offerToReceiveVideo: true })
+    return generateVideoReceiveOnlyOffer(pc)
     .then(offer =>
       pc.setRemoteDescription(offer)
       .then(() => pc.createAnswer())
       .then(answer => {
         const pranswer = { type: 'pranswer', sdp: answer.sdp };
 
         return pc.setLocalDescription(pranswer)
         .then(() => pc.setLocalDescription(pranswer))
@@ -136,17 +136,17 @@
 
   promise_test(t => {
     const pc = new RTCPeerConnection();
     t.add_cleanup(() => pc.close());
 
     const states = [];
     pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState));
 
-    return pc.createOffer({ offerToReceiveVideo: true })
+    return generateVideoReceiveOnlyOffer(pc)
     .then(offer =>
       pc.setRemoteDescription(offer)
       .then(() => pc.createAnswer())
       .then(answer => {
         const pranswer = { type: 'pranswer', sdp: answer.sdp };
 
         return pc.setLocalDescription(pranswer)
         .then(() => pc.setLocalDescription(answer))
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-setLocalDescription.html
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-setLocalDescription.html
@@ -45,24 +45,24 @@
 
   promise_test(t => {
     const pc = new RTCPeerConnection();
     t.add_cleanup(() => pc.close());
 
     const states = [];
     pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState));
 
-    return pc.createOffer({ offerToReceiveAudio: true })
+    return generateAudioReceiveOnlyOffer(pc)
     .then(offer1 =>
       pc.setLocalDescription(offer1)
       .then(() => generateAnswer(offer1))
       .then(answer => pc.setRemoteDescription(answer))
       .then(() => {
         pc.createDataChannel('test');
-        return pc.createOffer({ offerToReceiveVideo: true });
+        return generateVideoReceiveOnlyOffer(pc);
       })
       .then(offer2 =>
         pc.setLocalDescription(offer2)
         .then(() => {
           assert_equals(pc.signalingState, 'have-local-offer');
           assert_session_desc_not_similar(offer1, offer2);
           assert_session_desc_similar(pc.localDescription, offer2);
           assert_session_desc_similar(pc.currentLocalDescription, offer1);
@@ -79,17 +79,17 @@
     const states = [];
     pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState));
 
     return generateOffer({ pc, data: true })
     .then(offer => pc.setRemoteDescription(offer))
     .then(() => pc.createAnswer())
     .then(answer =>
       pc.setLocalDescription(answer)
-      .then(() => pc.createOffer({ offerToReceiveVideo: true }))
+      .then(() => generateVideoReceiveOnlyOffer(pc))
       .then(offer =>
         pc.setLocalDescription(offer)
         .then(() => {
           assert_equals(pc.signalingState, 'have-local-offer');
           assert_session_desc_similar(pc.localDescription, offer);
           assert_session_desc_similar(pc.currentLocalDescription, answer);
           assert_session_desc_similar(pc.pendingLocalDescription, offer);
 
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-setRemoteDescription-answer.html
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-setRemoteDescription-answer.html
@@ -59,17 +59,17 @@
    */
   promise_test(t => {
     const pc = new RTCPeerConnection();
     t.add_cleanup(() => pc.close());
 
     const states = [];
     pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState));
 
-    return pc.createOffer({ offerToReceiveVideo: true })
+    return generateVideoReceiveOnlyOffer(pc)
     .then(offer =>
       pc.setLocalDescription(offer)
       .then(() => generateAnswer(offer))
       .then(answer =>
         pc.setRemoteDescription(answer)
         .then(() => {
           assert_equals(pc.signalingState, 'stable');
 
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-setRemoteDescription-pranswer.html
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-setRemoteDescription-pranswer.html
@@ -81,17 +81,17 @@
    */
   promise_test(t => {
     const pc = new RTCPeerConnection();
     t.add_cleanup(() => pc.close());
 
     const states = [];
     pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState));
 
-    return pc.createOffer({ offerToReceiveVideo: true })
+    return generateVideoReceiveOnlyOffer(pc)
     .then(offer =>
       pc.setLocalDescription(offer)
       .then(() => generateAnswer(offer))
       .then(answer => {
         const pranswer = { type: 'pranswer', sdp: answer.sdp };
 
         return pc.setRemoteDescription(pranswer)
         .then(() => {
@@ -112,17 +112,17 @@
 
   promise_test(t => {
     const pc = new RTCPeerConnection();
     t.add_cleanup(() => pc.close());
 
     const states = [];
     pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState));
 
-    return pc.createOffer({ offerToReceiveVideo: true })
+    return generateVideoReceiveOnlyOffer(pc)
     .then(offer =>
       pc.setLocalDescription(offer)
       .then(() => generateAnswer(offer))
       .then(answer => {
         const pranswer = { type: 'pranswer', sdp: answer.sdp };
 
         return pc.setRemoteDescription(pranswer)
         .then(() => pc.setRemoteDescription(pranswer))
@@ -134,17 +134,17 @@
 
   promise_test(t => {
     const pc = new RTCPeerConnection();
     t.add_cleanup(() => pc.close());
 
     const states = [];
     pc.addEventListener('signalingstatechange', () => states.push(pc.signalingState));
 
-    return pc.createOffer({ offerToReceiveVideo: true })
+    return generateVideoReceiveOnlyOffer(pc)
     .then(offer =>
       pc.setLocalDescription(offer)
       .then(() => generateAnswer(offer))
       .then(answer => {
         const pranswer = { type: 'pranswer', sdp: answer.sdp };
 
         return pc.setRemoteDescription(pranswer)
         .then(() => pc.setRemoteDescription(answer))
--- a/testing/web-platform/tests/webrtc/no-media-call.html
+++ b/testing/web-platform/tests/webrtc/no-media-call.html
@@ -119,17 +119,15 @@ This test uses the legacy callback API w
     gFirstConnection = new RTCPeerConnection(null);
     gFirstConnection.onicecandidate = onIceCandidateToFirst;
     gFirstConnection.oniceconnectionstatechange = onIceConnectionStateChange;
 
     gSecondConnection = new RTCPeerConnection(null);
     gSecondConnection.onicecandidate = onIceCandidateToSecond;
     gSecondConnection.oniceconnectionstatechange = onIceConnectionStateChange;
 
-    // The offerToReceiveVideo is necessary and sufficient to make
-    // an actual connection.
     generateVideoReceiveOnlyOffer(gFirstConnection)
       .then(onOfferCreated, failed('createOffer'));
   });
 </script>
 
 </body>
 </html>