OLD | NEW |
1 <!DOCTYPE> | 1 <!DOCTYPE> |
2 <canvas id="canvas2D" width="50" height="50" background-color="red"></canvas> | 2 <canvas id="canvas2D" width="50" height="50" background-color="red"></canvas> |
3 <script> | 3 <script> |
| 4 // Note: If someone see this test flaky in the future, please mark the test as |
| 5 // flaky; the code itself is not the cause of such flakiness. |
| 6 // TODO(xlai): Guarantee all OffscreenCanvas commit tests non-flaky under all ca
ses. |
| 7 // See crbug.com/645173. |
| 8 |
4 // Currently, we push a Green color frame from OffscreenCanvas; so we test | 9 // Currently, we push a Green color frame from OffscreenCanvas; so we test |
5 // whether the associated canvas has green pixel. In the future, when we | 10 // whether the associated canvas has green pixel. In the future, when we |
6 // change solidColorFrame to textureFrame, the expected png needs to changed too
. | 11 // change solidColorFrame to textureFrame, the expected png needs to changed too
. |
7 var canvas2D = document.getElementById("canvas2D"); | 12 var canvas2D = document.getElementById("canvas2D"); |
8 var offscreenCanvas = canvas2D.transferControlToOffscreen(); | 13 var offscreenCanvas = canvas2D.transferControlToOffscreen(); |
9 var offscreen2d = offscreenCanvas.getContext("2d"); | 14 var offscreen2d = offscreenCanvas.getContext("2d"); |
10 offscreen2d.commit(); | 15 offscreen2d.commit(); |
11 </script> | 16 </script> |
OLD | NEW |