| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 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 <script src="resources/common.js"></script> | 5 <script src="subtle/resources/common.js"></script> |
| 6 </head> | 6 </head> |
| 7 <body> | 7 <body> |
| 8 <p id="description"></p> | 8 <p id="description"></p> |
| 9 <div id="console"></div> | 9 <div id="console"></div> |
| 10 | 10 |
| 11 <script> | 11 <script> |
| 12 description("Tests concurrent calls to many crypto operations happening on w
orkers as well as main thread."); | 12 description("Tests concurrent calls to many crypto operations happening on w
orkers as well as main thread."); |
| 13 | 13 |
| 14 // This test runs web crypto operations on 11 "threads". | 14 // This test runs web crypto operations on 11 "threads". |
| 15 // * The main thread (this page) | 15 // * The main thread (this page) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 42 { | 42 { |
| 43 debug("Thread failed: " + event.data); | 43 debug("Thread failed: " + event.data); |
| 44 reject(); | 44 reject(); |
| 45 }; | 45 }; |
| 46 } | 46 } |
| 47 }); | 47 }); |
| 48 } | 48 } |
| 49 | 49 |
| 50 function createPromiseForWorker() | 50 function createPromiseForWorker() |
| 51 { | 51 { |
| 52 var worker = new Worker("resources/subtle-crypto-concurrent.js"); | 52 var worker = new Worker("subtle/resources/subtle-crypto-concurrent.js"); |
| 53 return createPromiseForThread(worker, true); | 53 return createPromiseForThread(worker, true); |
| 54 } | 54 } |
| 55 | 55 |
| 56 function createPromiseForMainThread() | 56 function createPromiseForMainThread() |
| 57 { | 57 { |
| 58 return createPromiseForThread(self, false); | 58 return createPromiseForThread(self, false); |
| 59 } | 59 } |
| 60 | 60 |
| 61 var allPromises = []; | 61 var allPromises = []; |
| 62 for (var i = 0; i < 10; ++i) | 62 for (var i = 0; i < 10; ++i) |
| 63 allPromises.push(createPromiseForWorker()); | 63 allPromises.push(createPromiseForWorker()); |
| 64 | 64 |
| 65 // The worker script is included at the end of this page too, so it | 65 // The worker script is included at the end of this page too, so it |
| 66 // performs the same work as the workers. | 66 // performs the same work as the workers. |
| 67 allPromises.push(createPromiseForMainThread(self)); | 67 allPromises.push(createPromiseForMainThread(self)); |
| 68 | 68 |
| 69 Promise.all(allPromises).then(finishJSTest, failAndFinishJSTest); | 69 Promise.all(allPromises).then(finishJSTest, failAndFinishJSTest); |
| 70 </script> | 70 </script> |
| 71 <script src="resources/subtle-crypto-concurrent.js"></script> | 71 <script src="subtle/resources/subtle-crypto-concurrent.js"></script> |
| 72 </body> | 72 </body> |
| 73 </html> | 73 </html> |
| OLD | NEW |