Bug 752216. (Gv1-FF) browser_popupNotification.js: Use locationbar to simplify test 19. r=gavin.
authorSerge Gautherie <sgautherie.bz@free.fr>
Thu, 10 May 2012 01:58:26 +0200
changeset 93605 cb6759edb5779799922c4ce9a104731c4da2a8e3
parent 93604 3b06e981ce0df8de1fea5f6654df3bda06897c97
child 93606 e94c62e5ea1c620486cfc61fa5778ea530af01ff
push id22654
push usersgautherie.bz@free.fr
push dateWed, 09 May 2012 23:59:21 +0000
treeherdermozilla-central@cb6759edb577 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs752216
milestone15.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 752216. (Gv1-FF) browser_popupNotification.js: Use locationbar to simplify test 19. r=gavin.
browser/base/content/test/browser_popupNotification.js
--- a/browser/base/content/test/browser_popupNotification.js
+++ b/browser/base/content/test/browser_popupNotification.js
@@ -256,17 +256,16 @@ var tests = [
       gBrowser.selectedTab = gNewTab;
     },
     onShown: function (popup) {
       checkPopup(popup, wrongBrowserNotificationObject);
       is(PopupNotifications.isPanelOpen, true, "isPanelOpen getter doesn't lie");
 
       // switch back to the old browser
       gBrowser.selectedTab = this.oldSelectedTab;
-
     },
     onHidden: function (popup) {
       // actually remove the notification to prevent it from reappearing
       ok(wrongBrowserNotificationObject.dismissalCallbackTriggered, "dismissal callback triggered due to tab switch");
       wrongBrowserNotification.remove();
       ok(wrongBrowserNotificationObject.removedCallbackTriggered, "removed callback triggered");
       wrongBrowserNotification = null;
     }
@@ -596,37 +595,30 @@ var tests = [
       ok(this.notifyObj.dismissalCallbackTriggered, "dismissal callback triggered");
       this.notification.remove();
       ok(this.notifyObj.removedCallbackTriggered, "removed callback triggered");
     }
   },
   // Test notification when chrome is hidden
   { // Test #19
     run: function () {
-      this.oldSelectedTab = gBrowser.selectedTab;
-      gBrowser.selectedTab = gBrowser.addTab("about:blank");
-
-      let self = this;
-      loadURI("about:addons", function() {
-        self.notifyObj = new basicNotification();
-        self.notification = showNotification(self.notifyObj);
-      });
+      window.locationbar.visible = false;
+      this.notifyObj = new basicNotification();
+      this.notification = showNotification(this.notifyObj);
+      window.locationbar.visible = true;
     },
     onShown: function (popup) {
       checkPopup(popup, this.notifyObj);
       is(popup.anchorNode.className, "tabbrowser-tab", "notification anchored to tab");
       dismissNotification(popup);
     },
     onHidden: function (popup) {
       ok(this.notifyObj.dismissalCallbackTriggered, "dismissal callback triggered");
       this.notification.remove();
       ok(this.notifyObj.removedCallbackTriggered, "removed callback triggered");
-
-      gBrowser.removeTab(gBrowser.selectedTab);
-      gBrowser.selectedTab = this.oldSelectedTab;
     }
   },
   // Test notification is removed when dismissed if removeOnDismissal is true
   { // Test #20
     run: function () {
       this.notifyObj = new basicNotification();
       this.notifyObj.addOptions({
         removeOnDismissal: true