Bug 1381933 - Retry loading blank page if gClearingForAssertionCheck but load event comes from another URL. r=jmaher
authorSamael Wang <freesamael@gmail.com>
Thu, 20 Jul 2017 17:15:32 +0800
changeset 419263 b756c4d0b7ff8ccf28abd2f4d81c685f35d76561
parent 419262 acde5b9b7b2547701d87d21c0546e42b828b886c
child 419264 051e50899b7adb6df22a32f2710fd60f020d1cc8
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1381933
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1381933 - Retry loading blank page if gClearingForAssertionCheck but load event comes from another URL. r=jmaher MozReview-Commit-ID: 9AIEW508oID
layout/tools/reftest/reftest-content.js
--- a/layout/tools/reftest/reftest-content.js
+++ b/layout/tools/reftest/reftest-content.js
@@ -670,19 +670,27 @@ function WaitForTestEnd(contentRootEleme
 
 function OnDocumentLoad(event)
 {
     var currentDoc = content.document;
     if (event.target != currentDoc)
         // Ignore load events for subframes.
         return;
 
-    if (gClearingForAssertionCheck &&
-        currentDoc.location.href == BLANK_URL_FOR_CLEARING) {
-        DoAssertionCheck();
+    if (gClearingForAssertionCheck) {
+        if (currentDoc.location.href == BLANK_URL_FOR_CLEARING) {
+            DoAssertionCheck();
+            return;
+        }
+
+        // It's likely the previous test document reloads itself and causes the
+        // attempt of loading blank page fails. In this case we should retry
+        // loading the blank page.
+        LogInfo("Retry loading a blank page");
+        LoadURI(BLANK_URL_FOR_CLEARING);
         return;
     }
 
     if (currentDoc.location.href != gCurrentURL) {
         LogInfo("OnDocumentLoad fired for previous document");
         // Ignore load events for previous documents.
         return;
     }