Chromium Code Reviews| Index: LayoutTests/fast/canvas/webgl/draw-webgl-to-canvas-2d.html |
| diff --git a/LayoutTests/fast/canvas/webgl/draw-webgl-to-canvas-2d.html b/LayoutTests/fast/canvas/webgl/draw-webgl-to-canvas-2d.html |
| index 4fbcd2287a372bb330706410a5ed2bf2a1418ad8..2761079e51adeecb3cfafec350248259082a5517 100644 |
| --- a/LayoutTests/fast/canvas/webgl/draw-webgl-to-canvas-2d.html |
| +++ b/LayoutTests/fast/canvas/webgl/draw-webgl-to-canvas-2d.html |
| @@ -86,6 +86,14 @@ function drawWebGLToCanvas2D(ctx2D, canvas3D, isDrawingBufferUndefined) { |
| testRunner.notifyDone(); |
| } |
| +function asyncTest() { |
| + debug("Check for drawing webgl to canvas 2d several frames after drawing webgl contents.") |
| + debug("1) when drawingBuffer is preserved.") |
| + drawWebGLToCanvas2D(preserve_ctx2D, preserve_canvas3D, false); |
| + debug("2) when drawingBuffer is not preserved. It leads to undefined behavior.") |
| + drawWebGLToCanvas2D(nonpreserve_ctx2D, nonpreserve_canvas3D, true); |
| +} |
| + |
| window.onload = function () { |
| // create both canvas 2d and webgl contexts. |
| createContexts(); |
| @@ -99,13 +107,12 @@ window.onload = function () { |
| debug("2) when drawingBuffer is not preserved.") |
| drawWebGLToCanvas2D(nonpreserve_ctx2D, nonpreserve_canvas3D, false); |
| - setTimeout(function () { |
| - debug("Check for drawing webgl to canvas 2d several frames after drawing webgl contents.") |
| - debug("1) when drawingBuffer is preserved.") |
| - drawWebGLToCanvas2D(preserve_ctx2D, preserve_canvas3D, false); |
| - debug("2) when drawingBuffer is not preserved. It leads to undefined behavior.") |
| - drawWebGLToCanvas2D(nonpreserve_ctx2D, nonpreserve_canvas3D, true); |
| - }, 50); |
| + if (window.testRunner) { |
| + testRunner.waitUntilDone(); |
| + testRunner.displayAsyncThen(asyncTest); |
| + } else { |
| + setTimeout(asyncTest, 100); |
|
Ken Russell (switch to Gerrit)
2014/10/16 03:05:03
Can this code path use requestAnimationFrame inste
|
| + } |
| } |
| </script> |