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 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <p id="description"></p> | 7 <p id="description"></p> |
8 <div id="console"></div> | 8 <div id="console"></div> |
9 | 9 |
10 <script> | 10 <script> |
(...skipping 22 matching lines...) Expand all Loading... |
33 else | 33 else |
34 debug("Received random bytes from worker"); | 34 debug("Received random bytes from worker"); |
35 | 35 |
36 randomValues[bytesStr] = true; | 36 randomValues[bytesStr] = true; |
37 | 37 |
38 if (++numRandomValues == NUM_WORKERS) | 38 if (++numRandomValues == NUM_WORKERS) |
39 finishJSTest(); | 39 finishJSTest(); |
40 } | 40 } |
41 | 41 |
42 for (var i = 0; i < NUM_WORKERS; ++i) { | 42 for (var i = 0; i < NUM_WORKERS; ++i) { |
43 var worker = new Worker('resources/random-values-concurrent.js'); | 43 var worker = new Worker('random-values-concurrent.js'); |
44 worker.onmessage = function(event) | 44 worker.onmessage = function(event) |
45 { | 45 { |
46 if (event.data instanceof Uint8Array) | 46 if (event.data instanceof Uint8Array) |
47 workerGeneratedRandomBytes(event.data); | 47 workerGeneratedRandomBytes(event.data); |
48 else | 48 else |
49 debug('[Worker] ' + event.data); | 49 debug('[Worker] ' + event.data); |
50 } | 50 } |
51 worker.onerror = function(event) | 51 worker.onerror = function(event) |
52 { | 52 { |
53 debug('Got error from worker: ' + event.message); | 53 debug('Got error from worker: ' + event.message); |
54 finishJSTest(); | 54 finishJSTest(); |
55 } | 55 } |
56 } | 56 } |
57 </script> | 57 </script> |
58 | 58 |
59 </body> | 59 </body> |
60 </html> | 60 </html> |
OLD | NEW |