Bug 541396 - Intermittent failure in test_fallback.html | Fallback page displayed for top level document, r=jst, a=test-only-change
authorHonza Bambas <honzab.moz@firemni.cz>
Wed, 15 Dec 2010 19:30:01 +0100
changeset 59203 ef1ff8570ee9660f6fdcb1e43f3cd5883c1d5c52
parent 59202 182c7b6acb309d9ff0661411462111edebcd7d38
child 59204 baee733bafd8fd953366a5043f5c6d9a4d3c1686
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersjst, test-only-change
bugs541396
milestone2.0b9pre
Bug 541396 - Intermittent failure in test_fallback.html | Fallback page displayed for top level document, r=jst, a=test-only-change
dom/tests/mochitest/ajax/offline/test_fallback.html
--- a/dom/tests/mochitest/ajax/offline/test_fallback.html
+++ b/dom/tests/mochitest/ajax/offline/test_fallback.html
@@ -15,17 +15,16 @@
  * to make sure that no cache entries are created for the nonexistent items."
  * That would lead to a failure to fallback, as there would always be an entry
  * in the application cache.
  */
 
 var gStep = 1;
 var gChildLoad = false;
 var gTopWindow = null;
-var gCompleteTimeout = null;
 
 function manifestUpdated()
 {
   fallbackFrame.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/non-existing.html";
   // Invokes load of fallback.html
 }
 
 function onFallbackLoad(fallbackIdentification)
@@ -60,40 +59,35 @@ function onFallbackLoad(fallbackIdentifi
       break;
 
     case 004:
     case 104:
       OfflineTest.is(fallbackIdentification, 2, "fallback for namespace1/sub/ in step " + gStep);
 
       // Try opening a non-existing page as a top level document. It must
       // fall to fallbackTop.html that identifies it self as '100'.
-      gCompleteTimeout = window.setTimeout(function() {
-        OfflineTest.ok(false, "Fallback page displayed for top level document");
-        finalize();
-      }, 3000);
+      // Invokes load of fallbackTop.html
+      gTopWindow = window.open("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace2/non-existing.html");
 
-      gTopWindow = window.open("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace2/non-existing.html");
-      // Invokes load of fallbackTop.html
       break;
 
     case 005:
       // Try all over again. This checks there are no entries for non-existing
       // pages created/leaked. That would prevent fallback load.
       gStep = 100;
 
       fallbackFrame.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/non-existing.html";
       // Invokes load of fallback1.html, again, from the start
       // no break
     case 105:
       OfflineTest.is(fallbackIdentification, 100, "fallback for namespace2/, invoked by a top level document " + gStep);
 
       gTopWindow.close();
       gTopWindow = null;
-      window.clearTimeout(gCompleteTimeout);
-      gCompleteTimeout = null;
+
       break;
   }
 
   if (gStep == 105) {
     finalize();
     return;
   }