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 @@
}
</style>
<script>
var g_swapsBeforeAck = 6;
var g_swapsBeforeAck = 15;
var g_targetHeight, g_targetWidth;
function main()
function onresized()
{
if (window.outerHeight != g_targetHeight ||
window.outerWidth != g_targetWidth)
return;
main();
}
function main()
{
draw();
waitForFinish();
}
......@@ -52,7 +57,7 @@ function preCallResizeInChromium(targetWidth, targetHeight)
{
g_targetWidth = targetWidth;
g_targetHeight = targetHeight;
window.onresize = main;
window.onresize = onresized;
// Call main() on a timeout in case the window did not resize for whatever
// reason.
setTimeout(main, 10000);
......
......@@ -27,12 +27,18 @@
var g_swapsBeforeAck = 15;
var g_targetWidth, g_targetHeight;
function main()
function onresized()
{
if (g_targetWidth != window.outerWidth ||
g_targetHeight != window.outerHeight)
return;
main();
}
function main()
{
waitForFinish();
}
......@@ -58,7 +64,7 @@ function preCallResizeInChromium(targetWidth, targetHeight)
{
g_targetWidth = targetWidth;
g_targetHeight = targetHeight;
window.onresize = main;
window.onresize = onresized;
// Call main() on a timeout in case the window did not resize for whatever
// reason.
......
......@@ -29,16 +29,25 @@ var g_swapsBeforeAck = 15;
var g_targetWidth, g_targetHeight;
var gl;
function main()
function onresized()
{
if (window.outerWidth != g_targetWidth ||
window.outerHeight != g_targetHeight)
return;
return;
main();
}
function main()
{
var canvas = document.getElementById("c");
gl = initGL(canvas);
if (gl && setup(gl))
if (gl && setup(gl)) {
drawSomeFrames();
} else {
domAutomationController.setAutomationId(1);
domAutomationController.send("resized");
}
}
function notifyLoadFinished()
......@@ -51,7 +60,7 @@ function preCallResizeInChromium(targetWidth, targetHeight)
{
g_targetWidth = targetWidth;
g_targetHeight = targetHeight;
window.onresize = main;
window.onresize = onresized;
// Call main() on a timeout in case the window did not resize for whatever
// reason.
setTimeout(main, 10000);
......
......@@ -156,12 +156,12 @@ class GpuPixelBrowserTest : public InProcessBrowserTest {
browser()->GetSelectedWebContents()->GetRenderViewHost(),
L"", js_call.str()));
ASSERT_TRUE(message_queue.WaitForMessage(NULL));
std::string message;
ASSERT_TRUE(message_queue.WaitForMessage(&message));
message_queue.ClearQueue();
browser()->window()->SetBounds(new_bounds);
// Wait for message from test page indicating the rendering is done.
std::string message;
while (message.compare("\"resized\"")) {
ASSERT_TRUE(message_queue.WaitForMessage(&message));
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