Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <canvas id="cnv" width=140 height=140></canvas> | |
| 3 | |
| 4 <script> | |
| 5 // This layout test checks if the 2D canvas is properly displayed | |
| 6 // when the color space is set to linear-rgb. | |
| 7 | |
| 8 var g_swapsBeforeAck = 15; | |
|
Justin Novosad
2016/10/24 21:22:27
What is the justification for this number? Seems l
xidachen
2016/10/25 00:58:35
+kbr@ for this. When I added the "pixel_offscreenC
Ken Russell (switch to Gerrit)
2016/10/25 01:03:29
I recall it was added a while ago in order to addr
| |
| 9 | |
| 10 function main() | |
| 11 { | |
| 12 draw(); | |
| 13 waitForFinish(); | |
| 14 } | |
| 15 | |
| 16 function draw() | |
| 17 { | |
| 18 var ctx = document.getElementById("cnv").getContext("2d", {colorSpace:'linear- rgb'}); | |
| 19 ctx.fillStyle = 'red'; | |
| 20 ctx.fillRect(20,20,50,50); | |
| 21 ctx.fillStyle = 'green'; | |
| 22 ctx.fillRect(70,20,50,50); | |
| 23 ctx.fillStyle = 'blue'; | |
| 24 ctx.fillRect(20,70,50,50); | |
| 25 ctx.fillStyle = 'black'; | |
| 26 ctx.fillRect(70,70,50,50); | |
| 27 } | |
| 28 | |
| 29 function waitForFinish() | |
| 30 { | |
| 31 if (g_swapsBeforeAck == 0) { | |
| 32 domAutomationController.setAutomationId(1); | |
| 33 domAutomationController.send("SUCCESS"); | |
| 34 } else { | |
| 35 g_swapsBeforeAck--; | |
| 36 document.getElementById('container').style.zIndex = g_swapsBeforeAck + 1; | |
| 37 window.webkitRequestAnimationFrame(waitForFinish); | |
| 38 } | |
| 39 } | |
| 40 | |
| 41 main(); | |
| 42 </script> | |
| 43 | |
| 44 | |
| OLD | NEW |