Bug 753765 Really don't notify popup notifications on tab switches f=sgautherie r=IanN
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Thu, 28 Jun 2012 08:32:06 +0100
changeset 10532 4d1465a48f5a735c3f7b5b87fd125d0fa29ae8ac
parent 10531 ba181a8a94d4a34482fb7f257763f87600034087
child 10533 c2e2bef7c4ac2ddb8320f17e064956f8f27056c0
push id7958
push userneil@parkwaycc.co.uk
push dateThu, 28 Jun 2012 07:32:17 +0000
treeherdercomm-central@4d1465a48f5a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN
bugs753765
Bug 753765 Really don't notify popup notifications on tab switches f=sgautherie r=IanN
suite/browser/nsBrowserStatusHandler.js
suite/browser/test/browser/browser_popupNotification.js
--- a/suite/browser/nsBrowserStatusHandler.js
+++ b/suite/browser/nsBrowserStatusHandler.js
@@ -331,19 +331,19 @@ nsBrowserStatusHandler.prototype =
         URLBarSetURI(aLocation, true);
       } else {
         this.urlBar.value = userTypedValue;
         SetPageProxyState("invalid", null);
       }
 
       // Only dismiss notifications if this onLocationChange represents an
       // actual load (or an error page).
-      if (this.popupNotifications &&
+      if (aRequest && this.popupNotifications &&
           (aWebProgress.isLoadingDocument ||
-           (aRequest && !Components.isSuccessCode(aRequest.status))))
+           !Components.isSuccessCode(aRequest.status)))
         this.popupNotifications.locationChange();
 
       PlacesStarButton.updateState();
 
       this.feedsMenu.setAttribute("disabled", "true");
       this.feedsButton.hidden = true;
       this.feeds = [];
 
--- a/suite/browser/test/browser/browser_popupNotification.js
+++ b/suite/browser/test/browser/browser_popupNotification.js
@@ -227,23 +227,16 @@ var tests = [
       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;
-    },
-    // XXX: the logic taken from bug 575957 fails to work here, work around it for now.
-    updateNotShowing: function () {
-      todo_is(PopupNotifications.isPanelOpen, true, "panel should be open");
-      gBrowser.selectedTab = this.oldSelectedTab;
-      wrongBrowserNotification.remove();
-      wrongBrowserNotification = null;
     }
   },
   // test that the removed notification isn't shown on browser re-select
   { // Test #5
     run: function () {
       gBrowser.selectedTab = gNewTab;
     },
     updateNotShowing: function () {