Put back the load timeout code that I backed out yesterday, since it now works. b=369319

This commit is contained in:
dbaron%dbaron.org 2007-02-13 00:54:02 +00:00
parent cee499d3d2
commit b86f3c4b80

View File

@ -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();
}