Commit 8a16ef53 authored by Harald Alvestrand's avatar Harald Alvestrand Committed by Commit Bot

Add test for candidates always arriving after SLD resolves

Bug: chromium:1127309
Change-Id: I90602856ef9b021bf617fa8a7c95d872f87a8148
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2423886Reviewed-by: default avatarHenrik Boström <hbos@chromium.org>
Commit-Queue: Harald Alvestrand <hta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810157}
parent 8e5cd8ef
......@@ -186,6 +186,33 @@ promise_test(async t => {
assert_array_equals(pc2IceStates.events, ['new', 'checking', 'connected']);
}, 'Explicit offer/answer exchange gives a connection');
promise_test(async t => {
const pc1 = new RTCPeerConnection();
t.add_cleanup(() => pc1.close());
pc1.createDataChannel('datachannel');
pc1.onicecandidate = assert_unreached;
const offer = await pc1.createOffer();
await pc1.setLocalDescription(offer);
await new Promise(resolve => {
pc1.onicecandidate = resolve;
});
}, 'Candidates always arrive after setLocalDescription(offer) resolves');
promise_test(async t => {
const pc1 = new RTCPeerConnection();
const pc2 = new RTCPeerConnection();
t.add_cleanup(() => pc1.close());
t.add_cleanup(() => pc2.close());
pc1.createDataChannel('datachannel');
pc2.onicecandidate = assert_unreached;
const offer = await pc1.createOffer();
await pc2.setRemoteDescription(offer);
await pc2.setLocalDescription(await pc2.createAnswer());
await new Promise(resolve => {
pc2.onicecandidate = resolve;
});
}, 'Candidates always arrive after setLocalDescription(answer) resolves');
</script>
</body>
</html>
......@@ -4,5 +4,7 @@ FAIL Adding only caller -> callee candidates gives a connection promise_test: Un
FAIL Adding only callee -> caller candidates gives a connection promise_test: Unhandled rejection with value: object "TypeError: Cannot read property 'transport' of null"
FAIL Adding callee -> caller candidates from end-of-candidates gives a connection promise_test: Unhandled rejection with value: object "TypeError: Cannot read property 'transport' of null"
FAIL Explicit offer/answer exchange gives a connection promise_test: Unhandled rejection with value: object "TypeError: Cannot read property 'transport' of null"
PASS Candidates always arrive after setLocalDescription(offer) resolves
PASS Candidates always arrive after setLocalDescription(answer) resolves
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