| 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(null, null);"); | |
| 12 shouldNotThrow("new webkitRTCPeerConnection(undefined);"); | 11 shouldNotThrow("new webkitRTCPeerConnection(undefined);"); |
| 13 shouldNotThrow("new webkitRTCPeerConnection(undefined, undefined);"); | |
| 14 shouldThrow("new webkitRTCPeerConnection();"); | 12 shouldThrow("new webkitRTCPeerConnection();"); |
| 15 shouldThrow("new webkitRTCPeerConnection('');"); | 13 shouldThrow("new webkitRTCPeerConnection('');"); |
| 16 shouldThrow("new webkitRTCPeerConnection(null, '');"); | |
| 17 | 14 |
| 18 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[]}, null);"); | 15 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[]});"); |
| 19 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com'}]},
null);"); | 16 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'stun:foo.com'}]})
;"); |
| 20 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', cr
edential:'x'}]}, null);"); | 17 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', cr
edential:'x'}]});"); |
| 21 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', cr
edential:'x'},{url:'stun:bar.com'}]}, null);"); | 18 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{url:'turn:foo.com', cr
edential:'x'},{url:'stun:bar.com'}]});"); |
| 22 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}
, null);"); | 19 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}
);"); |
| 23 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:['stun:foo.com',
'turn:foo.com']}]}, null);"); | 20 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{urls:['stun:foo.com',
'turn:foo.com']}]});"); |
| 24 | 21 |
| 25 shouldThrow("new webkitRTCPeerConnection({fooServers:[]}, null);"); | 22 shouldThrow("new webkitRTCPeerConnection({fooServers:[]});"); |
| 26 shouldThrow("new webkitRTCPeerConnection({iceServers:true}, null);"); | 23 shouldThrow("new webkitRTCPeerConnection({iceServers:true});"); |
| 27 shouldThrow("new webkitRTCPeerConnection({iceServers:[1, 2, 3]}, null);"); | 24 shouldThrow("new webkitRTCPeerConnection({iceServers:[1, 2, 3]});"); |
| 28 shouldThrow("new webkitRTCPeerConnection({iceServers:[{}]}, null);"); | 25 shouldThrow("new webkitRTCPeerConnection({iceServers:[{}]});"); |
| 29 shouldThrow("new webkitRTCPeerConnection({iceServers:[{url:'foo'}]}, null);"); | 26 shouldThrow("new webkitRTCPeerConnection({iceServers:[{url:'foo'}]});"); |
| 30 shouldThrow("new webkitRTCPeerConnection({iceServers:[{urls:[1, 'turn:foo.com']}
]}, null);"); | 27 shouldThrow("new webkitRTCPeerConnection({iceServers:[{urls:[1, 'turn:foo.com']}
]});"); |
| 31 | 28 |
| 32 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'none'
}, null);"); | 29 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'none'
});"); |
| 33 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'relay
'}, null);"); | 30 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'relay
'});"); |
| 34 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'all'}
, null);"); | 31 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'all'}
);"); |
| 35 shouldThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'foo'}, n
ull);"); | 32 shouldThrow("new webkitRTCPeerConnection({iceServers:[], iceTransports:'foo'});"
); |
| 36 | 33 |
| 37 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], bundlePolicy:'balanc
ed'}, null);"); | 34 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], bundlePolicy:'balanc
ed'});"); |
| 38 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], bundlePolicy:'max-bu
ndle'}, null);"); | 35 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], bundlePolicy:'max-bu
ndle'});"); |
| 39 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], bundlePolicy:'max-co
mpat'}, null);"); | 36 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], bundlePolicy:'max-co
mpat'});"); |
| 40 shouldThrow("new webkitRTCPeerConnection({iceServers:[], bundlePolicy:'foo'}, nu
ll);"); | 37 shouldThrow("new webkitRTCPeerConnection({iceServers:[], bundlePolicy:'foo'});")
; |
| 41 | 38 |
| 42 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], rtcpMuxPolicy:'negot
iate'}, null);"); | 39 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], rtcpMuxPolicy:'negot
iate'});"); |
| 43 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], rtcpMuxPolicy:'requi
re'}, null);"); | 40 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], rtcpMuxPolicy:'requi
re'});"); |
| 44 shouldThrow("new webkitRTCPeerConnection({iceServers:[], rtcpMuxPolicy:'foo'}, n
ull);"); | 41 shouldThrow("new webkitRTCPeerConnection({iceServers:[], rtcpMuxPolicy:'foo'});"
); |
| 45 | 42 |
| 43 // Deprecated. |
| 46 shouldNotThrow("new webkitRTCPeerConnection(null, {mandatory:{valid_and_supporte
d_1:1}});"); | 44 shouldNotThrow("new webkitRTCPeerConnection(null, {mandatory:{valid_and_supporte
d_1:1}});"); |
| 47 shouldNotThrow("new webkitRTCPeerConnection(null, {mandatory:{valid_and_supporte
d_1:1, valid_and_supported_2:1}});"); | 45 shouldNotThrow("new webkitRTCPeerConnection(null, {mandatory:{valid_and_supporte
d_1:1, valid_and_supported_2:1}});"); |
| 48 shouldNotThrow("new webkitRTCPeerConnection(null, {optional:[{valid_and_supporte
d_1:0}]});"); | 46 shouldNotThrow("new webkitRTCPeerConnection(null, {optional:[{valid_and_supporte
d_1:0}]});"); |
| 49 shouldNotThrow("new webkitRTCPeerConnection(null, {optional:[{valid_and_supporte
d_1:0},{valid_and_supported_2:0}]});"); | 47 shouldNotThrow("new webkitRTCPeerConnection(null, {optional:[{valid_and_supporte
d_1:0},{valid_and_supported_2:0}]});"); |
| 50 shouldNotThrow("new webkitRTCPeerConnection(null, {optional:[{valid_but_unsuppor
ted_1:0},{valid_but_unsupported_2:0}]});"); | 48 shouldNotThrow("new webkitRTCPeerConnection(null, {optional:[{valid_but_unsuppor
ted_1:0},{valid_but_unsupported_2:0}]});"); |
| 51 shouldThrow("new webkitRTCPeerConnection(null, {mandatory:{valid_and_supported_1
:66}});"); | 49 shouldThrow("new webkitRTCPeerConnection(null, {mandatory:{valid_and_supported_1
:66}});"); |
| 52 shouldThrow("new webkitRTCPeerConnection(null, {mandatory:{invalid:1}});"); | 50 shouldThrow("new webkitRTCPeerConnection(null, {mandatory:{invalid:1}});"); |
| 53 shouldThrow("new webkitRTCPeerConnection(null, {mandatory:{valid_but_unsupported
_1:1}});"); | 51 shouldThrow("new webkitRTCPeerConnection(null, {mandatory:{valid_but_unsupported
_1:1}});"); |
| 54 shouldThrow("new webkitRTCPeerConnection(null, {mandatory:{valid_but_unsupported
_1:1, valid_and_supported_1:1}});"); | 52 shouldThrow("new webkitRTCPeerConnection(null, {mandatory:{valid_but_unsupported
_1:1, valid_and_supported_1:1}});"); |
| 55 shouldThrow("new webkitRTCPeerConnection(null, {optional:{valid_and_supported_1:
0}});"); | 53 shouldThrow("new webkitRTCPeerConnection(null, {optional:{valid_and_supported_1:
0}});"); |
| 56 shouldThrow("new webkitRTCPeerConnection(null, {optional:[{valid_and_supported_1
:0,valid_and_supported_2:0}]});"); | 54 shouldThrow("new webkitRTCPeerConnection(null, {optional:[{valid_and_supported_1
:0,valid_and_supported_2:0}]});"); |
| 57 shouldThrow("new webkitRTCPeerConnection(null, {optional:[{invalid:0}]});"); | 55 shouldThrow("new webkitRTCPeerConnection(null, {optional:[{invalid:0}]});"); |
| 58 shouldThrow("new webkitRTCPeerConnection(null, {valid_and_supported_1:1});"); | 56 shouldThrow("new webkitRTCPeerConnection(null, {valid_and_supported_1:1});"); |
| 59 shouldThrow("new webkitRTCPeerConnection(null, {valid_but_unsupported_1:1});"); | 57 shouldThrow("new webkitRTCPeerConnection(null, {valid_but_unsupported_1:1});"); |
| 60 shouldThrow("new webkitRTCPeerConnection(null, {valid_and_supported_2:1, mandato
ry:{valid_and_supported_1:1}});"); | 58 shouldThrow("new webkitRTCPeerConnection(null, {valid_and_supported_2:1, mandato
ry:{valid_and_supported_1:1}});"); |
| 61 | 59 |
| 62 // Construct with certificates. | 60 // Construct with certificates. |
| 63 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], certificates:null},
null);"); | 61 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], certificates:null});
"); |
| 64 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[]}, nu
ll);"); | 62 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[]});")
; |
| 65 shouldThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[null]}, n
ull);"); | 63 shouldThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[null]});"
); |
| 66 shouldThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[1337]}, n
ull);"); | 64 shouldThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[1337]});"
); |
| 67 // Global certificate variables so that the "should..." methods can evaluate the
m. | 65 // Global certificate variables so that the "should..." methods can evaluate the
m. |
| 68 var certRSA = null; | 66 var certRSA = null; |
| 69 var certECDSA = null; | 67 var certECDSA = null; |
| 70 | 68 |
| 71 function testCertificates1RSA() | 69 function testCertificates1RSA() |
| 72 { | 70 { |
| 73 webkitRTCPeerConnection.generateCertificate({ name: "RSASSA-PKCS1-v1_5", mod
ulusLength: 2048, publicExponent: new Uint8Array([1, 0, 1]), hash: "SHA-256" }) | 71 webkitRTCPeerConnection.generateCertificate({ name: "RSASSA-PKCS1-v1_5", mod
ulusLength: 2048, publicExponent: new Uint8Array([1, 0, 1]), hash: "SHA-256" }) |
| 74 .then(function(certificate) { | 72 .then(function(certificate) { |
| 75 certRSA = certificate; | 73 certRSA = certificate; |
| 76 shouldNotThrow('new webkitRTCPeerConnection({iceServers:[], ce
rtificates:[certRSA]}, null);'); | 74 shouldNotThrow('new webkitRTCPeerConnection({iceServers:[], ce
rtificates:[certRSA]}, null);'); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 96 } | 94 } |
| 97 // Sequentially test construction with RSA and ECDSA certificates. | 95 // Sequentially test construction with RSA and ECDSA certificates. |
| 98 // testCertificates2ECDSA's callback methods mark the end of the async tests. | 96 // testCertificates2ECDSA's callback methods mark the end of the async tests. |
| 99 testCertificates1RSA(); | 97 testCertificates1RSA(); |
| 100 | 98 |
| 101 window.jsTestIsAsync = true; | 99 window.jsTestIsAsync = true; |
| 102 window.successfullyParsed = true; | 100 window.successfullyParsed = true; |
| 103 </script> | 101 </script> |
| 104 </body> | 102 </body> |
| 105 </html> | 103 </html> |
| OLD | NEW |