Index: LayoutTests/fast/canvas/webgl/webgl-layer-update.html |
diff --git a/LayoutTests/fast/canvas/webgl/webgl-layer-update.html b/LayoutTests/fast/canvas/webgl/webgl-layer-update.html |
index a5bd2d7faa6e02b755503ef035e55b274c40d954..e73c98eec315712ebce9211d8c6c492fa91b3965 100644 |
--- a/LayoutTests/fast/canvas/webgl/webgl-layer-update.html |
+++ b/LayoutTests/fast/canvas/webgl/webgl-layer-update.html |
@@ -1,25 +1,14 @@ |
<!DOCTYPE html> |
<html> |
+<script src="../../../resources/run-after-display.js"></script> |
<script> |
- function doUpdate() |
- { |
- document.getElementsByTagName('canvas')[0].style.top = "60px"; |
- |
- if (window.testRunner) { |
- testRunner.display(); |
- testRunner.notifyDone(); |
- } |
- } |
- |
function init() |
{ |
- if (window.testRunner) |
- doUpdate(); |
- else { |
- // Delay canvas layer update if test runs without testRunner to |
- // allow first layer update to be processed on UI side. |
- window.setTimeout(doUpdate, 100); |
- } |
+ runAfterDisplay(function() { |
+ document.getElementsByTagName('canvas')[0].style.top = "60px"; |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
+ }); |
} |
</script> |
<body onload="init()"> |
@@ -45,7 +34,7 @@ if (window.testRunner) { |
testRunner.overridePreference("WebKitWebGLEnabled", "1"); |
testRunner.dumpAsTextWithPixelResults(); |
document.getElementById("description").style.position = "absolute"; |
- document.getElementById("description").style.top = "-5000px"; |
+ document.getElementById("description").style.top = "-5000px"; |
} |
var can = document.createElement('canvas'); |
@@ -57,9 +46,6 @@ document.body.appendChild(can); |
var ctx = can.getContext("experimental-webgl"); |
ctx.clearColor(1, 0, 0, 1); |
ctx.clear(ctx.COLOR_BUFFER_BIT); |
- |
-if (window.testRunner) |
- testRunner.display(); |
</script> |
</body> |
</html> |