OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../resources/js-test.js"></script> |
| 5 <script src="resources/common.js"></script> |
| 6 </head> |
| 7 <body> |
| 8 <p id="description"></p> |
| 9 <div id="console"></div> |
| 10 |
| 11 <script> |
| 12 description("Tests abandoning a crypto operation."); |
| 13 |
| 14 // This test starts up a couple worker threads, which continuously generate |
| 15 // RSA keys. It waits until each of the worker threads have started |
| 16 // running, and then exits. |
| 17 // |
| 18 // The consequence is that once the test finishes, there should be |
| 19 // outstanding crypto operations on the worker threads. This will exercise |
| 20 // the cancellation/abandonment logic for these Promises. |
| 21 |
| 22 jsTestIsAsync = true; |
| 23 |
| 24 var allPromises = []; |
| 25 |
| 26 var kNumWorkers = 3; |
| 27 |
| 28 for (var i = 0; i < kNumWorkers; ++i) { |
| 29 allPromises.push(new Promise(function(resolve, reject) { |
| 30 var worker = new Worker("resources/worker-infinite-loop-generateKey.
js"); |
| 31 worker.onmessage = function(event) |
| 32 { |
| 33 debug(event.data); |
| 34 resolve(); |
| 35 }; |
| 36 })); |
| 37 } |
| 38 |
| 39 Promise.all(allPromises).then(finishJSTest); |
| 40 </script> |
| 41 </body> |
| 42 </html> |
OLD | NEW |