OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script> | 4 <script> |
5 // This browser pixel test checks if the 2D canvas with no color space tag | 5 // This browser pixel test checks if the 2D canvas with no color space tag |
6 // displays the pixels correctly. | 6 // displays the pixels correctly. |
7 | 7 |
8 var g_swapsBeforeAck = 15; | 8 var g_swapsBeforeAck = 15; |
9 | 9 |
10 function main() | 10 function main() |
(...skipping 12 matching lines...) Expand all Loading... |
23 image.data[(4 * i) + 1] = 127; | 23 image.data[(4 * i) + 1] = 127; |
24 image.data[(4 * i) + 2] = 127; | 24 image.data[(4 * i) + 2] = 127; |
25 image.data[(4 * i) + 3] = 255; | 25 image.data[(4 * i) + 3] = 255; |
26 } | 26 } |
27 ctx.putImageData(image, 0, 0); | 27 ctx.putImageData(image, 0, 0); |
28 } | 28 } |
29 | 29 |
30 function waitForFinish() | 30 function waitForFinish() |
31 { | 31 { |
32 if (g_swapsBeforeAck == 0) { | 32 if (g_swapsBeforeAck == 0) { |
33 domAutomationController.setAutomationId(1); | |
34 domAutomationController.send("SUCCESS"); | 33 domAutomationController.send("SUCCESS"); |
35 } else { | 34 } else { |
36 g_swapsBeforeAck--; | 35 g_swapsBeforeAck--; |
37 document.getElementById('container').style.zIndex = g_swapsBeforeAck + 1; | 36 document.getElementById('container').style.zIndex = g_swapsBeforeAck + 1; |
38 window.requestAnimationFrame(waitForFinish); | 37 window.requestAnimationFrame(waitForFinish); |
39 } | 38 } |
40 } | 39 } |
41 </script> | 40 </script> |
42 </head> | 41 </head> |
43 <body onload="main()"> | 42 <body onload="main()"> |
44 <div id="container" style="position:absolute; top:0px; left:0px"> | 43 <div id="container" style="position:absolute; top:0px; left:0px"> |
45 <canvas id="c" width="257" height="257"></canvas> | 44 <canvas id="c" width="257" height="257"></canvas> |
46 </div> | 45 </div> |
47 </body> | 46 </body> |
48 </html> | 47 </html> |
OLD | NEW |