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 RTCPeerConnection.generateCertificate RSA/ECDSA."); | 8 description("Tests RTCPeerConnection.generateCertificate RSA/ECDSA."); |
9 | 9 |
10 // Signature of the last generateCertificate call. | 10 // Signature of the last generateCertificate call. |
11 var generateCallString = null; | 11 var generateCallString = null; |
12 // Global certificate variables so that the "should..." methods can evaluate the
m. | 12 // Global certificate variables so that the "should..." methods can evaluate the
m. |
13 var certRSA = null; | 13 var certRSA = null; |
14 var certECDSA = null; | 14 var certECDSA = null; |
15 | 15 |
16 // 1: RSA-2048 using public exponent = 65537. | 16 // 1: RSA-2048 using public exponent = 65537. |
17 function generate1RSA() | 17 function generate1RSA() |
18 { | 18 { |
19 generateCallString = 'generateCertificate({ name: "RSASSA-PKCS1-v1_5", mod
ulusLength: 2048, publicExponent: 65537 })'; | 19 generateCallString = 'generateCertificate({ name: "RSASSA-PKCS1-v1_5", mod
ulusLength: 2048, publicExponent: new Uint8Array([1, 0, 1]), hash: "SHA-256" })'
; |
20 webkitRTCPeerConnection.generateCertificate({ name: "RSASSA-PKCS1-v1_5", mod
ulusLength: 2048, publicExponent: 65537 }) | 20 webkitRTCPeerConnection.generateCertificate({ name: "RSASSA-PKCS1-v1_5", mod
ulusLength: 2048, publicExponent: new Uint8Array([1, 0, 1]), hash: "SHA-256" }) |
21 .then(generate1RSASuccessful, generate1RSAFailed); | 21 .then(generate1RSASuccessful, generate1RSAFailed); |
22 } | 22 } |
23 function generate1RSASuccessful(certificate) | 23 function generate1RSASuccessful(certificate) |
24 { | 24 { |
25 certRSA = certificate; | 25 certRSA = certificate; |
26 testPassed(generateCallString); | 26 testPassed(generateCallString); |
27 certificateSanityCheck(certificate, 'certRSA'); | 27 certificateSanityCheck(certificate, 'certRSA'); |
28 generate2ECDSA(); | 28 generate2ECDSA(); |
29 } | 29 } |
30 function generate1RSAFailed() | 30 function generate1RSAFailed() |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // Run each generate test sequentially. The ith generate method will make sure | 63 // Run each generate test sequentially. The ith generate method will make sure |
64 // the (i+1)st generate method is executed when its promise's callbacks are | 64 // the (i+1)st generate method is executed when its promise's callbacks are |
65 // invoked. generate2ECDSA's callback methods mark the end of the async tests. | 65 // invoked. generate2ECDSA's callback methods mark the end of the async tests. |
66 generate1RSA(); | 66 generate1RSA(); |
67 | 67 |
68 window.jsTestIsAsync = true; | 68 window.jsTestIsAsync = true; |
69 window.successfullyParsed = true; | 69 window.successfullyParsed = true; |
70 </script> | 70 </script> |
71 </body> | 71 </body> |
72 </html> | 72 </html> |
OLD | NEW |