Backed out changeset 72912a71fb98 (bug 1088163) because it depends on BrowserTestUtils, which isn't available on 37. FIREFOX_RELEASE_37_BASE
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 23 Mar 2015 12:43:46 -0400
changeset 252091 196c6575593d
parent 252090 19b630388dda
child 252092 64589321554b
push id698
push userjlund@mozilla.com
push date2015-03-23 22:08 +0000
treeherdermozilla-release@b0c0ae7b02a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1088163
milestone37.0
backs out72912a71fb98
Backed out changeset 72912a71fb98 (bug 1088163) because it depends on BrowserTestUtils, which isn't available on 37.
browser/base/content/test/general/browser_offlineQuotaNotification.js
--- a/browser/base/content/test/general/browser_offlineQuotaNotification.js
+++ b/browser/base/content/test/general/browser_offlineQuotaNotification.js
@@ -46,30 +46,18 @@ function checkInContentPreferences(win) 
   is(tab, "networkTab", "Network tab is selected");
   // all good, we are done.
   win.close();
   finish();
 }
 
 function test() {
   waitForExplicitFinish();
-
-  Services.prefs.setBoolPref("offline-apps.allow_by_default", false);
-
-  // Open a new tab.
-  gBrowser.selectedTab = gBrowser.addTab(URL);
-  registerCleanupFunction(() => gBrowser.removeCurrentTab());
-
-
-  Promise.all([
-    // Wait for a notification that asks whether to allow offline storage.
-    promiseNotification(),
-    // Wait for the tab to load.
-    BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser)
-  ]).then(() => {
+  gBrowser.selectedBrowser.addEventListener("load", function onload() {
+    gBrowser.selectedBrowser.removeEventListener("load", onload, true);
     gBrowser.selectedBrowser.contentWindow.applicationCache.oncached = function() {
       executeSoon(function() {
         // We got cached - now we should have provoked the quota warning.
         let notification = PopupNotifications.getNotification('offline-app-usage');
         ok(notification, "have offline-app-usage notification");
         // select the default action - this should cause the preferences
         // window to open - which we track either via a window watcher (for
         // the window-based prefs) or via an "Initialized" event (for
@@ -94,19 +82,13 @@ function test() {
         }
       });
     };
     Services.prefs.setIntPref("offline-apps.quota.warn", 1);
 
     // Click the notification panel's "Allow" button.  This should kick
     // off updates which will call our oncached handler above.
     PopupNotifications.panel.firstElementChild.button.click();
-  });
-}
+  }, true);
 
-function promiseNotification() {
-  return new Promise(resolve => {
-    PopupNotifications.panel.addEventListener("popupshown", function onShown() {
-      PopupNotifications.panel.removeEventListener("popupshown", onShown);
-      resolve();
-    });
-  });
+  Services.prefs.setBoolPref("offline-apps.allow_by_default", false);
+  gBrowser.contentWindow.location = URL;
 }