| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head> |
| <script src="../js/resources/js-test-pre.js"></script> |
| </head> |
| <body> |
| <script> |
| description("Tests the RTCPeerConnection Ice functionality."); |
| |
| var pc = null; |
| |
| function onIceChange2() |
| { |
| if (pc.iceConnectionState === "closed") { |
| testPassed("iceConnectionState is closed."); |
| finishJSTest(); |
| } |
| } |
| |
| function onIceCandidate(event) |
| { |
| testPassed("onIceCandidate was called."); |
| shouldBe('event.candidate.candidate', '"nano nano"'); |
| |
| pc.oniceconnectionstatechange = onIceChange2; |
| pc.close(); |
| } |
| |
| function onIceChange1() |
| { |
| if (pc.iceConnectionState === "completed") { |
| testPassed("iceConnectionState is completed"); |
| pc.onicecandidate = onIceCandidate; |
| pc.addIceCandidate(new RTCIceCandidate({candidate:"nano nano"})); |
| } |
| } |
| |
| shouldNotThrow('pc = new webkitRTCPeerConnection(null, null);'); |
| pc.oniceconnectionstatechange = onIceChange1; |
| |
| window.jsTestIsAsync = true; |
| window.successfullyParsed = true; |
| </script> |
| <script src="../js/resources/js-test-post.js"></script> |
| </body> |
| </html> |