Bug 934748 - Refactored browser_popupNotification_3.js to use addProgressListener+executeSoon rather than addTabsProgressListener. r=smacleod
authorAvijit Gupta <526avijitgupta@gmail.com>
Wed, 04 Feb 2015 00:26:22 +0530
changeset 227657 cab80595dfc33ec90fadda250af3a0323b92dd09
parent 227656 78fe0a9ea65b6c8e571e86a3e2e962ab921e9c4c
child 227658 f0ff5147c6e1356c15860e72ccee47dc5babc07d
push id28236
push userryanvm@gmail.com
push dateThu, 05 Feb 2015 22:15:34 +0000
treeherdermozilla-central@71972672e292 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmacleod
bugs934748
milestone38.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 934748 - Refactored browser_popupNotification_3.js to use addProgressListener+executeSoon rather than addTabsProgressListener. r=smacleod
browser/base/content/test/popupNotifications/browser_popupNotification_3.js
--- a/browser/base/content/test/popupNotifications/browser_popupNotification_3.js
+++ b/browser/base/content/test/popupNotifications/browser_popupNotification_3.js
@@ -241,32 +241,32 @@ let tests = [
           ok(false, "Notification removed from browser when subframe navigated");
         }
       };
       showNotification(this.notifyObj);
     },
     onShown: function (popup) {
       let self = this;
       let progressListener = {
-        onLocationChange: function onLocationChange(aBrowser) {
-          if (aBrowser != gBrowser.selectedBrowser) {
-            return;
-          }
-          let notification = PopupNotifications.getNotification(self.notifyObj.id,
-                                                                self.notifyObj.browser);
-          ok(notification != null, "Notification remained when subframe navigated");
-          self.notifyObj.options.eventCallback = undefined;
+        onLocationChange: function onLocationChange() {
+          gBrowser.removeProgressListener(progressListener);
 
-          notification.remove();
-          gBrowser.removeTabsProgressListener(progressListener);
+	  executeSoon(() => {
+            let notification = PopupNotifications.getNotification(self.notifyObj.id,
+                                                                  self.notifyObj.browser);
+            ok(notification != null, "Notification remained when subframe navigated");
+            self.notifyObj.options.eventCallback = undefined;
+
+            notification.remove();
+	  });
         },
       };
 
       info("Adding progress listener and performing navigation");
-      gBrowser.addTabsProgressListener(progressListener);
+      gBrowser.addProgressListener(progressListener);
       content.document.getElementById("iframe")
                       .setAttribute("src", "http://example.org/");
     },
     onHidden: function () {}
   },
   // Popup Notifications should catch exceptions from callbacks
   { id: "Test#10",
     run: function () {