diff --git a/layout/tools/reftest/reftest-content.js b/layout/tools/reftest/reftest-content.js index 7310f652e630..158795ae8075 100644 --- a/layout/tools/reftest/reftest-content.js +++ b/layout/tools/reftest/reftest-content.js @@ -124,7 +124,7 @@ function OnInitialLoad() LogInfo("Using browser remote="+ gBrowserIsRemote +"\n"); } -function SetFailureTimeout(cb, timeout) +function SetFailureTimeout(cb, timeout, uri) { var targetTime = Date.now() + timeout; @@ -139,6 +139,11 @@ function SetFailureTimeout(cb, timeout) } } + // Once OnDocumentLoad is called to handle the 'load' event it will update + // this error message to reflect what stage of the processing it has reached + // as it advances to each stage in turn. + gFailureReason = "timed out after " + timeout + + " ms waiting for 'load' event for " + uri; gFailureTimeout = setTimeout(wrapper, timeout); } @@ -164,7 +169,7 @@ function StartTestURI(type, uri, timeout) if (gFailureTimeout != null) { SendException("program error managing timeouts\n"); } - SetFailureTimeout(LoadFailed, timeout); + SetFailureTimeout(LoadFailed, timeout, uri); LoadURI(gCurrentURL); } diff --git a/layout/tools/reftest/reftest.jsm b/layout/tools/reftest/reftest.jsm index 57e5f2214f55..397ba25f25c2 100644 --- a/layout/tools/reftest/reftest.jsm +++ b/layout/tools/reftest/reftest.jsm @@ -1172,10 +1172,14 @@ function RecordResult(testRunTime, errorMsg, typeSpecificResults) function LoadFailed(why) { ++g.testResults.FailedLoad; - // Once bug 896840 is fixed, this can go away, but for now it will give log - // output that is TBPL starable for bug 789751 and bug 720452. if (!why) { - logger.error("load failed with unknown reason"); + // reftest-content.js sets an initial reason before it sets the + // timeout that will call us with the currently set reason, so we + // should never get here. If we do then there's a logic error + // somewhere. Perhaps tests are somehow running overlapped and the + // timeout for one test is not being cleared before the timeout for + // another is set? Maybe there's some sort of race? + logger.error("load failed with unknown reason (we should always have a reason!)"); } logger.testStatus(g.urls[0].identifier, "load failed: " + why, "FAIL", "PASS"); FlushTestBuffer();