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

Unified Diff: chrome/test/data/gpu/pixel_webgl.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 | « chrome/test/data/gpu/pixel_css3d.html ('k') | chrome/test/gpu/gpu_pixel_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « chrome/test/data/gpu/pixel_css3d.html ('k') | chrome/test/gpu/gpu_pixel_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698