youenn@apple.com | e00b24d | 2020-11-30 19:08:40 +0000 | [diff] [blame] | 1 | <!doctype html> |
| 2 | <meta charset=utf-8> |
| 3 | <meta name="timeout" content="long"> |
| 4 | <title></title> |
| 5 | <script src=/resources/testharness.js></script> |
| 6 | <script src=/resources/testharnessreport.js></script> |
| 7 | <script> |
| 8 | 'use strict'; |
| 9 | |
| 10 | promise_test(async t => { |
| 11 | const pc = new RTCPeerConnection(); |
| 12 | t.add_cleanup(() => pc.close()); |
| 13 | const signalingStates = []; |
| 14 | pc.onsignalingstatechange = ev => signalingStates.push(pc.signalingState); |
| 15 | pc.addTransceiver('audio', {direction:'recvonly'}); |
| 16 | const offer = await pc.createOffer(); |
| 17 | const sldPromise = pc.setLocalDescription(offer); |
| 18 | const srdPromise = pc.setRemoteDescription(offer); |
| 19 | await Promise.all([sldPromise, srdPromise]); |
| 20 | assert_array_equals(signalingStates, |
| 21 | ['have-local-offer','stable','have-remote-offer']); |
| 22 | }, 'setLocalDescription and setRemoteDescription are not racy'); |
| 23 | |
| 24 | </script> |