|
1 | 1 | <!doctype html>
|
2 | 2 | <meta charset="utf-8">
|
| 3 | +<meta name="timeout" content="long"> |
3 | 4 | <title>Test RTCPeerConnection.generateCertificate</title>
|
4 | 5 | <script src="/resources/testharness.js"></script>
|
5 | 6 | <script src="/resources/testharnessreport.js"></script>
|
|
33 | 34 | * publicExponent: new Uint8Array([1, 0, 1]), hash: "SHA-256" },
|
34 | 35 | * and { name: "ECDSA", namedCurve: "P-256" }.
|
35 | 36 | */
|
36 |
| - promise_test(t => |
37 |
| - RTCPeerConnection.generateCertificate({ |
38 |
| - name: 'RSASSA-PKCS1-v1_5', |
39 |
| - modulusLength: 2048, |
40 |
| - publicExponent: new Uint8Array([1, 0, 1]), |
41 |
| - hash: 'SHA-256' |
42 |
| - }).then(cert => { |
43 |
| - assert_true(cert instanceof RTCCertificate, |
44 |
| - 'Expect cert to be instance of RTCCertificate'); |
| 37 | + [1024, 2048].forEach(modulusLength => { |
| 38 | + promise_test(t => |
| 39 | + // Test common RSA key sizes. Only 2048 is mandatory to support. |
| 40 | + RTCPeerConnection.generateCertificate({ |
| 41 | + name: 'RSASSA-PKCS1-v1_5', |
| 42 | + modulusLength, |
| 43 | + publicExponent: new Uint8Array([1, 0, 1]), |
| 44 | + hash: 'SHA-256' |
| 45 | + }).then(cert => { |
| 46 | + assert_true(cert instanceof RTCCertificate, |
| 47 | + 'Expect cert to be instance of RTCCertificate'); |
45 | 48 |
|
46 |
| - assert_greater_than(cert.expires, Date.now(), |
47 |
| - 'Expect generated certificate to expire reasonably long after current time'); |
48 |
| - }), |
49 |
| - 'generateCertificate() with compulsary RSASSA-PKCS1-v1_5 parameters should succeed'); |
| 49 | + assert_greater_than(cert.expires, Date.now(), |
| 50 | + 'Expect generated certificate to expire reasonably long after current time'); |
| 51 | + }), |
| 52 | + `generateCertificate({modulusLength: ${modulusLength}}) with RSASSA-PKCS1-v1_5 parameters should succeed`); |
| 53 | + }); |
50 | 54 |
|
51 | 55 | promise_test(t =>
|
52 | 56 | RTCPeerConnection.generateCertificate({
|
|
0 commit comments