Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit 65f12c6

Browse files
docfaradaymoz-wptsync-bot
authored andcommitted
Part 0: Remove a bug from a meta file, and test that we aren't comparing offers with answers.
Differential Revision: https://phabricator.services.mozilla.com/D24096 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1531122 gecko-commit: ecb3fee216580948044845803338c60e3a283ffe gecko-integration-branch: central gecko-reviewers: jib
1 parent 856a95f commit 65f12c6

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

webrtc/RTCPeerConnection-setLocalDescription-answer.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,19 @@
171171
pc.setLocalDescription(answer)));
172172
}, 'Calling setLocalDescription(answer) from have-local-offer state should reject with InvalidStateError');
173173

174+
promise_test(async t => {
175+
const pc1 = new RTCPeerConnection();
176+
t.add_cleanup(() => pc1.close());
177+
const pc2 = new RTCPeerConnection();
178+
t.add_cleanup(() => pc2.close());
179+
180+
const offer = await pc1.createOffer({offerToReceiveAudio: true});
181+
await pc2.setRemoteDescription(offer);
182+
const answer = await pc2.createAnswer(); // [[LastAnswer]] slot set
183+
await pc2.setRemoteDescription({type: "rollback"});
184+
await pc2.createOffer({offerToReceiveVideo: true}); // [[LastOffer]] slot set
185+
await pc2.setRemoteDescription(offer);
186+
await pc2.setLocalDescription(answer); // Should check against [[LastAnswer]], not [[LastOffer]]
187+
}, "Setting previously generated answer after a call to createOffer should work");
188+
174189
</script>

webrtc/RTCPeerConnection-setLocalDescription-offer.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,18 @@
157157
}))));
158158
}, 'Creating and setting offer multiple times should succeed');
159159

160+
promise_test(async t => {
161+
const pc1 = new RTCPeerConnection();
162+
t.add_cleanup(() => pc1.close());
163+
const pc2 = new RTCPeerConnection();
164+
t.add_cleanup(() => pc2.close());
165+
166+
const offer = await pc1.createOffer({offerToReceiveAudio: true}); // [[LastOffer]] set
167+
const offer2 = await pc2.createOffer({offerToReceiveVideo: true});
168+
await pc1.setRemoteDescription(offer2);
169+
await pc1.createAnswer(); // [[LastAnswer]] set
170+
await pc1.setRemoteDescription({type: "rollback"});
171+
await pc1.setLocalDescription(offer);
172+
}, "Setting previously generated offer after a call to createAnswer should work");
173+
160174
</script>

0 commit comments

Comments
 (0)