Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection.html

Issue 2448843003: Throw SyntaxError for non-turn/turns/stun URLs (Closed)
Patch Set: split valid and scheme checks Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script> 7 <script>
8 description("Tests the RTCPeerConnection constructor."); 8 description("Tests the RTCPeerConnection constructor.");
9 9
10 shouldBe("webkitRTCPeerConnection", "RTCPeerConnection"); 10 shouldBe("webkitRTCPeerConnection", "RTCPeerConnection");
11 11
12 shouldNotThrow("new RTCPeerConnection(null);"); 12 shouldNotThrow("new RTCPeerConnection(null);");
13 shouldNotThrow("new RTCPeerConnection(undefined);"); 13 shouldNotThrow("new RTCPeerConnection(undefined);");
14 shouldNotThrow("new RTCPeerConnection({});"); 14 shouldNotThrow("new RTCPeerConnection({});");
15 shouldNotThrow("new RTCPeerConnection();"); 15 shouldNotThrow("new RTCPeerConnection();");
16 shouldThrow("new RTCPeerConnection('');"); 16 shouldThrow("new RTCPeerConnection('');");
17 17
18 shouldNotThrow("new RTCPeerConnection({iceServers:[]});"); 18 shouldNotThrow("new RTCPeerConnection({iceServers:[]});");
19 shouldNotThrow("new RTCPeerConnection({iceServers:[{url:'stun:foo.com'}]});"); 19 shouldNotThrow("new RTCPeerConnection({iceServers:[{url:'stun:foo.com'}]});");
20 shouldNotThrow("new RTCPeerConnection({iceServers:[{url:'turn:foo.com', credenti al:'x'}]});"); 20 shouldNotThrow("new RTCPeerConnection({iceServers:[{url:'turn:foo.com', credenti al:'x'}]});");
21 shouldNotThrow("new RTCPeerConnection({iceServers:[{url:'turn:foo.com', credenti al:'x'},{url:'stun:bar.com'}]});"); 21 shouldNotThrow("new RTCPeerConnection({iceServers:[{url:'turn:foo.com', credenti al:'x'},{url:'stun:bar.com'}]});");
22 shouldNotThrow("new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});"); 22 shouldNotThrow("new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});");
23 shouldNotThrow("new RTCPeerConnection({iceServers:[{urls:['stun:foo.com', 'turn: foo.com']}]});"); 23 shouldNotThrow("new RTCPeerConnection({iceServers:[{urls:['stun:foo.com', 'turn: foo.com']}]});");
24 24
25 shouldNotThrow("new RTCPeerConnection({fooServers:[]});"); 25 shouldNotThrow("new RTCPeerConnection({fooServers:[]});");
26 shouldThrow("new RTCPeerConnection({iceServers:true});"); 26 shouldThrow("new RTCPeerConnection({iceServers:true});");
27 shouldThrow("new RTCPeerConnection({iceServers:[1, 2, 3]});"); 27 shouldThrow("new RTCPeerConnection({iceServers:[1, 2, 3]});");
28 shouldThrow("new RTCPeerConnection({iceServers:[{}]});"); 28 shouldThrow("new RTCPeerConnection({iceServers:[{}]});");
29 shouldThrow("new RTCPeerConnection({iceServers:[{url:'foo'}]});"); 29 shouldThrow("new RTCPeerConnection({iceServers:[{url:'foo'}]});");
30 shouldThrow("new RTCPeerConnection({iceServers:[{urls:'unsupported:scheme'}]});" );
30 shouldThrow("new RTCPeerConnection({iceServers:[{urls:[1, 'turn:foo.com']}]});") ; 31 shouldThrow("new RTCPeerConnection({iceServers:[{urls:[1, 'turn:foo.com']}]});") ;
31 32
32 shouldNotThrow("new RTCPeerConnection({iceServers:[], iceTransports:'none'});"); 33 shouldNotThrow("new RTCPeerConnection({iceServers:[], iceTransports:'none'});");
33 shouldNotThrow("new RTCPeerConnection({iceServers:[], iceTransports:'relay'});") ; 34 shouldNotThrow("new RTCPeerConnection({iceServers:[], iceTransports:'relay'});") ;
34 shouldNotThrow("new RTCPeerConnection({iceServers:[], iceTransports:'all'});"); 35 shouldNotThrow("new RTCPeerConnection({iceServers:[], iceTransports:'all'});");
35 shouldThrow("new RTCPeerConnection({iceServers:[], iceTransports:'foo'});"); 36 shouldThrow("new RTCPeerConnection({iceServers:[], iceTransports:'foo'});");
36 37
37 shouldNotThrow("new RTCPeerConnection({iceServers:[], bundlePolicy:'balanced'}); "); 38 shouldNotThrow("new RTCPeerConnection({iceServers:[], bundlePolicy:'balanced'}); ");
38 shouldNotThrow("new RTCPeerConnection({iceServers:[], bundlePolicy:'max-bundle'} );"); 39 shouldNotThrow("new RTCPeerConnection({iceServers:[], bundlePolicy:'max-bundle'} );");
39 shouldNotThrow("new RTCPeerConnection({iceServers:[], bundlePolicy:'max-compat'} );"); 40 shouldNotThrow("new RTCPeerConnection({iceServers:[], bundlePolicy:'max-compat'} );");
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 } 115 }
115 // Sequentially test construction with RSA and ECDSA certificates. 116 // Sequentially test construction with RSA and ECDSA certificates.
116 // testCertificates3Expired's callback methods mark the end of the async tests. 117 // testCertificates3Expired's callback methods mark the end of the async tests.
117 testCertificates1RSA(); 118 testCertificates1RSA();
118 119
119 window.jsTestIsAsync = true; 120 window.jsTestIsAsync = true;
120 window.successfullyParsed = true; 121 window.successfullyParsed = true;
121 </script> 122 </script>
122 </body> 123 </body>
123 </html> 124 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698