From b86f3c4b80ed4fdba99f9c8f3638bdacfb700af9 Mon Sep 17 00:00:00 2001 From: "dbaron%dbaron.org" Date: Tue, 13 Feb 2007 00:54:02 +0000 Subject: [PATCH] Put back the load timeout code that I backed out yesterday, since it now works. b=369319 --- layout/tools/reftest/reftest.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/layout/tools/reftest/reftest.js b/layout/tools/reftest/reftest.js index c0add622e48f..26145c65a94a 100644 --- a/layout/tools/reftest/reftest.js +++ b/layout/tools/reftest/reftest.js @@ -53,6 +53,7 @@ var gCanvas; var gURLs; var gState; var gPart1Key; +var gFailureTimeout; const EXPECTED_PASS = 0; const EXPECTED_FAIL = 1; @@ -174,6 +175,8 @@ function StartCurrentTest() function StartCurrentURI(aState) { + gFailureTimeout = setTimeout(LoadFailed, LOAD_FAILURE_TIMEOUT); + gState = aState; gBrowser.loadURI(gURLs[0]["url" + aState].spec); } @@ -200,6 +203,7 @@ function OnDocumentLoad(event) // Ignore load events for subframes. return; + clearTimeout(gFailureTimeout); // Since we can't use a bubbling-phase load listener from chrome, // this is a capturing phase listener. So do setTimeout twice, the // first to get us after the onload has fired in the content, and @@ -255,3 +259,11 @@ function DocumentLoaded() throw "Unexpected state." } } + +function LoadFailed() +{ + dump("REFTEST UNEXPECTED FAIL (LOADING): " + + gURLs[0]["url" + gState].spec + "\n"); + gURLs.shift(); + StartCurrentTest(); +}