Index: chrome/test/data/gpu/pixel_webgl.html |
diff --git a/chrome/test/data/gpu/pixel_webgl.html b/chrome/test/data/gpu/pixel_webgl.html |
index 093c1105a4bd35d28250a00873778abe4802ef62..966b087b5500d6e9702cae98378c808758b07346 100644 |
--- a/chrome/test/data/gpu/pixel_webgl.html |
+++ b/chrome/test/data/gpu/pixel_webgl.html |
@@ -26,20 +26,29 @@ void main(void) |
<script> |
var g_swapsBeforeAck = 15; |
-var g_paintLoopStarted = false; |
+var g_targetWidth, g_targetHeight; |
var gl; |
+function onresized() |
+{ |
+ if (window.outerWidth != g_targetWidth || |
+ window.outerHeight != g_targetHeight) |
+ return; |
+ |
+ main(); |
+} |
+ |
function main() |
{ |
- g_swapsBeforeAck = 15; |
- |
- if (!g_paintLoopStarted) { |
- g_paintLoopStarted = true; |
- var canvas = document.getElementById("c"); |
- gl = initGL(canvas); |
- if (gl && setup(gl)) |
- drawSomeFrames(); |
+ var canvas = document.getElementById("c"); |
+ gl = initGL(canvas); |
+ if (gl && setup(gl)) { |
+ drawSomeFrames(); |
+ } else { |
+ domAutomationController.setAutomationId(1); |
+ domAutomationController.send("resized"); |
} |
+ |
} |
function notifyLoadFinished() |
@@ -48,9 +57,11 @@ function notifyLoadFinished() |
domAutomationController.send("ok"); |
} |
-function preCallResizeInChromium() |
+function preCallResizeInChromium(targetWidth, targetHeight) |
{ |
- window.onresize = main; |
+ g_targetWidth = targetWidth; |
+ g_targetHeight = targetHeight; |
+ window.onresize = onresized; |
// Call main() on a timeout in case the window did not resize for whatever |
// reason. |
setTimeout(main, 10000); |