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

Unified Diff: chrome/test/data/gpu/pixel_canvas2d.html

Issue 9706039: Fixes the timeout issue with the pixel tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | chrome/test/data/gpu/pixel_css3d.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | chrome/test/data/gpu/pixel_css3d.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698