mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-30 14:17:36 -10:00
Converts the test functions getLocalPatchString, getLocalUpdateString, getRemotePatchString, and getRemoteUpdateString to use an object as a param.
38 lines
1.4 KiB
JavaScript
38 lines
1.4 KiB
JavaScript
add_task(async function testUpdatesBackgroundWindow() {
|
|
SpecialPowers.pushPrefEnv({set: [
|
|
[PREF_APP_UPDATE_STAGING_ENABLED, false],
|
|
[PREF_APP_UPDATE_AUTO, false]
|
|
]});
|
|
|
|
let updateParams = "promptWaitTime=0";
|
|
let extraWindow = await BrowserTestUtils.openNewBrowserWindow();
|
|
await SimpleTest.promiseFocus(extraWindow);
|
|
|
|
await runUpdateTest(updateParams, 1, [
|
|
async function() {
|
|
await BrowserTestUtils.waitForCondition(() => PanelUI.menuButton.hasAttribute("badge-status"),
|
|
"Background window has a badge.");
|
|
is(PanelUI.notificationPanel.state, "closed",
|
|
"The doorhanger is not showing for the background window");
|
|
is(PanelUI.menuButton.getAttribute("badge-status"), "update-available",
|
|
"The badge is showing for the background window");
|
|
let popupShownPromise = BrowserTestUtils.waitForEvent(PanelUI.notificationPanel, "popupshown");
|
|
await BrowserTestUtils.closeWindow(extraWindow);
|
|
await SimpleTest.promiseFocus(window);
|
|
await popupShownPromise;
|
|
|
|
checkWhatsNewLink("update-available-whats-new");
|
|
let buttonEl = getNotificationButton(window, "update-available", "button");
|
|
buttonEl.click();
|
|
},
|
|
{
|
|
notificationId: "update-restart",
|
|
button: "secondarybutton",
|
|
cleanup() {
|
|
AppMenuNotifications.removeNotification(/.*/);
|
|
}
|
|
},
|
|
]);
|
|
});
|
|
|