Bug 1568296: Test cases for RTCRtpTransceiver.[[Stopping]]. r=jib

Differential Revision: https://phabricator.services.mozilla.com/D175260
This commit is contained in:
Byron Campen 2023-08-08 18:56:37 +00:00
parent cbdc1744cf
commit d8ce598494
9 changed files with 13 additions and 61 deletions

View File

@ -1,4 +0,0 @@
[RTCPeerConnection-setDescription-transceiver.html]
[setRemoteDescription should set transceiver inactive if its corresponding m section is rejected]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1728367
expected: FAIL

View File

@ -3,5 +3,3 @@
if os == "android": https://bugzilla.mozilla.org/show_bug.cgi?id=1641237
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[Closing the PC stops the transceivers]
expected: FAIL

View File

@ -1,8 +0,0 @@
[RTCRtpTransceiver-stop.html]
[If a transceiver is stopped, transceivers should end up in state stopped]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1568296
expected: FAIL
[If a transceiver is stopped, transceivers, senders and receivers should disappear after offer/answer]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1568296
expected: FAIL

View File

@ -1,2 +0,0 @@
[RTCRtpTransceiver-stopping.https.html]
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1568296

View File

@ -1,42 +1,3 @@
[RTCRtpTransceiver.https.html]
restart-after:
if os == "android": https://bugzilla.mozilla.org/show_bug.cgi?id=1641237
[checkStop]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1568296
expected: FAIL
[checkStopAfterCreateOffer]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1568296
expected: FAIL
[checkStopAfterSetLocalOffer]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1568296
expected: FAIL
[checkStopAfterSetRemoteOffer]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1568296
expected: FAIL
[checkStopAfterCreateAnswer]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1568296
expected: FAIL
[checkStopAfterSetLocalAnswer]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1568296
expected: FAIL
[checkLocalRollback]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1568296
expected: FAIL
[checkRemoteRollback]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1568296
expected: FAIL
[checkCurrentDirection]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1568296
expected: FAIL
[checkMsectionReuse]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1568296
expected: FAIL

View File

@ -301,6 +301,8 @@
const sender = pc.addTrack(track, stream);
pc.getTransceivers()[0].stop();
// TODO: Spec says this only sets [[Stopping]], not [[Stopped]]. Spec
// might change: https://github.com/w3c/webrtc-pc/issues/2874
pc.removeTrack(sender);
assert_equals(sender.track, track);
}, "Calling removeTrack on a stopped transceiver should be a no-op");

View File

@ -79,7 +79,6 @@
const transceiver = pc.addTransceiver('audio');
const { sender } = transceiver;
transceiver.stop();
return promise_rejects_dom(t, 'InvalidStateError',
sender.replaceTrack(track));
}, 'Calling replaceTrack on stopped sender should reject with InvalidStateError');

View File

@ -23,7 +23,6 @@
const param = sender.getParameters();
transceiver.stop();
return promise_rejects_dom(t, 'InvalidStateError',
sender.setParameters(param));
}, `setParameters() when transceiver is stopped should reject with InvalidStateError`);

View File

@ -49,8 +49,7 @@
t.add_cleanup(() => pc.close());
const transceiver = pc.addTransceiver(kind);
const trackEnded = new Promise(
r => { transceiver.receiver.track.onended = () => { r(); } });
const trackEnded = new Promise(r => transceiver.receiver.track.onended = r);
assert_equals(transceiver.receiver.track.readyState, 'live');
transceiver.stop();
// Stopping triggers ending the track, but this happens asynchronously.
@ -79,6 +78,10 @@
// Applying the remote offer immediately ends the track, we don't need to
// create or apply an answer.
await pc2.setRemoteDescription(pc1.localDescription);
// sRD just resolved, so we're in the success task for sRD. The transition
// from live -> ended is queued right now.
assert_equals(pc2Transceiver.receiver.track.readyState, 'live');
await new Promise(r => pc2Transceiver.receiver.track.onended = r);
assert_equals(pc2Transceiver.receiver.track.readyState, 'ended');
}, `[${kind}] Remotely stopping a transceiver ends the track`);
@ -152,8 +155,12 @@
const [pc2Transceiver] = pc2.getTransceivers();
// Rollback such that the transceiver is removed.
await pc2.setLocalDescription({type:'rollback'});
await pc2.setRemoteDescription({type:'rollback'});
assert_equals(pc2.getTransceivers().length, 0);
// sRD just resolved, so we're in the success task for sRD. The transition
// from live -> ended is queued right now.
assert_equals(pc2Transceiver.receiver.track.readyState, 'live');
await new Promise(r => pc2Transceiver.receiver.track.onended = r);
assert_equals(pc2Transceiver.receiver.track.readyState, 'ended');
}, `[${kind}] Rollback when removing transceiver does end the track`);
@ -172,7 +179,7 @@
const [pc2Transceiver] = pc2.getTransceivers();
// Rollback such that the transceiver is removed.
await pc2.setLocalDescription({type:'rollback'});
await pc2.setRemoteDescription({type:'rollback'});
assert_equals(pc2.getTransceivers().length, 0);
// The removed transceiver is stopped.
assert_equals(pc2Transceiver.currentDirection, 'stopped',