| 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 <title>RTCPeerConnection signalingState</title> |
| 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> |
| 5 </head> | 7 </head> |
| 6 <body> | 8 <body> |
| 7 <script> | 9 <script> |
| 8 description("Tests the RTCPeerConnection states."); | |
| 9 | 10 |
| 10 var pc = null; | 11 async_test(function(test) { |
| 12 var pc = new webkitRTCPeerConnection({iceServers: []}, null); |
| 13 assert_equals(pc.signalingState, 'stable'); |
| 14 pc.onsignalingstatechange = test.step_func(() => { |
| 15 assert_equals(pc.signalingState, 'closed'); |
| 16 test.done(); |
| 17 }); |
| 18 pc.close(); |
| 19 }, 'Tests the RTCPeerConnection "stable" and "closed" signalingState strings.'); |
| 11 | 20 |
| 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> | 21 </script> |
| 27 </body> | 22 </body> |
| 28 </html> | 23 </html> |
| OLD | NEW |