Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: LayoutTests/fast/canvas/webgl/draw-webgl-to-canvas-2d.html

Issue 655133003: Fix a broken WebGL layout test by using testRunner.displayAsyncThen(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fit indentation to existing code Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/webgl/draw-webgl-to-canvas-2d-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/webgl/draw-webgl-to-canvas-2d-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698