Bug 1545855: Modify a test to check that a mute event fires when the remote PC is closed, and a similar test for transceiver.stop() r=jib
authorByron Campen [:bwc] <docfaraday@gmail.com>
Wed, 01 May 2019 16:34:10 +0000
changeset 530948 bd72af1908de9418fcd1ca1b1b702db6ce0cb737
parent 530947 0ec1e2ef404db0cafa7a670ca20b01c8e0e60dd6
child 530949 7abb70ddfaf322e125cd5dd53fd3d242928d5a52
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
bugs1545855
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 1545855: Modify a test to check that a mute event fires when the remote PC is closed, and a similar test for transceiver.stop() r=jib Differential Revision: https://phabricator.services.mozilla.com/D28253
testing/web-platform/meta/webrtc/RTCPeerConnection-remote-track-mute.https.html.ini
testing/web-platform/tests/webrtc/RTCPeerConnection-remote-track-mute.https.html
--- a/testing/web-platform/meta/webrtc/RTCPeerConnection-remote-track-mute.https.html.ini
+++ b/testing/web-platform/meta/webrtc/RTCPeerConnection-remote-track-mute.https.html.ini
@@ -1,5 +1,9 @@
 [RTCPeerConnection-remote-track-mute.https.html]
   expected: TIMEOUT
-  [pc.close() mutes remote tracks]
+  [transceiver.stop() on one side (without renegotiation) causes mute events on the other]
     expected: TIMEOUT
-    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1531107
+    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1545855
+
+  [pc.close() on one side causes mute events on the other]
+    expected: NOTRUN
+    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1545855
--- a/testing/web-platform/tests/webrtc/RTCPeerConnection-remote-track-mute.https.html
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-remote-track-mute.https.html
@@ -95,13 +95,33 @@ promise_test(async t => {
   // Need to wait for the initial unmute event before closing, otherwise
   // there will be no transition from unmuted->muted.
   const muteWatcher = new EventWatcher(t, e.track, ['mute', 'unmute']);
   const unmutePromise = muteWatcher.wait_for('unmute');
   await exchangeAnswer(pc1, pc2);
   await unmutePromise;
 
   const mutePromise = muteWatcher.wait_for('mute');
-  pc2.close();
+  localTransceiver.stop();
   await mutePromise;
-}, 'pc.close() mutes remote tracks');
+}, 'transceiver.stop() on one side (without renegotiation) causes mute events on the other');
+
+promise_test(async t => {
+  const pc1 = createPeerConnectionWithCleanup(t);
+  const pc1Sender = pc1.addTrack(...await createTrackAndStreamWithCleanup(t));
+  const localTransceiver = findTransceiverForSender(pc1, pc1Sender);
+  const pc2 = createPeerConnectionWithCleanup(t);
+  exchangeIceCandidates(pc1, pc2);
+
+  const e = await exchangeOfferAndListenToOntrack(t, pc1, pc2);
+  // Need to wait for the initial unmute event before closing, otherwise
+  // there will be no transition from unmuted->muted.
+  const muteWatcher = new EventWatcher(t, e.track, ['mute', 'unmute']);
+  const unmutePromise = muteWatcher.wait_for('unmute');
+  await exchangeAnswer(pc1, pc2);
+  await unmutePromise;
+
+  const mutePromise = muteWatcher.wait_for('mute');
+  pc1.close();
+  await mutePromise;
+}, 'pc.close() on one side causes mute events on the other');
 
 </script>