Commit df10141b authored by Harald Alvestrand's avatar Harald Alvestrand Committed by Commit Bot

RTPTransceiver: Correct test to check direction, not "stopped" attribute

Bug: chromium:980879
Change-Id: Id056c1583e06c0211dda81538f7c263446ea60fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2410072Reviewed-by: default avatarHenrik Boström <hbos@chromium.org>
Commit-Queue: Harald Alvestrand <hta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806925}
parent 82eda384
This is a testharness.js-based test.
PASS setLocalDescription(offer) with m= section should assign mid to corresponding transceiver
PASS setRemoteDescription(offer) with m= section and no existing transceiver should create corresponding transceiver
PASS setLocalDescription(rollback) should unset transceiver.mid
PASS setLocalDescription(rollback) should only unset transceiver mids associated with current round
PASS setRemoteDescription(rollback) should remove newly created transceiver from transceiver list
FAIL setRemoteDescription should stop the transceiver if its corresponding m section is rejected assert_true: Transceiver is stopped expected true got false
Harness: the test ran to completion.
...@@ -248,18 +248,14 @@ ...@@ -248,18 +248,14 @@
const offer = await pc1.createOffer(); const offer = await pc1.createOffer();
await pc1.setLocalDescription(offer); await pc1.setLocalDescription(offer);
assert_false(pc1.getTransceivers()[0].stopped, 'Transceiver is not stopped');
await pc2.setRemoteDescription(offer); await pc2.setRemoteDescription(offer);
pc2.getTransceivers()[0].stop(); pc2.getTransceivers()[0].stop();
const answer = await pc2.createAnswer(); const answer = await pc2.createAnswer();
await pc1.setRemoteDescription(answer); await pc1.setRemoteDescription(answer);
assert_true(pc1.getTransceivers()[0].stopped, 'Transceiver is stopped'); assert_equals(pc1.getTransceivers()[0].currentDirection, 'inactive', 'A stopped m-line should give an inactive transceiver');
assert_equals(pc1.getReceivers().length, 0, 'getReceivers does not expose a receiver of a stopped transceiver'); }, 'setRemoteDescription should set transceiver inactive if its corresponding m section is rejected');
assert_equals(pc1.getSenders().length, 0, 'getSenders does not expose a sender of a stopped transceiver');
}, 'setRemoteDescription should stop the transceiver if its corresponding m section is rejected');
/* /*
TODO TODO
......
...@@ -4,6 +4,6 @@ FAIL setRemoteDescription(offer) with m= section and no existing transceiver sho ...@@ -4,6 +4,6 @@ FAIL setRemoteDescription(offer) with m= section and no existing transceiver sho
FAIL setLocalDescription(rollback) should unset transceiver.mid Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'. FAIL setLocalDescription(rollback) should unset transceiver.mid Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'.
FAIL setLocalDescription(rollback) should only unset transceiver mids associated with current round Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'. FAIL setLocalDescription(rollback) should only unset transceiver mids associated with current round Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'.
FAIL setRemoteDescription(rollback) should remove newly created transceiver from transceiver list Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'. FAIL setRemoteDescription(rollback) should remove newly created transceiver from transceiver list Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'.
FAIL setRemoteDescription should stop the transceiver if its corresponding m section is rejected promise_test: Unhandled rejection with value: object "InvalidStateError: Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'." FAIL setRemoteDescription should set transceiver inactive if its corresponding m section is rejected promise_test: Unhandled rejection with value: object "InvalidStateError: Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'."
Harness: the test ran to completion. Harness: the test ran to completion.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment