diff options
Diffstat (limited to 'browser/components/customizableui/test')
5 files changed, 58 insertions, 26 deletions
diff --git a/browser/components/customizableui/test/browser_PanelMultiView_keyboard.js b/browser/components/customizableui/test/browser_PanelMultiView_keyboard.js index b41fc2ef23..d8c687d88a 100644 --- a/browser/components/customizableui/test/browser_PanelMultiView_keyboard.js +++ b/browser/components/customizableui/test/browser_PanelMultiView_keyboard.js @@ -150,7 +150,6 @@ add_setup(async function () { gLink.innerText = "gLink"; gLink.id = "gLink"; gMainView.appendChild(gLink); - await window.ensureCustomElements("moz-toggle"); gToggle = document.createElement("moz-toggle"); gToggle.label = "Test label"; gMainView.appendChild(gToggle); diff --git a/browser/components/customizableui/test/browser_ctrl_click_panel_opening.js b/browser/components/customizableui/test/browser_ctrl_click_panel_opening.js index 9377c28950..92528f2537 100644 --- a/browser/components/customizableui/test/browser_ctrl_click_panel_opening.js +++ b/browser/components/customizableui/test/browser_ctrl_click_panel_opening.js @@ -13,8 +13,8 @@ add_task(async function test_appMenu_mainView() { return; } - let mainViewID = "appMenu-protonMainView"; - const mainView = document.getElementById(mainViewID); + let mainViewID = "appMenu-mainView"; + const mainView = PanelMultiView.getViewNode(document, mainViewID); let shownPromise = BrowserTestUtils.waitForEvent(mainView, "ViewShown"); // Should still open the panel when Ctrl key is pressed. diff --git a/browser/components/customizableui/test/browser_panelUINotifications_bannerVisibility.js b/browser/components/customizableui/test/browser_panelUINotifications_bannerVisibility.js index df856dd4cf..686d600601 100644 --- a/browser/components/customizableui/test/browser_panelUINotifications_bannerVisibility.js +++ b/browser/components/customizableui/test/browser_panelUINotifications_bannerVisibility.js @@ -24,7 +24,7 @@ add_task(async function testBannerVisibilityBeforeOpen() { menuButton.click(); await shown; - let banner = newWin.document.getElementById("appMenu-proton-update-banner"); + let banner = newWin.document.getElementById("appMenu-update-banner"); let labelPromise = BrowserTestUtils.waitForMutationCondition( banner, @@ -62,7 +62,7 @@ add_task(async function testBannerVisibilityDuringOpen() { menuButton.click(); await shown; - let banner = newWin.document.getElementById("appMenu-proton-update-banner"); + let banner = newWin.document.getElementById("appMenu-update-banner"); ok( !banner.hasAttribute("label"), "Update banner shouldn't contain text before notification" @@ -109,7 +109,7 @@ add_task(async function testBannerVisibilityAfterClose() { ok(newWin.PanelUI.mainView.hasAttribute("visible")); - let banner = newWin.document.getElementById("appMenu-proton-update-banner"); + let banner = newWin.document.getElementById("appMenu-update-banner"); ok(banner.hidden, "Update banner should be hidden before notification"); ok( diff --git a/browser/components/customizableui/test/browser_sidebar_toggle.js b/browser/components/customizableui/test/browser_sidebar_toggle.js index 5742f368ee..a063cc26cf 100644 --- a/browser/components/customizableui/test/browser_sidebar_toggle.js +++ b/browser/components/customizableui/test/browser_sidebar_toggle.js @@ -9,7 +9,7 @@ registerCleanupFunction(async function () { // Ensure sidebar is hidden after each test: if (!document.getElementById("sidebar-box").hidden) { - SidebarUI.hide(); + SidebarController.hide(); } }); @@ -21,14 +21,14 @@ var showSidebar = async function (win = window) { ); EventUtils.synthesizeMouseAtCenter(button, {}, win); await sidebarFocusedPromise; - ok(win.SidebarUI.isOpen, "Sidebar is opened"); + ok(win.SidebarController.isOpen, "Sidebar is opened"); ok(button.hasAttribute("checked"), "Toolbar button is checked"); }; var hideSidebar = async function (win = window) { let button = win.document.getElementById("sidebar-button"); EventUtils.synthesizeMouseAtCenter(button, {}, win); - ok(!win.SidebarUI.isOpen, "Sidebar is closed"); + ok(!win.SidebarController.isOpen, "Sidebar is closed"); ok(!button.hasAttribute("checked"), "Toolbar button isn't checked"); }; @@ -37,18 +37,26 @@ add_task(async function () { CustomizableUI.addWidgetToArea("sidebar-button", "nav-bar"); await showSidebar(); - is(SidebarUI.currentID, "viewBookmarksSidebar", "Default sidebar selected"); - await SidebarUI.show("viewHistorySidebar"); + is( + SidebarController.currentID, + "viewBookmarksSidebar", + "Default sidebar selected" + ); + await SidebarController.show("viewHistorySidebar"); await hideSidebar(); await showSidebar(); - is(SidebarUI.currentID, "viewHistorySidebar", "Selected sidebar remembered"); + is( + SidebarController.currentID, + "viewHistorySidebar", + "Selected sidebar remembered" + ); await hideSidebar(); let otherWin = await BrowserTestUtils.openNewBrowserWindow(); await showSidebar(otherWin); is( - otherWin.SidebarUI.currentID, + otherWin.SidebarController.currentID, "viewHistorySidebar", "Selected sidebar remembered across windows" ); diff --git a/browser/components/customizableui/test/browser_synced_tabs_menu.js b/browser/components/customizableui/test/browser_synced_tabs_menu.js index 33c8f6a845..c99223a80e 100644 --- a/browser/components/customizableui/test/browser_synced_tabs_menu.js +++ b/browser/components/customizableui/test/browser_synced_tabs_menu.js @@ -216,6 +216,17 @@ add_task(async function () { ok(button, "found the button"); await document.getElementById("nav-bar").overflowable.show(); + // Actually show the fxa view: + let shown = BrowserTestUtils.waitForEvent( + document.getElementById("PanelUI-remotetabs"), + "ViewShown" + ); + PanelUI.showSubView( + "PanelUI-remotetabs", + document.getElementById("sync-button") + ); + await shown; + let expectedUrl = "https://example.com/connect_another_device?context=" + "fx_desktop_v3&entrypoint=synced-tabs&service=sync&uid=uid&email=foo%40bar.com"; @@ -325,20 +336,28 @@ add_task(async function () { node = node.firstElementChild; is(node.getAttribute("itemtype"), "client", "node is a client entry"); is(node.textContent, "My Desktop", "correct client"); - // Next entry is the most-recent tab + // Next node is an hbox, that contains the tab and potentially + // a button for closing the tab remotely node = node.nextElementSibling; - is(node.getAttribute("itemtype"), "tab", "node is a tab"); - is(node.getAttribute("label"), "http://example.com/10"); + is(node.nodeName, "hbox"); + // Next entry is the most-recent tab + let childNode = node.firstElementChild; + is(childNode.getAttribute("itemtype"), "tab", "node is a tab"); + is(childNode.getAttribute("label"), "http://example.com/10"); // Next entry is the next-most-recent tab node = node.nextElementSibling; - is(node.getAttribute("itemtype"), "tab", "node is a tab"); - is(node.getAttribute("label"), "http://example.com/5"); + is(node.nodeName, "hbox"); + childNode = node.firstElementChild; + is(childNode.getAttribute("itemtype"), "tab", "node is a tab"); + is(childNode.getAttribute("label"), "http://example.com/5"); // Next entry is the least-recent tab from the first client. node = node.nextElementSibling; - is(node.getAttribute("itemtype"), "tab", "node is a tab"); - is(node.getAttribute("label"), "http://example.com/1"); + is(node.nodeName, "hbox"); + childNode = node.firstElementChild; + is(childNode.getAttribute("itemtype"), "tab", "node is a tab"); + is(childNode.getAttribute("label"), "http://example.com/1"); node = node.nextElementSibling; is(node, null, "no more siblings"); @@ -357,8 +376,10 @@ add_task(async function () { is(node.textContent, "My Other Desktop", "correct client"); // Its single tab node = node.nextElementSibling; - is(node.getAttribute("itemtype"), "tab", "node is a tab"); - is(node.getAttribute("label"), "http://example.com/6"); + is(node.nodeName, "hbox"); + childNode = node.firstElementChild; + is(childNode.getAttribute("itemtype"), "tab", "node is a tab"); + is(childNode.getAttribute("label"), "http://example.com/6"); node = node.nextElementSibling; is(node, null, "no more siblings"); @@ -468,14 +489,16 @@ add_task(async function () { is(node.textContent, "My Desktop", "correct client"); for (let i = 0; i < tabsShownCount; i++) { node = node.nextElementSibling; - is(node.getAttribute("itemtype"), "tab", "node is a tab"); + is(node.nodeName, "hbox"); + let childNode = node.firstElementChild; + is(childNode.getAttribute("itemtype"), "tab", "node is a tab"); is( - node.getAttribute("label"), + childNode.getAttribute("label"), "Tab #" + (i + 1), "the tab is the correct one" ); is( - node.getAttribute("targetURI"), + childNode.getAttribute("targetURI"), SAMPLE_TAB_URL, "url is the correct one" ); @@ -498,7 +521,9 @@ add_task(async function () { async function checkCanOpenURL() { let tabList = document.getElementById("PanelUI-remotetabs-tabslist"); - let node = tabList.firstElementChild.firstElementChild.nextElementSibling; + let node = + tabList.firstElementChild.firstElementChild.nextElementSibling + .firstElementChild; let promiseTabOpened = BrowserTestUtils.waitForLocationChange( gBrowser, SAMPLE_TAB_URL |