Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 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 | 11 |
| 12 function stateChanged() | 12 var pc = null; |
| 13 { | |
| 14 testPassed("stateChanged was called"); | |
| 15 shouldBeEqualToString('pc.signalingState', 'closed'); | |
| 16 finishJSTest(); | |
| 17 } | |
| 18 | 13 |
| 19 shouldNotThrow('pc = new webkitRTCPeerConnection({iceServers:[]}, null);'); | 14 function stateChanged() { |
| 20 shouldBeEqualToString('pc.signalingState', 'stable'); | 15 assert_equals(pc.signalingState, 'closed'); |
|
qyearsley
2016/09/06 16:07:55
If I change this string to something else, the tes
jsbell
2016/09/06 16:26:35
In async tests you must wrap callback functions so
| |
| 21 pc.onsignalingstatechange = stateChanged; | 16 test.done(); |
| 22 pc.close(); | 17 } |
| 23 | 18 |
| 24 window.jsTestIsAsync = true; | 19 test.step(function() { |
|
jsbell
2016/09/06 16:26:35
test.step() is not needed here since this is alrea
| |
| 25 window.successfullyParsed = true; | 20 pc = new webkitRTCPeerConnection({iceServers: []}, null); |
| 21 assert_equals(pc.signalingState, 'stable'); | |
| 22 pc.onsignalingstatechange = stateChanged; | |
|
jsbell
2016/09/06 16:26:35
The timeout should go away if you replace this wit
| |
| 23 pc.close(); | |
| 24 }); | |
| 25 }, 'Tests the RTCPeerConnection states.'); | |
| 26 | |
| 26 </script> | 27 </script> |
| 27 </body> | 28 </body> |
| 28 </html> | 29 </html> |
| OLD | NEW |