| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../../resources/js-test.js"></script> | |
| 5 </head> | |
| 6 <body> | |
| 7 <p id="description"></p> | |
| 8 <div id="console"></div> | |
| 9 <script> | |
| 10 description("Tests RTCIceCandidate."); | |
| 11 | |
| 12 var initializer = {candidate:"foo", sdpMid:"bar", sdpMLineIndex:6}; | |
| 13 var candidate; | |
| 14 shouldNotThrow('candidate = new RTCIceCandidate(initializer);'); | |
| 15 shouldBeEqualToString('candidate.candidate', 'foo'); | |
| 16 shouldBeEqualToString('candidate.sdpMid', 'bar'); | |
| 17 shouldBe('candidate.sdpMLineIndex', '6'); | |
| 18 | |
| 19 shouldNotThrow('initializer = JSON.parse(JSON.stringify(candidate));'); | |
| 20 | |
| 21 shouldNotThrow('candidate = new RTCIceCandidate(initializer);'); | |
| 22 shouldBeEqualToString('candidate.candidate', 'foo'); | |
| 23 shouldBeEqualToString('candidate.sdpMid', 'bar'); | |
| 24 shouldBe('candidate.sdpMLineIndex', '6'); | |
| 25 | |
| 26 shouldThrow('new RTCIceCandidate({});'); | |
| 27 shouldThrow('new RTCIceCandidate(5);'); | |
| 28 shouldThrow('new RTCIceCandidate("foobar");'); | |
| 29 shouldThrow('new RTCIceCandidate({candidate:""});'); | |
| 30 | |
| 31 shouldNotThrow('new RTCIceCandidate({candidate:"x"});'); | |
| 32 | |
| 33 candidate = new RTCIceCandidate(initializer); | |
| 34 candidate.candidate = "bar"; | |
| 35 candidate.sdpMid = "foo"; | |
| 36 candidate.sdpMLineIndex = 0; | |
| 37 shouldBeEqualToString('candidate.candidate', 'bar'); | |
| 38 shouldBeEqualToString('candidate.sdpMid', 'foo'); | |
| 39 shouldBe('candidate.sdpMLineIndex', '0'); | |
| 40 | |
| 41 candidate.candidate = null; | |
| 42 candidate.sdpMid = null; | |
| 43 shouldBeEqualToString('candidate.candidate', 'null'); | |
| 44 shouldBeEqualToString('candidate.sdpMid', 'null'); | |
| 45 | |
| 46 window.successfullyParsed = true; | |
| 47 </script> | |
| 48 </body> | |
| 49 </html> | |
| OLD | NEW |