OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 | 2 |
3 <!-- READ BEFORE UPDATING: | 3 <!-- READ BEFORE UPDATING: |
4 If this test is updated make sure to increment the "revision" value of the | 4 If this test is updated make sure to increment the "revision" value of the |
5 associated test in content/test/gpu/gpu_tests/pixel_test_pages.py. This will ens
ure | 5 associated test in content/test/gpu/gpu_tests/pixel_test_pages.py. This will ens
ure |
6 that the baseline images are regenerated on the next run. | 6 that the baseline images are regenerated on the next run. |
7 --> | 7 --> |
8 | 8 |
9 <html> | 9 <html> |
10 <head> | 10 <head> |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 function makeWorker(script) | 79 function makeWorker(script) |
80 { | 80 { |
81 var blob = new Blob([script]); | 81 var blob = new Blob([script]); |
82 return new Worker(URL.createObjectURL(blob)); | 82 return new Worker(URL.createObjectURL(blob)); |
83 } | 83 } |
84 | 84 |
85 function waitForFinish() | 85 function waitForFinish() |
86 { | 86 { |
87 if (g_swapsBeforeAck == 0) { | 87 if (g_swapsBeforeAck == 0) { |
88 domAutomationController.setAutomationId(1); | |
89 domAutomationController.send("SUCCESS"); | 88 domAutomationController.send("SUCCESS"); |
90 } else { | 89 } else { |
91 g_swapsBeforeAck--; | 90 g_swapsBeforeAck--; |
92 document.getElementById('container').style.zIndex = g_swapsBeforeAck + 1; | 91 document.getElementById('container').style.zIndex = g_swapsBeforeAck + 1; |
93 window.requestAnimationFrame(waitForFinish); | 92 window.requestAnimationFrame(waitForFinish); |
94 } | 93 } |
95 } | 94 } |
96 | 95 |
97 function main() | 96 function main() |
98 { | 97 { |
99 var canvas2D = document.getElementById("c"); | 98 var canvas2D = document.getElementById("c"); |
100 var offscreenCanvas = canvas2D.transferControlToOffscreen(); | 99 var offscreenCanvas = canvas2D.transferControlToOffscreen(); |
101 var worker = makeWorker(document.getElementById("myWorker").textContent); | 100 var worker = makeWorker(document.getElementById("myWorker").textContent); |
102 worker.onmessage = function (e) { | 101 worker.onmessage = function (e) { |
103 waitForFinish(); | 102 waitForFinish(); |
104 }; | 103 }; |
105 worker.postMessage(offscreenCanvas, [offscreenCanvas]); | 104 worker.postMessage(offscreenCanvas, [offscreenCanvas]); |
106 } | 105 } |
107 </script> | 106 </script> |
108 </head> | 107 </head> |
109 <body onload="main()"> | 108 <body onload="main()"> |
110 <div style="position:relative; width:200px; height:200px; background-color:white
"> | 109 <div style="position:relative; width:200px; height:200px; background-color:white
"> |
111 </div> | 110 </div> |
112 <div id="container" style="position:absolute; top:0px; left:0px"> | 111 <div id="container" style="position:absolute; top:0px; left:0px"> |
113 <canvas id="c" width="200" height="200" class="nomargin"></canvas> | 112 <canvas id="c" width="200" height="200" class="nomargin"></canvas> |
114 </div> | 113 </div> |
115 </body> | 114 </body> |
116 </html> | 115 </html> |
OLD | NEW |