Make reftest check its invariants regarding the failure timeout, so we can see if any intermittent failures are due to such harness bugs. (Bug 477409) r=jruderman

This commit is contained in:
L. David Baron 2009-02-08 10:28:30 -08:00
parent 311d0419e4
commit 92cec0cb6d

View File

@ -89,7 +89,7 @@ var gTestResults = {
var gTotalTests = 0;
var gState;
var gCurrentURL;
var gFailureTimeout;
var gFailureTimeout = null;
var gFailureReason;
var gServer;
var gCount = 0;
@ -468,6 +468,11 @@ function StartCurrentTest()
function StartCurrentURI(aState)
{
gCurrentTestStartTime = Date.now();
if (gFailureTimeout != null) {
dump("REFTEST TEST-UNEXPECTED-FAIL | " +
"| program error managing timeouts\n");
++gTestResults.Exception;
}
gFailureTimeout = setTimeout(LoadFailed, LOAD_FAILURE_TIMEOUT);
gFailureReason = "timed out waiting for onload to fire";
@ -787,6 +792,7 @@ function DocumentLoaded()
clearTimeout(gFailureTimeout);
gFailureReason = null;
gFailureTimeout = null;
if (gURLs[0].expected == EXPECTED_LOAD) {
++gTestResults.LoadOnly;
@ -888,6 +894,7 @@ function DocumentLoaded()
function LoadFailed()
{
gFailureTimeout = null;
++gTestResults.FailedLoad;
dump("REFTEST TEST-UNEXPECTED-FAIL | " +
gURLs[0]["url" + gState].spec + " | " + gFailureReason + "\n");