Commit 1fffc5b9 authored by pkotwicz@chromium.org's avatar pkotwicz@chromium.org

Fixes the timeout issue with the pixel tests

Test=Manual
Bug=None
TBR=zmo

Review URL: https://chromiumcodereview.appspot.com/9706039

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126897 0039d316-1c4b-4281-b951-d872f2087c98
parent 27d61f3a
...@@ -8,15 +8,20 @@ ...@@ -8,15 +8,20 @@
} }
</style> </style>
<script> <script>
var g_swapsBeforeAck = 6; var g_swapsBeforeAck = 15;
var g_targetHeight, g_targetWidth; var g_targetHeight, g_targetWidth;
function main() function onresized()
{ {
if (window.outerHeight != g_targetHeight || if (window.outerHeight != g_targetHeight ||
window.outerWidth != g_targetWidth) window.outerWidth != g_targetWidth)
return; return;
main();
}
function main()
{
draw(); draw();
waitForFinish(); waitForFinish();
} }
...@@ -52,7 +57,7 @@ function preCallResizeInChromium(targetWidth, targetHeight) ...@@ -52,7 +57,7 @@ function preCallResizeInChromium(targetWidth, targetHeight)
{ {
g_targetWidth = targetWidth; g_targetWidth = targetWidth;
g_targetHeight = targetHeight; g_targetHeight = targetHeight;
window.onresize = main; window.onresize = onresized;
// Call main() on a timeout in case the window did not resize for whatever // Call main() on a timeout in case the window did not resize for whatever
// reason. // reason.
setTimeout(main, 10000); setTimeout(main, 10000);
......
...@@ -27,12 +27,18 @@ ...@@ -27,12 +27,18 @@
var g_swapsBeforeAck = 15; var g_swapsBeforeAck = 15;
var g_targetWidth, g_targetHeight; var g_targetWidth, g_targetHeight;
function main() function onresized()
{ {
if (g_targetWidth != window.outerWidth || if (g_targetWidth != window.outerWidth ||
g_targetHeight != window.outerHeight) g_targetHeight != window.outerHeight)
return; return;
main();
}
function main()
{
waitForFinish(); waitForFinish();
} }
...@@ -58,7 +64,7 @@ function preCallResizeInChromium(targetWidth, targetHeight) ...@@ -58,7 +64,7 @@ function preCallResizeInChromium(targetWidth, targetHeight)
{ {
g_targetWidth = targetWidth; g_targetWidth = targetWidth;
g_targetHeight = targetHeight; g_targetHeight = targetHeight;
window.onresize = main; window.onresize = onresized;
// Call main() on a timeout in case the window did not resize for whatever // Call main() on a timeout in case the window did not resize for whatever
// reason. // reason.
......
...@@ -29,16 +29,25 @@ var g_swapsBeforeAck = 15; ...@@ -29,16 +29,25 @@ var g_swapsBeforeAck = 15;
var g_targetWidth, g_targetHeight; var g_targetWidth, g_targetHeight;
var gl; var gl;
function main() function onresized()
{ {
if (window.outerWidth != g_targetWidth || if (window.outerWidth != g_targetWidth ||
window.outerHeight != g_targetHeight) window.outerHeight != g_targetHeight)
return; return;
main();
}
function main()
{
var canvas = document.getElementById("c"); var canvas = document.getElementById("c");
gl = initGL(canvas); gl = initGL(canvas);
if (gl && setup(gl)) if (gl && setup(gl)) {
drawSomeFrames(); drawSomeFrames();
} else {
domAutomationController.setAutomationId(1);
domAutomationController.send("resized");
}
} }
function notifyLoadFinished() function notifyLoadFinished()
...@@ -51,7 +60,7 @@ function preCallResizeInChromium(targetWidth, targetHeight) ...@@ -51,7 +60,7 @@ function preCallResizeInChromium(targetWidth, targetHeight)
{ {
g_targetWidth = targetWidth; g_targetWidth = targetWidth;
g_targetHeight = targetHeight; g_targetHeight = targetHeight;
window.onresize = main; window.onresize = onresized;
// Call main() on a timeout in case the window did not resize for whatever // Call main() on a timeout in case the window did not resize for whatever
// reason. // reason.
setTimeout(main, 10000); setTimeout(main, 10000);
......
...@@ -156,12 +156,12 @@ class GpuPixelBrowserTest : public InProcessBrowserTest { ...@@ -156,12 +156,12 @@ class GpuPixelBrowserTest : public InProcessBrowserTest {
browser()->GetSelectedWebContents()->GetRenderViewHost(), browser()->GetSelectedWebContents()->GetRenderViewHost(),
L"", js_call.str())); L"", js_call.str()));
ASSERT_TRUE(message_queue.WaitForMessage(NULL)); std::string message;
ASSERT_TRUE(message_queue.WaitForMessage(&message));
message_queue.ClearQueue(); message_queue.ClearQueue();
browser()->window()->SetBounds(new_bounds); browser()->window()->SetBounds(new_bounds);
// Wait for message from test page indicating the rendering is done. // Wait for message from test page indicating the rendering is done.
std::string message;
while (message.compare("\"resized\"")) { while (message.compare("\"resized\"")) {
ASSERT_TRUE(message_queue.WaitForMessage(&message)); ASSERT_TRUE(message_queue.WaitForMessage(&message));
message_queue.ClearQueue(); message_queue.ClearQueue();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment