Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/testharness.js"></script> |
| 5 <script src="../../resources/testharnessreport.js"></script> | |
| 5 </head> | 6 </head> |
| 6 <body> | 7 <body> |
| 7 <script> | 8 <script> |
| 8 description("Tests the RTCPeerConnection states."); | |
| 9 | 9 |
| 10 var pc = null; | 10 async_test(function(test) { |
| 11 var pc = null; | |
| 12 function stateChanged() { | |
| 13 assert_equals(pc.signalingState, 'closed'); | |
| 14 test.done(); | |
| 15 } | |
| 16 var pc = new webkitRTCPeerConnection({iceServers: []}, null); | |
|
jsbell
2016/09/06 20:02:07
The `var` here is not required.
| |
| 17 assert_equals(pc.signalingState, 'stable'); | |
| 18 pc.onsignalingstatechange = test.step_func(stateChanged); | |
| 19 pc.close(); | |
| 20 }, 'Tests the RTCPeerConnection states.'); | |
| 11 | 21 |
| 12 function stateChanged() | |
| 13 { | |
| 14 testPassed("stateChanged was called"); | |
| 15 shouldBeEqualToString('pc.signalingState', 'closed'); | |
| 16 finishJSTest(); | |
| 17 } | |
| 18 | |
| 19 shouldNotThrow('pc = new webkitRTCPeerConnection({iceServers:[]}, null);'); | |
| 20 shouldBeEqualToString('pc.signalingState', 'stable'); | |
| 21 pc.onsignalingstatechange = stateChanged; | |
| 22 pc.close(); | |
| 23 | |
| 24 window.jsTestIsAsync = true; | |
| 25 window.successfullyParsed = true; | |
| 26 </script> | 22 </script> |
| 27 </body> | 23 </body> |
| 28 </html> | 24 </html> |
| OLD | NEW |