--- a/browser/components/customizableui/CustomizableWidgets.jsm
+++ b/browser/components/customizableui/CustomizableWidgets.jsm
@@ -1022,20 +1022,17 @@ const CustomizableWidgets = [
if (this.maybeDisableMenu(document))
aNode.setAttribute("disabled", "true");
else
aNode.removeAttribute("disabled");
};
let getPanel = () => {
let {PanelUI} = document.ownerGlobal;
- if (PanelUI.overflowContents) {
- return document.getElementById("widget-overflow");
- }
- return PanelUI.panel;
+ return PanelUI.overflowPanel;
}
if (CustomizableUI.getAreaType(this.currentArea) == CustomizableUI.TYPE_MENU_PANEL) {
getPanel().addEventListener("popupshowing", updateButton);
}
let listener = {
onWidgetAdded: (aWidgetId, aArea) => {
--- a/browser/components/customizableui/test/browser.ini
+++ b/browser/components/customizableui/test/browser.ini
@@ -79,18 +79,16 @@ skip-if = os == "linux" # Intermittent f
skip-if = os == "linux" # Intermittent failures
[browser_947914_button_newWindow.js]
skip-if = os == "linux" # Intermittent failures
[browser_947914_button_paste.js]
subsuite = clipboard
skip-if = os == "linux" # Intermittent failures on Linux
[browser_947914_button_print.js]
skip-if = os == "linux" # Intermittent failures on Linux
-[browser_947914_button_savePage.js]
-skip-if = os == "linux" # Intermittent failures
[browser_947914_button_zoomIn.js]
skip-if = os == "linux" # Intermittent failures
[browser_947914_button_zoomOut.js]
skip-if = os == "linux" # Intermittent failures
[browser_947914_button_zoomReset.js]
skip-if = os == "linux" # Intermittent failures
[browser_947987_removable_default.js]
[browser_948985_non_removable_defaultArea.js]
--- a/browser/components/customizableui/test/browser_1087303_button_fullscreen.js
+++ b/browser/components/customizableui/test/browser_1087303_button_fullscreen.js
@@ -1,19 +1,21 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
add_task(async function() {
- await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
info("Check fullscreen button existence and functionality");
- await PanelUI.show();
+ CustomizableUI.addWidgetToArea("fullscreen-button", CustomizableUI.AREA_FIXED_OVERFLOW_PANEL);
+ registerCleanupFunction(() => CustomizableUI.reset());
+
+ await document.getElementById("nav-bar").overflowable.show();
let fullscreenButton = document.getElementById("fullscreen-button");
ok(fullscreenButton, "Fullscreen button appears in Panel Menu");
let fullscreenPromise = promiseFullscreenChange();
fullscreenButton.click();
await fullscreenPromise;
--- a/browser/components/customizableui/test/browser_1087303_button_preferences.js
+++ b/browser/components/customizableui/test/browser_1087303_button_preferences.js
@@ -2,20 +2,21 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var newTab = null;
add_task(async function() {
- await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
info("Check preferences button existence and functionality");
+ CustomizableUI.addWidgetToArea("preferences-button", CustomizableUI.AREA_FIXED_OVERFLOW_PANEL);
+ registerCleanupFunction(() => CustomizableUI.reset());
- await PanelUI.show();
+ await document.getElementById("nav-bar").overflowable.show();
info("Menu panel was opened");
let preferencesButton = document.getElementById("preferences-button");
ok(preferencesButton, "Preferences button exists in Panel Menu");
preferencesButton.click();
newTab = gBrowser.selectedTab;
await waitForPageLoad(newTab);
--- a/browser/components/customizableui/test/browser_947914_button_addons.js
+++ b/browser/components/customizableui/test/browser_947914_button_addons.js
@@ -3,32 +3,33 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var initialLocation = gBrowser.currentURI.spec;
var newTab = null;
add_task(async function() {
- await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
+ CustomizableUI.addWidgetToArea("add-ons-button", CustomizableUI.AREA_FIXED_OVERFLOW_PANEL);
info("Check addons button existence and functionality");
- await PanelUI.show();
+ await document.getElementById("nav-bar").overflowable.show();
info("Menu panel was opened");
let addonsButton = document.getElementById("add-ons-button");
ok(addonsButton, "Add-ons button exists in Panel Menu");
addonsButton.click();
newTab = gBrowser.selectedTab;
await waitForCondition(() => gBrowser.currentURI &&
gBrowser.currentURI.spec == "about:addons");
let addonsPage = gBrowser.selectedBrowser.contentWindow.document.
getElementById("addons-page");
ok(addonsPage, "Add-ons page was opened");
});
add_task(async function asyncCleanup() {
+ CustomizableUI.reset();
BrowserTestUtils.addTab(gBrowser, initialLocation);
gBrowser.removeTab(gBrowser.selectedTab);
info("Tabs were restored");
});
--- a/browser/components/customizableui/test/browser_947914_button_copy.js
+++ b/browser/components/customizableui/test/browser_947914_button_copy.js
@@ -3,36 +3,36 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var initialLocation = gBrowser.currentURI.spec;
var globalClipboard;
add_task(async function() {
- await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
await BrowserTestUtils.withNewTab({gBrowser, url: "about:blank"}, async function() {
info("Check copy button existence and functionality");
+ CustomizableUI.addWidgetToArea("edit-controls", CustomizableUI.AREA_FIXED_OVERFLOW_PANEL);
let testText = "copy text test";
gURLBar.focus();
info("The URL bar was focused");
- await PanelUI.show();
+ await document.getElementById("nav-bar").overflowable.show();
info("Menu panel was opened");
let copyButton = document.getElementById("copy-button");
ok(copyButton, "Copy button exists in Panel Menu");
ok(copyButton.getAttribute("disabled"), "Copy button is initially disabled");
// copy text from URL bar
gURLBar.value = testText;
gURLBar.focus();
gURLBar.select();
- await PanelUI.show();
+ await document.getElementById("nav-bar").overflowable.show();
info("Menu panel was opened");
ok(!copyButton.hasAttribute("disabled"), "Copy button is enabled when selecting");
copyButton.click();
is(gURLBar.value, testText, "Selected text is unaltered when clicking copy");
// check that the text was added to the clipboard
@@ -51,10 +51,11 @@ add_task(async function() {
str.value.QueryInterface(Ci.nsISupportsString);
clipboardValue = str.value.data;
}
is(clipboardValue, testText, "Data was copied to the clipboard.");
});
});
registerCleanupFunction(function cleanup() {
+ CustomizableUI.reset();
Services.clipboard.emptyClipboard(globalClipboard);
});
--- a/browser/components/customizableui/test/browser_947914_button_cut.js
+++ b/browser/components/customizableui/test/browser_947914_button_cut.js
@@ -3,35 +3,35 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var initialLocation = gBrowser.currentURI.spec;
var globalClipboard;
add_task(async function() {
- await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
await BrowserTestUtils.withNewTab({gBrowser, url: "about:blank"}, async function() {
info("Check cut button existence and functionality");
+ CustomizableUI.addWidgetToArea("edit-controls", CustomizableUI.AREA_FIXED_OVERFLOW_PANEL);
let testText = "cut text test";
gURLBar.focus();
- await PanelUI.show();
+ await document.getElementById("nav-bar").overflowable.show();
info("Menu panel was opened");
let cutButton = document.getElementById("cut-button");
ok(cutButton, "Cut button exists in Panel Menu");
ok(cutButton.hasAttribute("disabled"), "Cut button is disabled");
// cut text from URL bar
gURLBar.value = testText;
gURLBar.focus();
gURLBar.select();
- await PanelUI.show();
+ await document.getElementById("nav-bar").overflowable.show();
info("Menu panel was opened");
ok(!cutButton.hasAttribute("disabled"), "Cut button is enabled when selecting");
cutButton.click();
is(gURLBar.value, "", "Selected text is removed from source when clicking on cut");
// check that the text was added to the clipboard
let clipboard = Services.clipboard;
@@ -49,10 +49,11 @@ add_task(async function() {
str.value.QueryInterface(Ci.nsISupportsString);
clipboardValue = str.value.data;
}
is(clipboardValue, testText, "Data was copied to the clipboard.");
});
});
registerCleanupFunction(function cleanup() {
+ CustomizableUI.reset();
Services.clipboard.emptyClipboard(globalClipboard);
});
--- a/browser/components/customizableui/test/browser_947914_button_find.js
+++ b/browser/components/customizableui/test/browser_947914_button_find.js
@@ -1,19 +1,20 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
add_task(async function() {
- await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
info("Check find button existence and functionality");
+ CustomizableUI.addWidgetToArea("find-button", CustomizableUI.AREA_FIXED_OVERFLOW_PANEL);
+ registerCleanupFunction(() => CustomizableUI.reset());
- await PanelUI.show();
+ await document.getElementById("nav-bar").overflowable.show();
info("Menu panel was opened");
let findButton = document.getElementById("find-button");
ok(findButton, "Find button exists in Panel Menu");
findButton.click();
ok(!gFindBar.hasAttribute("hidden"), "Findbar opened successfully");
--- a/browser/components/customizableui/test/browser_947914_button_history.js
+++ b/browser/components/customizableui/test/browser_947914_button_history.js
@@ -1,27 +1,28 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
add_task(async function() {
- await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
info("Check history button existence and functionality");
+ CustomizableUI.addWidgetToArea("history-panelmenu", CustomizableUI.AREA_FIXED_OVERFLOW_PANEL);
+ registerCleanupFunction(() => CustomizableUI.reset());
- await PanelUI.show();
+ await document.getElementById("nav-bar").overflowable.show();
info("Menu panel was opened");
let historyButton = document.getElementById("history-panelmenu");
ok(historyButton, "History button appears in Panel Menu");
let historyPanel = document.getElementById("PanelUI-history");
let promise = BrowserTestUtils.waitForEvent(historyPanel, "ViewShown");
historyButton.click();
await promise;
ok(historyPanel.getAttribute("current"), "History Panel is in view");
- let panelHiddenPromise = promisePanelHidden(window);
- PanelUI.hide();
+ let panelHiddenPromise = promiseOverflowHidden(window);
+ document.getElementById("widget-overflow").hidePopup();
await panelHiddenPromise
info("Menu panel was closed");
});
--- a/browser/components/customizableui/test/browser_947914_button_newPrivateWindow.js
+++ b/browser/components/customizableui/test/browser_947914_button_newPrivateWindow.js
@@ -1,19 +1,20 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
add_task(async function() {
- await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
info("Check private browsing button existence and functionality");
+ CustomizableUI.addWidgetToArea("privatebrowsing-button", CustomizableUI.AREA_FIXED_OVERFLOW_PANEL);
+ registerCleanupFunction(() => CustomizableUI.reset());
- await PanelUI.show();
+ await document.getElementById("nav-bar").overflowable.show();
info("Menu panel was opened");
let windowWasHandled = false;
let privateWindow = null;
let observerWindowOpened = {
observe(aSubject, aTopic, aData) {
if (aTopic == "domwindowopened") {
--- a/browser/components/customizableui/test/browser_947914_button_newWindow.js
+++ b/browser/components/customizableui/test/browser_947914_button_newWindow.js
@@ -1,18 +1,20 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
add_task(async function() {
- await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
info("Check new window button existence and functionality");
- await PanelUI.show();
+ CustomizableUI.addWidgetToArea("new-window-button", CustomizableUI.AREA_FIXED_OVERFLOW_PANEL);
+ registerCleanupFunction(() => CustomizableUI.reset());
+
+ await document.getElementById("nav-bar").overflowable.show();
info("Menu panel was opened");
let windowWasHandled = false;
let newWindow = null;
let observerWindowOpened = {
observe(aSubject, aTopic, aData) {
if (aTopic == "domwindowopened") {
--- a/browser/components/customizableui/test/browser_947914_button_paste.js
+++ b/browser/components/customizableui/test/browser_947914_button_paste.js
@@ -3,24 +3,24 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var initialLocation = gBrowser.currentURI.spec;
var globalClipboard;
add_task(async function() {
- await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
await BrowserTestUtils.withNewTab({gBrowser, url: "about:blank"}, async function() {
+ CustomizableUI.addWidgetToArea("edit-controls", CustomizableUI.AREA_FIXED_OVERFLOW_PANEL);
info("Check paste button existence and functionality");
let clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"].getService(Ci.nsIClipboardHelper);
globalClipboard = Services.clipboard.kGlobalClipboard;
- await PanelUI.show();
+ await document.getElementById("nav-bar").overflowable.show();
info("Menu panel was opened");
let pasteButton = document.getElementById("paste-button");
ok(pasteButton, "Paste button exists in Panel Menu");
// add text to clipboard
let text = "Sample text for testing";
clipboard.copyString(text);
@@ -33,10 +33,11 @@ add_task(async function() {
ok(!pasteButton.hasAttribute("disabled"), "Paste button is enabled");
pasteButton.click();
is(gURLBar.value, text, "Text pasted successfully");
});
});
registerCleanupFunction(function cleanup() {
+ CustomizableUI.reset();
Services.clipboard.emptyClipboard(globalClipboard);
});
--- a/browser/components/customizableui/test/browser_947914_button_print.js
+++ b/browser/components/customizableui/test/browser_947914_button_print.js
@@ -2,34 +2,35 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const isOSX = (Services.appinfo.OS === "Darwin");
add_task(async function() {
- await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
+ CustomizableUI.addWidgetToArea("print-button", CustomizableUI.AREA_FIXED_OVERFLOW_PANEL);
+ registerCleanupFunction(() => CustomizableUI.reset());
await BrowserTestUtils.withNewTab({
gBrowser,
url: "http://example.com/",
}, async function() {
info("Check print button existence and functionality");
- await PanelUI.show();
+ await document.getElementById("nav-bar").overflowable.show();
info("Menu panel was opened");
await waitForCondition(() => document.getElementById("print-button") != null);
let printButton = document.getElementById("print-button");
ok(printButton, "Print button exists in Panel Menu");
if (isOSX) {
- let panelHiddenPromise = promisePanelHidden(window);
- PanelUI.hide();
+ let panelHiddenPromise = promiseOverflowHidden(window);
+ document.getElementById("widget-overflow").hidePopup();
await panelHiddenPromise;
info("Menu panel was closed");
} else {
printButton.click();
await waitForCondition(() => gInPrintPreviewMode);
ok(gInPrintPreviewMode, "Entered print preview mode");
deleted file mode 100644
--- a/browser/components/customizableui/test/browser_947914_button_savePage.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-add_task(async function() {
- await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
- info("Check save page button existence");
-
- await PanelUI.show();
- info("Menu panel was opened");
-
- let savePageButton = document.getElementById("save-page-button");
- ok(savePageButton, "Save Page button exists in Panel Menu");
-
- let panelHiddenPromise = promisePanelHidden(window);
- PanelUI.hide();
- await panelHiddenPromise;
- info("Menu panel was closed");
-});
--- a/browser/components/customizableui/test/browser_947914_button_zoomIn.js
+++ b/browser/components/customizableui/test/browser_947914_button_zoomIn.js
@@ -2,36 +2,38 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var initialPageZoom = ZoomManager.zoom;
add_task(async function() {
- await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
info("Check zoom in button existence and functionality");
is(initialPageZoom, 1, "Initial zoom factor should be 1");
- await PanelUI.show();
+ CustomizableUI.addWidgetToArea("zoom-controls", CustomizableUI.AREA_FIXED_OVERFLOW_PANEL);
+ registerCleanupFunction(() => CustomizableUI.reset());
+
+ await document.getElementById("nav-bar").overflowable.show();
info("Menu panel was opened");
let zoomInButton = document.getElementById("zoom-in-button");
ok(zoomInButton, "Zoom in button exists in Panel Menu");
zoomInButton.click();
let pageZoomLevel = parseInt(ZoomManager.zoom * 100);
let zoomResetButton = document.getElementById("zoom-reset-button");
let expectedZoomLevel = parseInt(zoomResetButton.getAttribute("label"), 10);
ok(pageZoomLevel > 100 && pageZoomLevel == expectedZoomLevel, "Page zoomed in correctly");
// close the Panel
- let panelHiddenPromise = promisePanelHidden(window);
- PanelUI.hide();
+ let panelHiddenPromise = promiseOverflowHidden(window);
+ document.getElementById("widget-overflow").hidePopup();
await panelHiddenPromise;
info("Menu panel was closed");
});
add_task(async function asyncCleanup() {
// reset zoom level
ZoomManager.zoom = initialPageZoom;
info("Zoom level was restored");
--- a/browser/components/customizableui/test/browser_947914_button_zoomOut.js
+++ b/browser/components/customizableui/test/browser_947914_button_zoomOut.js
@@ -2,37 +2,39 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var initialPageZoom = ZoomManager.zoom;
add_task(async function() {
- await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
info("Check zoom out button existence and functionality");
is(initialPageZoom, 1, "Initial zoom factor should be 1");
- await PanelUI.show();
+ CustomizableUI.addWidgetToArea("zoom-controls", CustomizableUI.AREA_FIXED_OVERFLOW_PANEL);
+ registerCleanupFunction(() => CustomizableUI.reset());
+
+ await document.getElementById("nav-bar").overflowable.show();
info("Menu panel was opened");
let zoomOutButton = document.getElementById("zoom-out-button");
ok(zoomOutButton, "Zoom out button exists in Panel Menu");
zoomOutButton.click();
let pageZoomLevel = Math.round(ZoomManager.zoom * 100);
let zoomResetButton = document.getElementById("zoom-reset-button");
let expectedZoomLevel = parseInt(zoomResetButton.getAttribute("label"), 10);
ok(pageZoomLevel < 100 && pageZoomLevel == expectedZoomLevel, "Page zoomed out correctly");
// close the panel
- let panelHiddenPromise = promisePanelHidden(window);
- PanelUI.hide();
+ let panelHiddenPromise = promiseOverflowHidden(window);
+ document.getElementById("widget-overflow").hidePopup();
await panelHiddenPromise;
info("Menu panel was closed");
});
add_task(async function asyncCleanup() {
// reset zoom level
ZoomManager.zoom = initialPageZoom;
info("Zoom level was restored");
--- a/browser/components/customizableui/test/browser_947914_button_zoomReset.js
+++ b/browser/components/customizableui/test/browser_947914_button_zoomReset.js
@@ -2,39 +2,41 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var initialPageZoom = ZoomManager.zoom;
add_task(async function() {
- await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
info("Check zoom reset button existence and functionality");
is(initialPageZoom, 1, "Page zoom reset correctly");
ZoomManager.zoom = 0.5;
- await PanelUI.show();
+ CustomizableUI.addWidgetToArea("zoom-controls", CustomizableUI.AREA_FIXED_OVERFLOW_PANEL);
+ registerCleanupFunction(() => CustomizableUI.reset());
+
+ await document.getElementById("nav-bar").overflowable.show();
info("Menu panel was opened");
let zoomResetButton = document.getElementById("zoom-reset-button");
ok(zoomResetButton, "Zoom reset button exists in Panel Menu");
zoomResetButton.click();
await new Promise(SimpleTest.executeSoon);
let pageZoomLevel = Math.floor(ZoomManager.zoom * 100);
let expectedZoomLevel = 100;
let buttonZoomLevel = parseInt(zoomResetButton.getAttribute("label"), 10);
is(pageZoomLevel, expectedZoomLevel, "Page zoom reset correctly");
is(pageZoomLevel, buttonZoomLevel, "Button displays the correct zoom level");
// close the panel
- let panelHiddenPromise = promisePanelHidden(window);
- PanelUI.hide();
+ let panelHiddenPromise = promiseOverflowHidden(window);
+ document.getElementById("widget-overflow").hidePopup();
await panelHiddenPromise;
info("Menu panel was closed");
});
add_task(async function asyncCleanup() {
// reset zoom level
ZoomManager.zoom = initialPageZoom;
info("Zoom level was restored");
--- a/browser/components/customizableui/test/browser_967000_button_charEncoding.js
+++ b/browser/components/customizableui/test/browser_967000_button_charEncoding.js
@@ -2,38 +2,38 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const TEST_PAGE = "http://mochi.test:8888/browser/browser/components/customizableui/test/support/test_967000_charEncoding_page.html";
add_task(async function() {
- await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
info("Check Character Encoding button functionality");
// add the Character Encoding button to the panel
CustomizableUI.addWidgetToArea("characterencoding-button",
- CustomizableUI.AREA_PANEL);
+ CustomizableUI.AREA_FIXED_OVERFLOW_PANEL);
- // check the button's functionality
- await PanelUI.show();
+ registerCleanupFunction(() => CustomizableUI.reset());
+
+ await document.getElementById("nav-bar").overflowable.show();
let charEncodingButton = document.getElementById("characterencoding-button");
ok(charEncodingButton, "The Character Encoding button was added to the Panel Menu");
is(charEncodingButton.getAttribute("disabled"), "true",
"The Character encoding button is initially disabled");
- let panelHidePromise = promisePanelHidden(window);
- PanelUI.hide();
+ let panelHidePromise = promiseOverflowHidden(window);
+ await document.getElementById("nav-bar").overflowable._panel.hidePopup();
await panelHidePromise;
let newTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_PAGE, true, true);
- await PanelUI.show();
+ await document.getElementById("nav-bar").overflowable.show();
ok(!charEncodingButton.hasAttribute("disabled"), "The Character encoding button gets enabled");
let characterEncodingView = document.getElementById("PanelUI-characterEncodingView");
let subviewShownPromise = subviewShown(characterEncodingView);
charEncodingButton.click();
await subviewShownPromise;
ok(characterEncodingView.hasAttribute("current"), "The Character encoding panel is displayed");
@@ -44,18 +44,18 @@ add_task(async function() {
let checkedButtons = characterEncodingView.querySelectorAll("toolbarbutton[checked='true']");
is(checkedButtons.length, 2, "There should be 2 checked items (1 charset, 1 detector).");
is(checkedButtons[0].getAttribute("label"), "Unicode", "The unicode encoding is correctly selected");
is(characterEncodingView.querySelectorAll("#PanelUI-characterEncodingView-autodetect toolbarbutton[checked='true']").length,
1,
"There should be 1 checked detector.");
- panelHidePromise = promisePanelHidden(window);
- PanelUI.hide();
+ panelHidePromise = promiseOverflowHidden(window);
+ await document.getElementById("nav-bar").overflowable._panel.hidePopup();
await panelHidePromise;
await BrowserTestUtils.removeTab(newTab);
});
add_task(async function asyncCleanup() {
// reset the panel to the default state
await resetCustomization();
--- a/browser/components/customizableui/test/browser_967000_button_feeds.js
+++ b/browser/components/customizableui/test/browser_967000_button_feeds.js
@@ -6,51 +6,50 @@
const TEST_PAGE = "http://mochi.test:8888/browser/browser/components/customizableui/test/support/feeds_test_page.html";
const TEST_FEED = "http://mochi.test:8888/browser/browser/components/customizableui/test/support/test-feed.xml"
var newTab = null;
var initialLocation = gBrowser.currentURI.spec;
add_task(async function() {
- await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
info("Check Subscribe button functionality");
// add the Subscribe button to the panel
CustomizableUI.addWidgetToArea("feed-button",
- CustomizableUI.AREA_PANEL);
+ CustomizableUI.AREA_FIXED_OVERFLOW_PANEL);
// check the button's functionality
- await PanelUI.show();
+ await document.getElementById("nav-bar").overflowable.show();
let feedButton = document.getElementById("feed-button");
ok(feedButton, "The Subscribe button was added to the Panel Menu");
is(feedButton.getAttribute("disabled"), "true", "The Subscribe button is initially disabled");
- let panelHidePromise = promisePanelHidden(window);
- PanelUI.hide();
+ let panelHidePromise = promiseOverflowHidden(window);
+ await document.getElementById("nav-bar").overflowable._panel.hidePopup();
await panelHidePromise;
newTab = gBrowser.selectedTab;
await promiseTabLoadEvent(newTab, TEST_PAGE);
await PanelUI.show();
await waitForCondition(() => !feedButton.hasAttribute("disabled"));
ok(!feedButton.hasAttribute("disabled"), "The Subscribe button gets enabled");
feedButton.click();
await promiseTabLoadEvent(newTab, TEST_FEED);
is(gBrowser.currentURI.spec, TEST_FEED, "Subscribe page opened");
- ok(!isPanelUIOpen(), "Panel is closed");
+ ok(!isOverflowOpen(), "Panel is closed");
- if (isPanelUIOpen()) {
- panelHidePromise = promisePanelHidden(window);
- PanelUI.hide();
+ if (isOverflowOpen()) {
+ panelHidePromise = promiseOverflowHidden(window);
+ await document.getElementById("nav-bar").overflowable._panel.hidePopup();
await panelHidePromise;
}
});
add_task(async function asyncCleanup() {
// reset the panel UI to the default state
await resetCustomization();
ok(CustomizableUI.inDefaultState, "The UI is in default state again.");
--- a/browser/components/customizableui/test/browser_973641_button_addon.js
+++ b/browser/components/customizableui/test/browser_973641_button_addon.js
@@ -3,18 +3,16 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const kButton = "test_button_for_addon";
var initialLocation = gBrowser.currentURI.spec;
add_task(async function() {
- await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
-
info("Check addon button functionality");
// create mocked addon button on the navigation bar
let widgetSpec = {
id: kButton,
type: "button",
onClick() {
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:addons");
@@ -28,22 +26,22 @@ add_task(async function() {
let navBar = document.getElementById("nav-bar");
ok(addonButton, "Addon button exists");
ok(navBar.contains(addonButton), "Addon button is in the navbar");
await checkButtonFunctionality(addonButton);
resetTabs();
// move the add-on button in the Panel Menu
- CustomizableUI.addWidgetToArea(kButton, CustomizableUI.AREA_PANEL);
+ CustomizableUI.addWidgetToArea(kButton, CustomizableUI.AREA_FIXED_OVERFLOW_PANEL);
ok(!navBar.contains(addonButton), "Addon button was removed from the browser bar");
// check the addon button's functionality in the Panel Menu
- await PanelUI.show();
- var panelMenu = document.getElementById("PanelUI-mainView");
+ await document.getElementById("nav-bar").overflowable.show();
+ var panelMenu = document.getElementById("widget-overflow-mainView");
let addonButtonInPanel = panelMenu.getElementsByAttribute("id", kButton);
ok(panelMenu.contains(addonButton), "Addon button was added to the Panel Menu");
await checkButtonFunctionality(addonButtonInPanel[0]);
});
add_task(async function asyncCleanup() {
resetTabs();
--- a/browser/components/customizableui/test/head.js
+++ b/browser/components/customizableui/test/head.js
@@ -322,16 +322,21 @@ function promisePanelElementHidden(win,
aPanel.addEventListener("popuphidden", onPanelClose);
});
}
function isPanelUIOpen() {
return PanelUI.panel.state == "open" || PanelUI.panel.state == "showing";
}
+function isOverflowOpen() {
+ let panel = document.getElementById("widget-overflow");
+ return panel.state == "open" || panel.state == "showing";
+}
+
function subviewShown(aSubview) {
return new Promise((resolve, reject) => {
let win = aSubview.ownerGlobal;
let timeoutId = win.setTimeout(() => {
reject("Subview (" + aSubview.id + ") did not show within 20 seconds.");
}, 20000);
function onViewShowing(e) {
aSubview.removeEventListener("ViewShowing", onViewShowing);