Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/workers/worker-shared-asm-buffer.html

Issue 2624863003: [wasm][asm.js] Fix bad asm.js in layout tests. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script> 4 <script>
5 function log(message) 5 function log(message)
6 { 6 {
7 document.getElementById('console').appendChild(document.createTextNode(messa ge + "\n")); 7 document.getElementById('console').appendChild(document.createTextNode(messa ge + "\n"));
8 } 8 }
9 9
10 function runTest() 10 function runTest()
11 { 11 {
12 log("Test calling asm functions across workers with the same heap."); 12 log("Test calling asm functions across workers with the same heap.");
13 var string = [ 13 var string = [
14 "worker = this;", 14 "worker = this;",
15 "onmessage = function(e) {", 15 "onmessage = function(e) {",
16 " function Module(stdlib, foreign, heap) {", 16 " function Module(stdlib, foreign, heap) {",
17 " 'use asm';", 17 " 'use asm';",
18 " var MEM32 = new stdlib.Int32Array(heap);", 18 " var MEM32 = new stdlib.Int32Array(heap);",
19 " function load() { var res = MEM32[255]; MEM32[255] = 123457; re turn res; }", 19 " function load() { var res = 0; res = MEM32[255]|0; MEM32[255] = 123457; return res|0; }",
20 " return { load: load };", 20 " return { load: load };",
21 " }", 21 " }",
22 " var buffer = e.data;", 22 " var buffer = e.data;",
23 " var result = Module(worker, {}, buffer).load();", 23 " var result = Module(worker, {}, buffer).load();",
24 " var message = result == 123456 ? 'SUCCESS' : 'FAILURE ' + result;", 24 " var message = result == 123456 ? 'SUCCESS' : 'FAILURE ' + result;",
25 " postMessage(message);", 25 " postMessage(message);",
26 "};" 26 "};"
27 ].join('\n'); 27 ].join('\n');
28 var blobURL = URL.createObjectURL(new Blob([string])); 28 var blobURL = URL.createObjectURL(new Blob([string]));
29 var worker = new Worker(blobURL); 29 var worker = new Worker(blobURL);
(...skipping 25 matching lines...) Expand all
55 testRunner.setAllowFileAccessFromFileURLs(true); 55 testRunner.setAllowFileAccessFromFileURLs(true);
56 testRunner.dumpAsText(); 56 testRunner.dumpAsText();
57 testRunner.waitUntilDone(); 57 testRunner.waitUntilDone();
58 } 58 }
59 </script> 59 </script>
60 </head> 60 </head>
61 <body onload="runTest()"> 61 <body onload="runTest()">
62 <pre id='console'></pre> 62 <pre id='console'></pre>
63 </body> 63 </body>
64 </html> 64 </html>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698