Bug 1506588 [wpt PR 13899] - Move from offerToReceiveAudio to addTransceiver('audio'), a=testonly
authorYouenn Fablet <youennf@gmail.com>
Tue, 13 Nov 2018 11:11:09 +0000
changeset 446244 4d25311b68d8f42caac950882cbdf0e3155f1dc2
parent 446243 87ae85107bf0a8dcff7d5c4bb371f8f004c833f1
child 446245 5e07723bf7028d834b827322b5944c920a7a9cef
push id35039
push userrmaries@mozilla.com
push dateWed, 14 Nov 2018 22:17:41 +0000
treeherdermozilla-central@b0a40093b6b7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1506588, 13899
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 1506588 [wpt PR 13899] - Move from offerToReceiveAudio to addTransceiver('audio'), a=testonly Automatic update from web-platform-testsMove from offerToReceiveAudio to addTransceiver('audio') -- Merge pull request #13899 from youennf/move-offerToReceiveAudio-addTransceiver-audio Move from offerToReceiveAudio to addTransceiver('audio') -- wpt-commits: 59e5213b74251dbab6597c1dde436e4625530949, 6321ab57a1b7856d338950532ed44dd103d37863 wpt-pr: 13899
testing/web-platform/tests/webrtc/RTCPeerConnection-helper.js
testing/web-platform/tests/webrtc/RTCPeerConnection-setRemoteDescription.html
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-helper.js
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-helper.js
@@ -155,16 +155,26 @@ function generateOffer(options={}) {
       assert_equals(countApplicationLine(sdp), 0,
         'Expect m=application line to not present in generated SDP');
     }
 
     return offer;
   });
 }
 
+async function generateAudioReceiveOnlyOffer(pc)
+{
+    try {
+        pc.addTransceiver('audio', { direction: 'recvonly' });
+        return pc.createOffer();
+    } catch(e) {
+        return pc.createOffer({ offerToReceiveAudio: true });
+    }
+}
+
 async function generateVideoReceiveOnlyOffer(pc)
 {
     try {
         pc.addTransceiver('video', { direction: 'recvonly' });
         return pc.createOffer();
     } catch(e) {
         return pc.createOffer({ offerToReceiveVideo: true });
     }
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-setRemoteDescription.html
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-setRemoteDescription.html
@@ -86,17 +86,17 @@
     pc.onsignalingstatechange = t.step_func(() =>
         assert_equals(pc.signalingState, states[++eventCount]));
 
     const assert_state = state => {
       assert_equals(state, pc.signalingState);
       assert_equals(state, states[eventCount]);
     };
 
-    const offer = await pc.createOffer({ offerToReceiveAudio: true });
+    const offer = await generateAudioReceiveOnlyOffer(pc);
     assert_state('stable');
     await pc.setLocalDescription(offer);
     assert_state('have-local-offer');
     await pc2.setRemoteDescription(offer);
     await pc2.setLocalDescription(await pc2.createAnswer());
     await pc.setRemoteDescription(pc2.localDescription);
     assert_state('stable');
     await pc.setRemoteDescription(await pc2.createOffer());
@@ -106,34 +106,34 @@
   /* Operations after returning to stable state */
 
   promise_test(async t => {
     const pc = new RTCPeerConnection();
     const pc2 = new RTCPeerConnection();
     t.add_cleanup(() => pc.close());
     t.add_cleanup(() => pc2.close());
 
-    const offer1 = await pc2.createOffer({ offerToReceiveAudio: true });
+    const offer1 = await generateAudioReceiveOnlyOffer(pc2);
     await pc.setRemoteDescription(offer1);
     await pc.setLocalDescription(await pc.createAnswer());
-    const offer2 = await pc2.createOffer({ offerToReceiveVideo: true });
+    const offer2 = await generateVideoReceiveOnlyOffer(pc2);
     await pc.setRemoteDescription(offer2);
     assert_session_desc_not_similar(offer1, offer2);
     assert_session_desc_similar(pc.remoteDescription, offer2);
     assert_session_desc_similar(pc.currentRemoteDescription, offer1);
     assert_session_desc_similar(pc.pendingRemoteDescription, offer2);
   }, 'Calling setRemoteDescription() again after one round of remote-offer/local-answer should succeed');
 
   promise_test(async t => {
     const pc = new RTCPeerConnection();
     const pc2 = new RTCPeerConnection();
     t.add_cleanup(() => pc.close());
     t.add_cleanup(() => pc2.close());
 
-    const offer = await pc.createOffer({ offerToReceiveAudio: true });
+    const offer = await generateAudioReceiveOnlyOffer(pc);
     await pc.setLocalDescription(offer);
     await pc2.setRemoteDescription(offer);
     const answer = await pc2.createAnswer();
     await pc2.setLocalDescription(answer);
     await pc.setRemoteDescription(answer);
     await pc.setRemoteDescription(await pc2.createOffer());
     assert_equals(pc.remoteDescription.sdp, pc.pendingRemoteDescription.sdp);
     assert_session_desc_similar(pc.remoteDescription, offer);