Bug 1444325 Replaced promiseTopicObserved with TestUtils.topicObserved: r?johannh
MozReview-Commit-ID: EwDv7OQRGzT
--- a/browser/base/content/test/popupNotifications/browser_popupNotification.js
+++ b/browser/base/content/test/popupNotifications/browser_popupNotification.js
@@ -108,17 +108,17 @@ var tests = [
// test opening a notification for a background browser
// Note: test 4 to 6 share a tab.
{ id: "Test#4",
async run() {
let tab = BrowserTestUtils.addTab(gBrowser, "http://example.com/");
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
isnot(gBrowser.selectedTab, tab, "new tab isn't selected");
wrongBrowserNotificationObject.browser = gBrowser.getBrowserForTab(tab);
- let promiseTopic = promiseTopicObserved("PopupNotifications-backgroundShow");
+ let promiseTopic = TestUtils.topicObserved("PopupNotifications-backgroundShow");
wrongBrowserNotification = showNotification(wrongBrowserNotificationObject);
await promiseTopic;
is(PopupNotifications.isPanelOpen, false, "panel isn't open");
ok(!wrongBrowserNotificationObject.mainActionClicked, "main action wasn't clicked");
ok(!wrongBrowserNotificationObject.secondaryActionClicked, "secondary action wasn't clicked");
ok(!wrongBrowserNotificationObject.dismissalCallbackTriggered, "dismissal callback wasn't called");
goNext();
}
@@ -142,17 +142,17 @@ var tests = [
wrongBrowserNotification.remove();
ok(wrongBrowserNotificationObject.removedCallbackTriggered, "removed callback triggered");
wrongBrowserNotification = null;
}
},
// test that the removed notification isn't shown on browser re-select
{ id: "Test#6",
async run() {
- let promiseTopic = promiseTopicObserved("PopupNotifications-updateNotShowing");
+ let promiseTopic = TestUtils.topicObserved("PopupNotifications-updateNotShowing");
gBrowser.selectedTab = gBrowser.tabs[gBrowser.tabs.length - 1];
await promiseTopic;
is(PopupNotifications.isPanelOpen, false, "panel isn't open");
gBrowser.removeTab(gBrowser.selectedTab);
goNext();
}
},
// Test that two notifications with the same ID result in a single displayed