Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Test asynchronous setServerCertificate while running garbage coll ection</title> | 4 <title>Test asynchronous setServerCertificate while running garbage coll ection</title> |
| 5 <script src="encrypted-media-utils.js"></script> | 5 <script src="encrypted-media-utils.js"></script> |
| 6 <script src="../../resources/testharness.js"></script> | 6 <script src="../../resources/testharness.js"></script> |
| 7 <script src="../../resources/testharnessreport.js"></script> | 7 <script src="../../resources/testharnessreport.js"></script> |
| 8 </head> | 8 </head> |
| 9 <body> | 9 <body> |
| 10 <div id="log"></div> | 10 <div id="log"></div> |
| 11 <script> | 11 <script> |
| 12 // Run garbage collection continuously. | 12 // Run garbage collection continuously. |
| 13 setInterval(asyncGC, 0); | 13 setInterval(asyncGC, 0); |
| 14 | 14 |
| 15 promise_test(function(test) | 15 promise_test(function(test) |
| 16 { | 16 { |
| 17 return navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).then(function(access) { | 17 return navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).then(function(access) { |
| 18 return access.createMediaKeys(); | 18 return access.createMediaKeys(); |
| 19 }).then(function(mediaKeys) { | 19 }).then(function(mediaKeys) { |
| 20 var cert = new Uint8Array(200); | 20 var cert = new Uint8Array(200); |
| 21 return mediaKeys.setServerCertificate(cert); | 21 return mediaKeys.setServerCertificate(cert); |
| 22 }).then(function() { | 22 }).then(function(result) { |
| 23 assert_unreached('setServerCertificate() did not fail'); | 23 assert_false(result); |
| 24 }, function(e) { | |
| 25 assert_equals(e.name, 'NotSupportedError'); | |
| 26 return Promise.resolve(); | |
| 27 }); | 24 }); |
|
ddorwin
2016/06/13 17:28:09
Do we need something like this here to catch an in
jrummell
2016/06/13 18:54:13
This is a promise_test(), so it fails if the promi
| |
| 28 }, 'Test asynchronous setServerCertificate while running garbage col lection.'); | 25 }, 'Test asynchronous setServerCertificate while running garbage col lection.'); |
| 29 </script> | 26 </script> |
| 30 </body> | 27 </body> |
| 31 </html> | 28 </html> |
| OLD | NEW |