Bug 1547278 - Part 0: Test case for the bug. r=jib
authorByron Campen [:bwc] <docfaraday@gmail.com>
Wed, 01 May 2019 14:54:03 +0000
changeset 531095 7b505a8a1ad94c2e83dcbb7b505c4a16d6b21fff
parent 531094 5b08dd3eeec974c6ae229134906fc79dec7ef2ba
child 531096 6df281b9388839efca4fc89ae62aa2c696aaf76b
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1547278
milestone68.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 1547278 - Part 0: Test case for the bug. r=jib Differential Revision: https://phabricator.services.mozilla.com/D29404
testing/web-platform/tests/webrtc/RTCPeerConnection-setLocalDescription-offer.html
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-setLocalDescription-offer.html
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-setLocalDescription-offer.html
@@ -166,9 +166,30 @@
     const offer = await pc1.createOffer({offerToReceiveAudio: true}); // [[LastOffer]] set
     const offer2 = await pc2.createOffer({offerToReceiveVideo: true});
     await pc1.setRemoteDescription(offer2);
     await pc1.createAnswer(); // [[LastAnswer]] set
     await pc1.setRemoteDescription({type: "rollback"});
     await pc1.setLocalDescription(offer);
   }, "Setting previously generated offer after a call to createAnswer should work");
 
+  promise_test(async t => {
+    const pc1 = new RTCPeerConnection();
+    t.add_cleanup(() => pc1.close());
+    const pc2 = new RTCPeerConnection();
+    t.add_cleanup(() => pc2.close());
+
+    await pc1.setLocalDescription(await pc1.createOffer({offerToReceiveAudio: true}));
+
+    const offer = await pc1.createOffer();
+    await pc1.setLocalDescription(offer);
+    await pc2.setRemoteDescription(offer);
+    const answer = await pc2.createAnswer();
+    await pc2.setLocalDescription(answer);
+    await pc1.setRemoteDescription(answer);
+
+    assert_equals(pc1.getTransceivers().length, 1);
+    assert_equals(pc1.getTransceivers()[0].receiver.track.kind, "audio");
+    assert_equals(pc2.getTransceivers().length, 1);
+    assert_equals(pc2.getTransceivers()[0].receiver.track.kind, "audio");
+  }, "Negotiation works when there has been a repeated setLocalDescription(offer)");
+
 </script>