Index: chrome/test/data/gpu/pixel_canvas2d.html |
diff --git a/chrome/test/data/gpu/pixel_canvas2d.html b/chrome/test/data/gpu/pixel_canvas2d.html |
index f59c1d61f04c232c3c79b73fa18884ed19271ec8..fc4505eef7a098b5108bc95fd2e53072adc598cd 100644 |
--- a/chrome/test/data/gpu/pixel_canvas2d.html |
+++ b/chrome/test/data/gpu/pixel_canvas2d.html |
@@ -8,18 +8,22 @@ |
} |
</style> |
<script> |
-var g_swapsBeforeAck = 6; |
-var g_paintLoopStarted = false; |
+var g_swapsBeforeAck = 15; |
+var g_targetHeight, g_targetWidth; |
-function main() |
+function onresized() |
{ |
- g_swapsBeforeAck = 6; |
+ if (window.outerHeight != g_targetHeight || |
+ window.outerWidth != g_targetWidth) |
+ return; |
- if (!g_paintLoopStarted) { |
- g_paintLoopStarted = true; |
- draw(); |
- waitForFinish(); |
- } |
+ main(); |
+} |
+ |
+function main() |
+{ |
+ draw(); |
+ waitForFinish(); |
} |
function draw() |
@@ -49,9 +53,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); |