diff --git a/webrtc/RTCPeerConnection-explicit-rollback-iceGatheringState.html b/webrtc/RTCPeerConnection-explicit-rollback-iceGatheringState.html index 9c1fe014bd9ee18..e39b985bef2fe65 100644 --- a/webrtc/RTCPeerConnection-explicit-rollback-iceGatheringState.html +++ b/webrtc/RTCPeerConnection-explicit-rollback-iceGatheringState.html @@ -12,8 +12,9 @@ t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); t.add_cleanup(() => pc2.close()); + pc1.addTransceiver('audio', { direction: 'recvonly' }); await initialOfferAnswerWithIceGatheringStateTransitions( - pc1, pc2, {offerToReceiveAudio: true}); + pc1, pc2); await pc1.setLocalDescription(await pc1.createOffer({iceRestart: true})); await iceGatheringStateTransitions(pc1, 'gathering', 'complete'); expectNoMoreGatheringStateChanges(t, pc1); @@ -24,8 +25,9 @@ promise_test(async t => { const pc = new RTCPeerConnection(); t.add_cleanup(() => pc.close()); + pc.addTransceiver('audio', { direction: 'recvonly' }); await pc.setLocalDescription( - await pc.createOffer({offerToReceiveAudio: true})); + await pc.createOffer()); await iceGatheringStateTransitions(pc, 'gathering', 'complete'); await pc.setLocalDescription({type: 'rollback'}); await iceGatheringStateTransitions(pc, 'new'); @@ -34,8 +36,9 @@ promise_test(async t => { const pc = new RTCPeerConnection(); t.add_cleanup(() => pc.close()); + pc.addTransceiver('audio', { direction: 'recvonly' }); await pc.setLocalDescription( - await pc.createOffer({offerToReceiveAudio: true})); + await pc.createOffer()); await iceGatheringStateTransitions(pc, 'gathering'); await pc.setLocalDescription({type: 'rollback'}); // We might go directly to 'new', or we might go to 'complete' first, diff --git a/webrtc/RTCPeerConnection-iceGatheringState.html b/webrtc/RTCPeerConnection-iceGatheringState.html index 58b1489d9ff9a63..6afaf0fbfbd1dc2 100644 --- a/webrtc/RTCPeerConnection-iceGatheringState.html +++ b/webrtc/RTCPeerConnection-iceGatheringState.html @@ -91,8 +91,9 @@ t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); t.add_cleanup(() => pc2.close()); + pc1.addTransceiver('audio', { direction: 'recvonly' }); await initialOfferAnswerWithIceGatheringStateTransitions( - pc1, pc2, {offerToReceiveAudio: true}); + pc1, pc2); expectNoMoreGatheringStateChanges(t, pc1); expectNoMoreGatheringStateChanges(t, pc2); @@ -119,8 +120,9 @@ t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); t.add_cleanup(() => pc2.close()); + pc1.addTransceiver('audio', { direction: 'recvonly' }); await initialOfferAnswerWithIceGatheringStateTransitions( - pc1, pc2, {offerToReceiveAudio:true}); + pc1, pc2); await pc1.setLocalDescription(await pc1.createOffer({iceRestart: true})); await iceGatheringStateTransitions(pc1, 'gathering', 'complete'); }, 'setLocalDescription(reoffer) with a new transport should cause iceGatheringState to go to "checking" and then "complete"'); @@ -131,7 +133,8 @@ const pc2 = new RTCPeerConnection(); t.add_cleanup(() => pc2.close()); expectNoMoreGatheringStateChanges(t, pc2); - const offer = await pc1.createOffer({offerToReceiveAudio: true}); + pc1.addTransceiver('audio', { direction: 'recvonly' }); + const offer = await pc1.createOffer(); await pc2.setRemoteDescription(offer); await pc2.setRemoteDescription(offer); await pc2.setRemoteDescription({type: 'rollback'}); @@ -143,8 +146,9 @@ t.add_cleanup(() => pc1.close()); const pc2 = new RTCPeerConnection(); t.add_cleanup(() => pc2.close()); + pc1.addTransceiver('audio', { direction: 'recvonly' }); await initialOfferAnswerWithIceGatheringStateTransitions( - pc1, pc2, {offerToReceiveAudio: true}); + pc1, pc2); const pc1waiter = iceGatheringStateTransitions(pc1, 'new'); const pc2waiter = iceGatheringStateTransitions(pc2, 'new'); diff --git a/webrtc/RTCPeerConnection-setLocalDescription-answer.html b/webrtc/RTCPeerConnection-setLocalDescription-answer.html index 821ee1d0b15ce11..a6a02108f12b4a2 100644 --- a/webrtc/RTCPeerConnection-setLocalDescription-answer.html +++ b/webrtc/RTCPeerConnection-setLocalDescription-answer.html @@ -177,11 +177,13 @@ const pc2 = new RTCPeerConnection(); t.add_cleanup(() => pc2.close()); - const offer = await pc1.createOffer({offerToReceiveAudio: true}); + pc1.addTransceiver('audio', { direction: 'recvonly' }); + const offer = await pc1.createOffer(); await pc2.setRemoteDescription(offer); const answer = await pc2.createAnswer(); // [[LastAnswer]] slot set await pc2.setRemoteDescription({type: "rollback"}); - await pc2.createOffer({offerToReceiveVideo: true}); // [[LastOffer]] slot set + pc2.addTransceiver('video', { direction: 'recvonly' }); + await pc2.createOffer(); // [[LastOffer]] slot set await pc2.setRemoteDescription(offer); await pc2.setLocalDescription(answer); // Should check against [[LastAnswer]], not [[LastOffer]] }, "Setting previously generated answer after a call to createOffer should work"); @@ -192,7 +194,8 @@ const pc2 = new RTCPeerConnection(); t.add_cleanup(() => pc2.close()); - await pc2.setRemoteDescription(await pc1.createOffer({offerToReceiveAudio: true})); + pc1.addTransceiver('audio', { direction: 'recvonly' }); + await pc2.setRemoteDescription(await pc1.createOffer()); const answer = await pc2.createAnswer(); const sldPromise = pc2.setLocalDescription(answer); diff --git a/webrtc/RTCPeerConnection-setLocalDescription-offer.html b/webrtc/RTCPeerConnection-setLocalDescription-offer.html index 7af7150df608b60..c4f476b009d504b 100644 --- a/webrtc/RTCPeerConnection-setLocalDescription-offer.html +++ b/webrtc/RTCPeerConnection-setLocalDescription-offer.html @@ -163,8 +163,10 @@ const pc2 = new RTCPeerConnection(); t.add_cleanup(() => pc2.close()); - const offer = await pc1.createOffer({offerToReceiveAudio: true}); // [[LastOffer]] set - const offer2 = await pc2.createOffer({offerToReceiveVideo: true}); + pc1.addTransceiver('audio', { direction: 'recvonly' }); + const offer = await pc1.createOffer(); // [[LastOffer]] set + pc2.addTransceiver('video', { direction: 'recvonly' }); + const offer2 = await pc2.createOffer(); await pc1.setRemoteDescription(offer2); await pc1.createAnswer(); // [[LastAnswer]] set await pc1.setRemoteDescription({type: "rollback"}); @@ -177,7 +179,8 @@ const pc2 = new RTCPeerConnection(); t.add_cleanup(() => pc2.close()); - await pc1.setLocalDescription(await pc1.createOffer({offerToReceiveAudio: true})); + pc1.addTransceiver('audio', { direction: 'recvonly' }); + await pc1.setLocalDescription(await pc1.createOffer()); const offer = await pc1.createOffer(); await pc1.setLocalDescription(offer); @@ -196,7 +199,8 @@ const pc = new RTCPeerConnection(); t.add_cleanup(() => pc.close()); - const sldPromise = pc.setLocalDescription(await pc.createOffer({offerToReceiveAudio: true})); + pc.addTransceiver('audio', { direction: 'recvonly' }); + const sldPromise = pc.setLocalDescription(await pc.createOffer()); assert_equals(pc.signalingState, "stable", "signalingState should not be set synchronously after a call to sLD"); diff --git a/webrtc/RTCPeerConnection-setLocalDescription-rollback.html b/webrtc/RTCPeerConnection-setLocalDescription-rollback.html index e1607b638366707..06bbcf9b10b58e7 100644 --- a/webrtc/RTCPeerConnection-setLocalDescription-rollback.html +++ b/webrtc/RTCPeerConnection-setLocalDescription-rollback.html @@ -132,7 +132,8 @@ const pc = new RTCPeerConnection(); t.add_cleanup(() => pc.close()); - await pc.setLocalDescription(await pc.createOffer({offerToReceiveAudio: true})); + pc.addTransceiver('audio', { direction: 'recvonly' }); + await pc.setLocalDescription(await pc.createOffer()); const sldPromise = pc.setLocalDescription({type: "rollback"}); assert_equals(pc.signalingState, "have-local-offer", "signalingState should not be set synchronously after a call to sLD"); diff --git a/webrtc/RTCPeerConnection-setRemoteDescription-offer.html b/webrtc/RTCPeerConnection-setRemoteDescription-offer.html index a50e969637294ae..247d6e0d49ec644 100644 --- a/webrtc/RTCPeerConnection-setRemoteDescription-offer.html +++ b/webrtc/RTCPeerConnection-setRemoteDescription-offer.html @@ -193,7 +193,8 @@ const pc2 = new RTCPeerConnection(); t.add_cleanup(() => pc2.close()); - const srdPromise = pc2.setRemoteDescription(await pc1.createOffer({offerToReceiveAudio: true})); + pc1.addTransceiver('audio', { direction: 'recvonly' }); + const srdPromise = pc2.setRemoteDescription(await pc1.createOffer()); assert_equals(pc2.signalingState, "stable", "signalingState should not be set synchronously after a call to sRD"); @@ -222,10 +223,12 @@ const pc2 = new RTCPeerConnection(); t.add_cleanup(() => pc2.close()); - await pc2.setLocalDescription(await pc2.createOffer({offerToReceiveAudio: true})); + pc2.addTransceiver('audio', { direction: 'recvonly' }); + await pc2.setLocalDescription(await pc2.createOffer()); // Implicit rollback! - const srdPromise = pc2.setRemoteDescription(await pc1.createOffer({offerToReceiveAudio: true})); + pc1.addTransceiver('audio', { direction: 'recvonly' }); + const srdPromise = pc2.setRemoteDescription(await pc1.createOffer()); assert_equals(pc2.signalingState, "have-local-offer", "signalingState should not be set synchronously after a call to sRD"); diff --git a/webrtc/RTCPeerConnection-setRemoteDescription-rollback.html b/webrtc/RTCPeerConnection-setRemoteDescription-rollback.html index a031a6015f4274d..94ed79cdb2f0420 100644 --- a/webrtc/RTCPeerConnection-setRemoteDescription-rollback.html +++ b/webrtc/RTCPeerConnection-setRemoteDescription-rollback.html @@ -121,10 +121,12 @@ t.add_cleanup(() => pc2.close()); // We don't use this right away - const offer1 = await pc1.createOffer({offerToReceiveAudio: true}); + pc1.addTransceiver('audio', { direction: 'recvonly' }); + const offer1 = await pc1.createOffer(); // Create offer from pc2, apply and rollback on pc1 - const offer2 = await pc2.createOffer({offerToReceiveAudio: true}); + pc2.addTransceiver('audio', { direction: 'recvonly' }); + const offer2 = await pc2.createOffer(); await pc1.setRemoteDescription(offer2); await pc1.setRemoteDescription({type: "rollback"}); @@ -147,7 +149,9 @@ const offer1 = await pc1.createOffer(); // Create offer from pc2, apply and rollback on pc1 - const offer2 = await pc2.createOffer({offerToReceiveAudio: true, offerToReceiveVideo: true}); + pc2.addTransceiver('audio', { direction: 'recvonly' }); + pc2.addTransceiver('video', { direction: 'recvonly' }); + const offer2 = await pc2.createOffer(); // pc1 now should change its mind about what level its video transceiver is // bound to. It was 0, now it is 1. await pc1.setRemoteDescription(offer2); diff --git a/webrtc/RTCPeerConnection-transceivers.https.html b/webrtc/RTCPeerConnection-transceivers.https.html index 110638cd74e8d91..a474f70928a640e 100644 --- a/webrtc/RTCPeerConnection-transceivers.https.html +++ b/webrtc/RTCPeerConnection-transceivers.https.html @@ -479,7 +479,8 @@ .then((offer) => { return pc1.setRemoteDescription(offer); }) .then(() => { return pc1.createAnswer(); }) .then((answer) => { return pc1.setLocalDescription(answer); }); - const pc1Promise = pc1.createOffer({ offerToReceiveAudio: true}) + pc1.addTransceiver('audio', { direction: 'recvonly' }); + const pc1Promise = pc1.createOffer() .then(() => { pc1.addTrack(pc1.getReceivers()[0].track); }); await Promise.all([pc1Promise, pc2Promise]); assert_equals(pc1.getSenders()[0].track, pc1.getReceivers()[0].track); @@ -494,7 +495,8 @@ const pc2Promise = pc2.createOffer() .then((offer) => { return pc1.setRemoteDescription(offer); }) .then(() => { return pc1.createAnswer(); }); - const pc1Promise = pc1.createOffer({ offerToReceiveAudio: true}) + pc1.addTransceiver('audio', { direction: 'recvonly' }); + const pc1Promise = pc1.createOffer() .then(() => { pc1.getTransceivers()[0].direction = 'inactive'; }); await Promise.all([pc1Promise, pc2Promise]); assert_equals(pc1.getTransceivers()[0].direction, 'inactive'); diff --git a/webrtc/protocol/RTCPeerConnection-payloadTypes.html b/webrtc/protocol/RTCPeerConnection-payloadTypes.html index eacbf38a0f6128e..066fc2e085e32da 100644 --- a/webrtc/protocol/RTCPeerConnection-payloadTypes.html +++ b/webrtc/protocol/RTCPeerConnection-payloadTypes.html @@ -13,7 +13,9 @@ const pc1 = new RTCPeerConnection(); t.add_cleanup(() => pc1.close()); - const offer = await pc1.createOffer({offerToReceiveAudio: true, offerToReceiveVideo: true}); + pc1.addTransceiver('audio', { direction: 'recvonly' }); + pc1.addTransceiver('video', { direction: 'recvonly' }); + const offer = await pc1.createOffer(); // Extract all payload types from the m= lines. const payloadTypes = offer.sdp.split('\n')