Skip to content

Commit

Permalink
Bug 1840199: Check that RTCDtlsTransport.statechange events don't fir…
Browse files Browse the repository at this point in the history
…e due to close(). r=jib

Also, remove some test code that was inadvertently checking that "stopping"
(as opposed to "stopped") transceivers were not represented in
getReceivers/getSenders.

Differential Revision: https://phabricator.services.mozilla.com/D184745
  • Loading branch information
docfaraday committed Aug 16, 2023
1 parent 5517c3d commit 36e8c0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
[RTCDtlsTransport-state.html]
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1307996
13 changes: 6 additions & 7 deletions testing/web-platform/tests/webrtc/RTCDtlsTransport-state.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,13 @@
const dtlsTransport2 = pc2.getTransceivers()[0].sender.transport;
await Promise.all([resolveWhen(t, dtlsTransport1, 'connected'),
resolveWhen(t, dtlsTransport2, 'connected')]);
let fired = false;
dtlsTransport1.onstatechange = t.step_func(() => fired = true);
dtlsTransport1.addEventListener('statechange', t.step_func(() => fired = true));
pc1.close();
assert_equals(dtlsTransport1.state, 'closed');
await new Promise(r => t.step_timeout(r, 10));
assert_false(fired, 'close() should not see a statechange event on close');
}, 'close() causes the local transport to close immediately');

promise_test(async t => {
Expand Down Expand Up @@ -128,13 +133,7 @@
stoppedTransceiver.stop();
await onended;

assert_equals(
pc1.getReceivers().length, 1,
'getReceivers does not expose a receiver of a stopped transceiver');
assert_equals(
pc1.getSenders().length, 1,
'getSenders does not expose a sender of a stopped transceiver');
assert_equals(audioTc.sender, pc1.getSenders()[0]); // sanity
assert_equals(audioTc.sender, pc1.getSenders()[1]); // sanity
assert_equals(audioTc.sender.transport, audioTp); // sanity
assert_equals(audioTp.state, 'connected');
}, 'stop bundled transceiver retains dtls transport state');
Expand Down

0 comments on commit 36e8c0a

Please sign in to comment.