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