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);"); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 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}});"); |
61 | 61 |
62 // Construct with certificates. | 62 // Construct with certificates. |
63 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], certificates:null},
null);"); | 63 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], certificates:null},
null);"); |
64 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[]}, nu
ll);"); | 64 shouldNotThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[]}, nu
ll);"); |
65 shouldThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[null]}, n
ull);"); | 65 shouldThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[null]}, n
ull);"); |
66 shouldThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[1337]}, n
ull);"); | 66 shouldThrow("new webkitRTCPeerConnection({iceServers:[], certificates:[1337]}, n
ull);"); |
67 // Global certificate variables so that the "should..." methods can evaluate the
m. | 67 // Global certificate variables so that the "should..." methods can evaluate the
m. |
68 var certRSA = null; | 68 var certRSA = null; |
69 var certECDSA = null; | 69 var certECDSA = null; |
| 70 |
70 function testCertificates1RSA() | 71 function testCertificates1RSA() |
71 { | 72 { |
72 webkitRTCPeerConnection.generateCertificate({ name: "RSASSA-PKCS1-v1_5", mod
ulusLength: 2048, publicExponent: 65537 }) | 73 webkitRTCPeerConnection.generateCertificate({ name: "RSASSA-PKCS1-v1_5", mod
ulusLength: 2048, publicExponent: new Uint8Array([1, 0, 1]), hash: "SHA-256" }) |
73 .then(function(certificate) { | 74 .then(function(certificate) { |
74 certRSA = certificate; | 75 certRSA = certificate; |
75 shouldNotThrow('new webkitRTCPeerConnection({iceServers:[], ce
rtificates:[certRSA]}, null);'); | 76 shouldNotThrow('new webkitRTCPeerConnection({iceServers:[], ce
rtificates:[certRSA]}, null);'); |
76 testCertificates2ECDSA(); | 77 testCertificates2ECDSA(); |
77 }, | 78 }, |
78 function() { | 79 function() { |
79 testFailed('Generating RSA 2048'); | 80 testFailed('Generating RSA 2048'); |
80 testCertificates2ECDSA(); | 81 testCertificates2ECDSA(); |
81 }); | 82 }); |
82 } | 83 } |
(...skipping 12 matching lines...) Expand all Loading... |
95 } | 96 } |
96 // Sequentially test construction with RSA and ECDSA certificates. | 97 // Sequentially test construction with RSA and ECDSA certificates. |
97 // testCertificates2ECDSA's callback methods mark the end of the async tests. | 98 // testCertificates2ECDSA's callback methods mark the end of the async tests. |
98 testCertificates1RSA(); | 99 testCertificates1RSA(); |
99 | 100 |
100 window.jsTestIsAsync = true; | 101 window.jsTestIsAsync = true; |
101 window.successfullyParsed = true; | 102 window.successfullyParsed = true; |
102 </script> | 103 </script> |
103 </body> | 104 </body> |
104 </html> | 105 </html> |
OLD | NEW |