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/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 shouldNotThrow("new webkitRTCPeerConnection(null);"); | 10 shouldNotThrow("new webkitRTCPeerConnection(null);"); |
11 shouldNotThrow("new webkitRTCPeerConnection(undefined);"); | 11 shouldNotThrow("new webkitRTCPeerConnection(undefined);"); |
12 shouldThrow("new webkitRTCPeerConnection();"); | 12 shouldNotThrow("new webkitRTCPeerConnection({});"); |
| 13 shouldNotThrow("new webkitRTCPeerConnection();"); |
13 shouldThrow("new webkitRTCPeerConnection('');"); | 14 shouldThrow("new webkitRTCPeerConnection('');"); |
14 | 15 |
15 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[]});"); | 16 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[]});"); |
16 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com'}]})
;"); | 17 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com'}]})
;"); |
17 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', cr
edential:'x'}]});"); | 18 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', cr
edential:'x'}]});"); |
18 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', cr
edential:'x'},{url:'stun:bar.com'}]});"); | 19 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', cr
edential:'x'},{url:'stun:bar.com'}]});"); |
19 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}
);"); | 20 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}
);"); |
20 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:['stun:foo.com',
'turn:foo.com']}]});"); | 21 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:['stun:foo.com',
'turn:foo.com']}]});"); |
21 | 22 |
22 shouldThrow("new webkitRTCPeerConnection({fooServers:[]});"); | 23 shouldNotThrow("new webkitRTCPeerConnection({fooServers:[]});"); |
23 shouldThrow("new webkitRTCPeerConnection({iceServers:true});"); | 24 shouldThrow("new webkitRTCPeerConnection({iceServers:true});"); |
24 shouldThrow("new webkitRTCPeerConnection({iceServers:[1, 2, 3]});"); | 25 shouldThrow("new webkitRTCPeerConnection({iceServers:[1, 2, 3]});"); |
25 shouldThrow("new webkitRTCPeerConnection({iceServers:[{}]});"); | 26 shouldThrow("new webkitRTCPeerConnection({iceServers:[{}]});"); |
26 shouldThrow("new webkitRTCPeerConnection({iceServers:[{url:'foo'}]});"); | 27 shouldThrow("new webkitRTCPeerConnection({iceServers:[{url:'foo'}]});"); |
27 shouldThrow("new webkitRTCPeerConnection({iceServers:[{urls:[1, 'turn:foo.com']}
]});"); | 28 shouldThrow("new webkitRTCPeerConnection({iceServers:[{urls:[1, 'turn:foo.com']}
]});"); |
28 | 29 |
29 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'none'
});"); | 30 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'none'
});"); |
30 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'relay
'});"); | 31 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'relay
'});"); |
31 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'all'}
);"); | 32 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'all'}
);"); |
32 shouldThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'foo'});"
); | 33 shouldThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'foo'});"
); |
(...skipping 20 matching lines...) Expand all Loading... |
53 shouldThrow("new webkitRTCPeerConnection(null, {optional:{valid_and_supported_1:
0}});"); | 54 shouldThrow("new webkitRTCPeerConnection(null, {optional:{valid_and_supported_1:
0}});"); |
54 shouldThrow("new webkitRTCPeerConnection(null, {optional:[{valid_and_supported_1
:0,valid_and_supported_2:0}]});"); | 55 shouldThrow("new webkitRTCPeerConnection(null, {optional:[{valid_and_supported_1
:0,valid_and_supported_2:0}]});"); |
55 // Optional constraints are ignored even if they are invalid. | 56 // Optional constraints are ignored even if they are invalid. |
56 shouldNotThrow("new webkitRTCPeerConnection(null, {optional:[{invalid:0}]});"); | 57 shouldNotThrow("new webkitRTCPeerConnection(null, {optional:[{invalid:0}]});"); |
57 shouldThrow("new webkitRTCPeerConnection(null, {valid_and_supported_1:1});"); | 58 shouldThrow("new webkitRTCPeerConnection(null, {valid_and_supported_1:1});"); |
58 shouldThrow("new webkitRTCPeerConnection(null, {valid_but_unsupported_1:1});"); | 59 shouldThrow("new webkitRTCPeerConnection(null, {valid_but_unsupported_1:1});"); |
59 shouldThrow("new webkitRTCPeerConnection(null, {valid_and_supported_2:1, mandato
ry:{valid_and_supported_1:1}});"); | 60 shouldThrow("new webkitRTCPeerConnection(null, {valid_and_supported_2:1, mandato
ry:{valid_and_supported_1:1}});"); |
60 | 61 |
61 // Construct with certificates. | 62 // Construct with certificates. |
62 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], certificates:null});
"); | 63 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], certificates:null});
"); |
| 64 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], certificates:undefin
ed});"); |
63 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[]});")
; | 65 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[]});")
; |
64 shouldThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[null]});"
); | 66 shouldThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[null]});"
); |
65 shouldThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[1337]});"
); | 67 shouldThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[1337]});"
); |
66 // Global certificate variables so that the "should..." methods can evaluate the
m. | 68 // Global certificate variables so that the "should..." methods can evaluate the
m. |
67 var certRSA = null; | 69 var certRSA = null; |
68 var certECDSA = null; | 70 var certECDSA = null; |
69 var certExpired = null; | 71 var certExpired = null; |
70 | 72 |
71 function testCertificates1RSA() | 73 function testCertificates1RSA() |
72 { | 74 { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 112 } |
111 // Sequentially test construction with RSA and ECDSA certificates. | 113 // Sequentially test construction with RSA and ECDSA certificates. |
112 // testCertificates3Expired's callback methods mark the end of the async tests. | 114 // testCertificates3Expired's callback methods mark the end of the async tests. |
113 testCertificates1RSA(); | 115 testCertificates1RSA(); |
114 | 116 |
115 window.jsTestIsAsync = true; | 117 window.jsTestIsAsync = true; |
116 window.successfullyParsed = true; | 118 window.successfullyParsed = true; |
117 </script> | 119 </script> |
118 </body> | 120 </body> |
119 </html> | 121 </html> |
OLD | NEW |