summaryrefslogtreecommitdiffstats
path: root/browser/components/customizableui/test
diff options
context:
space:
mode:
Diffstat (limited to 'browser/components/customizableui/test')
-rw-r--r--browser/components/customizableui/test/browser_1087303_button_fullscreen.js2
-rw-r--r--browser/components/customizableui/test/browser_1087303_button_preferences.js2
-rw-r--r--browser/components/customizableui/test/browser_1484275_PanelMultiView_toggle_with_other_popup.js2
-rw-r--r--browser/components/customizableui/test/browser_885052_customize_mode_observers_disabed.js4
-rw-r--r--browser/components/customizableui/test/browser_940307_panel_click_closure_handling.js7
-rw-r--r--browser/components/customizableui/test/browser_947914_button_newPrivateWindow.js2
-rw-r--r--browser/components/customizableui/test/browser_947914_button_newWindow.js2
-rw-r--r--browser/components/customizableui/test/browser_947914_button_zoomReset.js2
-rw-r--r--browser/components/customizableui/test/browser_972267_customizationchange_events.js2
-rw-r--r--browser/components/customizableui/test/browser_customization_context_menus.js10
-rw-r--r--browser/components/customizableui/test/browser_editcontrols_update.js2
-rw-r--r--browser/components/customizableui/test/browser_open_in_lazy_tab.js2
-rw-r--r--browser/components/customizableui/test/browser_panelUINotifications.js12
-rw-r--r--browser/components/customizableui/test/browser_panelUINotifications_fullscreen_noAutoHideToolbar.js2
-rw-r--r--browser/components/customizableui/test/browser_panelUINotifications_modals.js4
-rw-r--r--browser/components/customizableui/test/browser_panelUINotifications_multiWindow.js6
-rw-r--r--browser/components/customizableui/test/browser_switch_to_customize_mode.js2
-rw-r--r--browser/components/customizableui/test/browser_synced_tabs_menu.js6
-rw-r--r--browser/components/customizableui/test/head.js12
19 files changed, 39 insertions, 44 deletions
diff --git a/browser/components/customizableui/test/browser_1087303_button_fullscreen.js b/browser/components/customizableui/test/browser_1087303_button_fullscreen.js
index f67e81b892..42f9b58370 100644
--- a/browser/components/customizableui/test/browser_1087303_button_fullscreen.js
+++ b/browser/components/customizableui/test/browser_1087303_button_fullscreen.js
@@ -44,7 +44,7 @@ function promiseFullscreenChange() {
reject("Fullscreen change did not happen within " + 20000 + "ms");
}, 20000);
- function onFullscreenChange(event) {
+ function onFullscreenChange() {
clearTimeout(timeoutId);
window.removeEventListener("fullscreen", onFullscreenChange, true);
info("Fullscreen event received");
diff --git a/browser/components/customizableui/test/browser_1087303_button_preferences.js b/browser/components/customizableui/test/browser_1087303_button_preferences.js
index 7db48341cb..86bc89f48e 100644
--- a/browser/components/customizableui/test/browser_1087303_button_preferences.js
+++ b/browser/components/customizableui/test/browser_1087303_button_preferences.js
@@ -47,7 +47,7 @@ function waitForPageLoad(aTab) {
reject("Page didn't load within " + 20000 + "ms");
}, 20000);
- async function onTabLoad(event) {
+ async function onTabLoad() {
clearTimeout(timeoutId);
aTab.linkedBrowser.removeEventListener("load", onTabLoad, true);
info("Tab event received: load");
diff --git a/browser/components/customizableui/test/browser_1484275_PanelMultiView_toggle_with_other_popup.js b/browser/components/customizableui/test/browser_1484275_PanelMultiView_toggle_with_other_popup.js
index 89b86dba20..5d44cb1664 100644
--- a/browser/components/customizableui/test/browser_1484275_PanelMultiView_toggle_with_other_popup.js
+++ b/browser/components/customizableui/test/browser_1484275_PanelMultiView_toggle_with_other_popup.js
@@ -21,7 +21,7 @@ add_task(async function test_PanelMultiView_toggle_with_other_popup() {
gBrowser,
url: TEST_URL,
},
- async function (browser) {
+ async function () {
// 1. Open the main menu.
await gCUITestUtils.openMainMenu();
diff --git a/browser/components/customizableui/test/browser_885052_customize_mode_observers_disabed.js b/browser/components/customizableui/test/browser_885052_customize_mode_observers_disabed.js
index 346608dc99..b174d2bccf 100644
--- a/browser/components/customizableui/test/browser_885052_customize_mode_observers_disabed.js
+++ b/browser/components/customizableui/test/browser_885052_customize_mode_observers_disabed.js
@@ -34,7 +34,7 @@ add_task(async function () {
"Should not be in fullscreen sizemode before we enter fullscreen."
);
- BrowserFullScreen();
+ BrowserCommands.fullScreen();
await TestUtils.waitForCondition(() => isFullscreenSizeMode());
ok(
fullscreenButton.checked,
@@ -62,7 +62,7 @@ add_task(async function () {
await endCustomizing();
- BrowserFullScreen();
+ BrowserCommands.fullScreen();
fullscreenButton = document.getElementById("fullscreen-button");
await TestUtils.waitForCondition(() => !isFullscreenSizeMode());
ok(
diff --git a/browser/components/customizableui/test/browser_940307_panel_click_closure_handling.js b/browser/components/customizableui/test/browser_940307_panel_click_closure_handling.js
index 0cf9a93341..8f2dc87e19 100644
--- a/browser/components/customizableui/test/browser_940307_panel_click_closure_handling.js
+++ b/browser/components/customizableui/test/browser_940307_panel_click_closure_handling.js
@@ -124,18 +124,17 @@ add_task(async function disabled_button_in_panel() {
button.remove();
});
-registerCleanupFunction(function () {
+registerCleanupFunction(async function () {
if (button && button.parentNode) {
button.remove();
}
if (menuButton && menuButton.parentNode) {
menuButton.remove();
}
- // Sadly this isn't task.jsm-enabled, so we can't wait for this to happen. But we should
- // definitely close it here and hope it won't interfere with other tests.
- // Of course, all the tests are meant to do this themselves, but if they fail...
if (isOverflowOpen()) {
+ let panelHiddenPromise = promiseOverflowHidden(window);
PanelUI.overflowPanel.hidePopup();
+ await panelHiddenPromise;
}
CustomizableUI.reset();
});
diff --git a/browser/components/customizableui/test/browser_947914_button_newPrivateWindow.js b/browser/components/customizableui/test/browser_947914_button_newPrivateWindow.js
index cc8842a3e8..42daab891f 100644
--- a/browser/components/customizableui/test/browser_947914_button_newPrivateWindow.js
+++ b/browser/components/customizableui/test/browser_947914_button_newPrivateWindow.js
@@ -21,7 +21,7 @@ add_task(async function () {
let privateWindow = null;
let observerWindowOpened = {
- observe(aSubject, aTopic, aData) {
+ observe(aSubject, aTopic) {
if (aTopic == "domwindowopened") {
privateWindow = aSubject;
privateWindow.addEventListener(
diff --git a/browser/components/customizableui/test/browser_947914_button_newWindow.js b/browser/components/customizableui/test/browser_947914_button_newWindow.js
index 591d13191e..910dd2a179 100644
--- a/browser/components/customizableui/test/browser_947914_button_newWindow.js
+++ b/browser/components/customizableui/test/browser_947914_button_newWindow.js
@@ -21,7 +21,7 @@ add_task(async function () {
let newWindow = null;
let observerWindowOpened = {
- observe(aSubject, aTopic, aData) {
+ observe(aSubject, aTopic) {
if (aTopic == "domwindowopened") {
newWindow = aSubject;
newWindow.addEventListener(
diff --git a/browser/components/customizableui/test/browser_947914_button_zoomReset.js b/browser/components/customizableui/test/browser_947914_button_zoomReset.js
index 7dc8299b28..c97e2f17d1 100644
--- a/browser/components/customizableui/test/browser_947914_button_zoomReset.js
+++ b/browser/components/customizableui/test/browser_947914_button_zoomReset.js
@@ -12,7 +12,7 @@ add_task(async function () {
await BrowserTestUtils.withNewTab(
{ gBrowser, url: "http://example.com", waitForLoad: true },
- async function (browser) {
+ async function () {
CustomizableUI.addWidgetToArea(
"zoom-controls",
CustomizableUI.AREA_FIXED_OVERFLOW_PANEL
diff --git a/browser/components/customizableui/test/browser_972267_customizationchange_events.js b/browser/components/customizableui/test/browser_972267_customizationchange_events.js
index 7d27b94136..fdd7236d65 100644
--- a/browser/components/customizableui/test/browser_972267_customizationchange_events.js
+++ b/browser/components/customizableui/test/browser_972267_customizationchange_events.js
@@ -11,7 +11,7 @@ add_task(async function () {
let otherToolbox = newWindow.gNavToolbox;
let handlerCalledCount = 0;
- let handler = ev => {
+ let handler = () => {
handlerCalledCount++;
};
diff --git a/browser/components/customizableui/test/browser_customization_context_menus.js b/browser/components/customizableui/test/browser_customization_context_menus.js
index 526b3abd1b..3f4c94fb72 100644
--- a/browser/components/customizableui/test/browser_customization_context_menus.js
+++ b/browser/components/customizableui/test/browser_customization_context_menus.js
@@ -171,8 +171,8 @@ add_task(async function urlbar_context() {
let contextMenu = document.getElementById("toolbar-context-menu");
let shownPromise = popupShown(contextMenu);
let urlBarContainer = document.getElementById("urlbar-container");
- // Need to make sure not to click within an edit field.
- EventUtils.synthesizeMouse(urlBarContainer, 100, 1, {
+ // This clicks in the urlbar container margin, to avoid hitting the urlbar field.
+ EventUtils.synthesizeMouse(urlBarContainer, -2, 4, {
type: "contextmenu",
button: 2,
});
@@ -549,7 +549,7 @@ add_task(async function custom_context_menus() {
await startCustomizing();
is(
widget.getAttribute("context"),
- "",
+ null,
"Should not have own context menu in the toolbar now that we're customizing."
);
is(
@@ -562,7 +562,7 @@ add_task(async function custom_context_menus() {
simulateItemDrag(widget, panel);
is(
widget.getAttribute("context"),
- "",
+ null,
"Should not have own context menu when in the panel."
);
is(
@@ -577,7 +577,7 @@ add_task(async function custom_context_menus() {
);
is(
widget.getAttribute("context"),
- "",
+ null,
"Should not have own context menu when back in toolbar because we're still customizing."
);
is(
diff --git a/browser/components/customizableui/test/browser_editcontrols_update.js b/browser/components/customizableui/test/browser_editcontrols_update.js
index 9f064e521a..1276606779 100644
--- a/browser/components/customizableui/test/browser_editcontrols_update.js
+++ b/browser/components/customizableui/test/browser_editcontrols_update.js
@@ -29,7 +29,7 @@ function expectCommandUpdate(count, testWindow = window) {
supportsCommand(cmd) {
return cmd == "cmd_delete";
},
- isCommandEnabled(cmd) {
+ isCommandEnabled() {
if (!count) {
ok(false, "unexpected update");
reject();
diff --git a/browser/components/customizableui/test/browser_open_in_lazy_tab.js b/browser/components/customizableui/test/browser_open_in_lazy_tab.js
index c18de67698..696bfde69b 100644
--- a/browser/components/customizableui/test/browser_open_in_lazy_tab.js
+++ b/browser/components/customizableui/test/browser_open_in_lazy_tab.js
@@ -9,7 +9,7 @@ add_task(async function open_customize_mode_in_lazy_tab() {
});
gCustomizeMode.setTab(tab);
- is(tab.linkedPanel, "", "Tab should be lazy");
+ is(tab.linkedPanel, null, "Tab should be lazy");
let title = gNavigatorBundle.getFormattedString("customizeMode.tabTitle", [
document.getElementById("bundle_brand").getString("brandShortName"),
diff --git a/browser/components/customizableui/test/browser_panelUINotifications.js b/browser/components/customizableui/test/browser_panelUINotifications.js
index 818fcbad39..d5f2cc0450 100644
--- a/browser/components/customizableui/test/browser_panelUINotifications.js
+++ b/browser/components/customizableui/test/browser_panelUINotifications.js
@@ -14,7 +14,7 @@ add_task(async function testMainActionCalled() {
url: "about:blank",
};
- await BrowserTestUtils.withNewTab(options, function (browser) {
+ await BrowserTestUtils.withNewTab(options, function () {
is(
PanelUI.notificationPanel.state,
"closed",
@@ -77,7 +77,7 @@ add_task(async function testSecondaryActionWorkflow() {
url: "about:blank",
};
- await BrowserTestUtils.withNewTab(options, async function (browser) {
+ await BrowserTestUtils.withNewTab(options, async function () {
is(
PanelUI.notificationPanel.state,
"closed",
@@ -167,7 +167,7 @@ add_task(async function testDownloadingBadge() {
url: "about:blank",
};
- await BrowserTestUtils.withNewTab(options, async function (browser) {
+ await BrowserTestUtils.withNewTab(options, async function () {
let mainActionCalled = false;
let mainAction = {
callback: () => {
@@ -225,7 +225,7 @@ add_task(async function testDownloadingBadge() {
* then we display any other badges that are remaining.
*/
add_task(async function testInteractionWithBadges() {
- await BrowserTestUtils.withNewTab("about:blank", async function (browser) {
+ await BrowserTestUtils.withNewTab("about:blank", async function () {
// Remove the fxa toolbar button from the navbar to ensure the notification
// is displayed on the app menu button.
let { CustomizableUI } = ChromeUtils.importESModule(
@@ -328,7 +328,7 @@ add_task(async function testInteractionWithBadges() {
* This tests that adding a badge will not dismiss any existing doorhangers.
*/
add_task(async function testAddingBadgeWhileDoorhangerIsShowing() {
- await BrowserTestUtils.withNewTab("about:blank", function (browser) {
+ await BrowserTestUtils.withNewTab("about:blank", function () {
is(
PanelUI.notificationPanel.state,
"closed",
@@ -468,7 +468,7 @@ add_task(async function testMultipleBadges() {
* Tests that non-badges also operate like a stack.
*/
add_task(async function testMultipleNonBadges() {
- await BrowserTestUtils.withNewTab("about:blank", async function (browser) {
+ await BrowserTestUtils.withNewTab("about:blank", async function () {
is(
PanelUI.notificationPanel.state,
"closed",
diff --git a/browser/components/customizableui/test/browser_panelUINotifications_fullscreen_noAutoHideToolbar.js b/browser/components/customizableui/test/browser_panelUINotifications_fullscreen_noAutoHideToolbar.js
index 853c39e89f..d90f928ed9 100644
--- a/browser/components/customizableui/test/browser_panelUINotifications_fullscreen_noAutoHideToolbar.js
+++ b/browser/components/customizableui/test/browser_panelUINotifications_fullscreen_noAutoHideToolbar.js
@@ -20,7 +20,7 @@ function waitForDocshellActivated() {
content.document,
"visibilitychange",
true /* capture */,
- aEvent => {
+ () => {
return content.browsingContext.isActive;
}
);
diff --git a/browser/components/customizableui/test/browser_panelUINotifications_modals.js b/browser/components/customizableui/test/browser_panelUINotifications_modals.js
index 87be14fcee..a3aa6d058a 100644
--- a/browser/components/customizableui/test/browser_panelUINotifications_modals.js
+++ b/browser/components/customizableui/test/browser_panelUINotifications_modals.js
@@ -8,10 +8,6 @@ const { AppMenuNotifications } = ChromeUtils.importESModule(
);
add_task(async function testModals() {
- await SpecialPowers.pushPrefEnv({
- set: [["prompts.windowPromptSubDialog", true]],
- });
-
is(
PanelUI.notificationPanel.state,
"closed",
diff --git a/browser/components/customizableui/test/browser_panelUINotifications_multiWindow.js b/browser/components/customizableui/test/browser_panelUINotifications_multiWindow.js
index fd75763857..edda165692 100644
--- a/browser/components/customizableui/test/browser_panelUINotifications_multiWindow.js
+++ b/browser/components/customizableui/test/browser_panelUINotifications_multiWindow.js
@@ -15,7 +15,7 @@ add_task(async function testDoesNotShowDoorhangerForBackgroundWindow() {
url: "about:blank",
};
- await BrowserTestUtils.withNewTab(options, async function (browser) {
+ await BrowserTestUtils.withNewTab(options, async function () {
let win = await BrowserTestUtils.openNewBrowserWindow();
await SimpleTest.promiseFocus(win);
let mainActionCalled = false;
@@ -95,7 +95,7 @@ add_task(
url: "about:blank",
};
- await BrowserTestUtils.withNewTab(options, async function (browser) {
+ await BrowserTestUtils.withNewTab(options, async function () {
let win = await BrowserTestUtils.openNewBrowserWindow();
await SimpleTest.promiseFocus(win);
AppMenuNotifications.showNotification("update-manual", { callback() {} });
@@ -140,7 +140,7 @@ add_task(
url: "about:blank",
};
- await BrowserTestUtils.withNewTab(options, async function (browser) {
+ await BrowserTestUtils.withNewTab(options, async function () {
let win = await BrowserTestUtils.openNewBrowserWindow();
await SimpleTest.promiseFocus(win);
AppMenuNotifications.showNotification("update-manual", { callback() {} });
diff --git a/browser/components/customizableui/test/browser_switch_to_customize_mode.js b/browser/components/customizableui/test/browser_switch_to_customize_mode.js
index 55e80d3517..e3988cb41e 100644
--- a/browser/components/customizableui/test/browser_switch_to_customize_mode.js
+++ b/browser/components/customizableui/test/browser_switch_to_customize_mode.js
@@ -18,7 +18,7 @@ add_task(async function () {
await finishedCustomizing;
let startedCount = 0;
- let handler = e => startedCount++;
+ let handler = () => startedCount++;
gNavToolbox.addEventListener("customizationstarting", handler);
await startCustomizing();
CustomizableUI.removeWidgetFromArea("stop-reload-button");
diff --git a/browser/components/customizableui/test/browser_synced_tabs_menu.js b/browser/components/customizableui/test/browser_synced_tabs_menu.js
index ff60167fea..33c8f6a845 100644
--- a/browser/components/customizableui/test/browser_synced_tabs_menu.js
+++ b/browser/components/customizableui/test/browser_synced_tabs_menu.js
@@ -40,7 +40,7 @@ function updateTabsPanel() {
return promiseTabsUpdated;
}
-// This is the mock we use for SyncedTabs.jsm - tests may override various
+// This is the mock we use for SyncedTabs.sys.mjs - tests may override various
// functions.
let mockedInternal = {
get isConfiguredToSyncTabs() {
@@ -378,7 +378,7 @@ add_task(async function () {
// There is a single node saying there's no tabs for the client.
node = node.nextElementSibling;
is(node.nodeName, "label", "node is a label");
- is(node.getAttribute("itemtype"), "", "node is neither a tab nor a client");
+ is(node.getAttribute("itemtype"), null, "node is neither a tab nor a client");
node = node.nextElementSibling;
is(node, null, "no more siblings");
@@ -514,7 +514,7 @@ add_task(async function () {
return promise;
}
- showMoreButton = checkTabsPage(25, "Show More Tabs");
+ showMoreButton = checkTabsPage(25, "Show more tabs");
await clickShowMoreButton();
checkTabsPage(77, null);
diff --git a/browser/components/customizableui/test/head.js b/browser/components/customizableui/test/head.js
index f8c0d02a12..bc1e88ed61 100644
--- a/browser/components/customizableui/test/head.js
+++ b/browser/components/customizableui/test/head.js
@@ -267,7 +267,7 @@ function openAndLoadWindow(aOptions, aWaitForDelayedStartup = false) {
return new Promise(resolve => {
let win = OpenBrowserWindow(aOptions);
if (aWaitForDelayedStartup) {
- Services.obs.addObserver(function onDS(aSubject, aTopic, aData) {
+ Services.obs.addObserver(function onDS(aSubject) {
if (aSubject != win) {
return;
}
@@ -309,7 +309,7 @@ function promisePanelElementShown(win, aPanel) {
let timeoutId = win.setTimeout(() => {
reject("Panel did not show within 20 seconds.");
}, 20000);
- function onPanelOpen(e) {
+ function onPanelOpen() {
aPanel.removeEventListener("popupshown", onPanelOpen);
win.clearTimeout(timeoutId);
resolve();
@@ -328,7 +328,7 @@ function promisePanelElementHidden(win, aPanel) {
let timeoutId = win.setTimeout(() => {
reject("Panel did not hide within 20 seconds.");
}, 20000);
- function onPanelClose(e) {
+ function onPanelClose() {
aPanel.removeEventListener("popuphidden", onPanelClose);
win.clearTimeout(timeoutId);
executeSoon(resolve);
@@ -352,7 +352,7 @@ function subviewShown(aSubview) {
let timeoutId = win.setTimeout(() => {
reject("Subview (" + aSubview.id + ") did not show within 20 seconds.");
}, 20000);
- function onViewShown(e) {
+ function onViewShown() {
aSubview.removeEventListener("ViewShown", onViewShown);
win.clearTimeout(timeoutId);
resolve();
@@ -367,7 +367,7 @@ function subviewHidden(aSubview) {
let timeoutId = win.setTimeout(() => {
reject("Subview (" + aSubview.id + ") did not hide within 20 seconds.");
}, 20000);
- function onViewHiding(e) {
+ function onViewHiding() {
aSubview.removeEventListener("ViewHiding", onViewHiding);
win.clearTimeout(timeoutId);
resolve();
@@ -406,7 +406,7 @@ function promiseTabLoadEvent(aTab, aURL) {
* @return {Promise} resolved when the requisite mutation shows up.
*/
function promiseAttributeMutation(aNode, aAttribute, aFilterFn) {
- return new Promise((resolve, reject) => {
+ return new Promise(resolve => {
info("waiting for mutation of attribute '" + aAttribute + "'.");
let obs = new MutationObserver(mutations => {
for (let mut of mutations) {