diff options
Diffstat (limited to 'browser/base/content/test/tabs')
4 files changed, 63 insertions, 28 deletions
diff --git a/browser/base/content/test/tabs/browser.toml b/browser/base/content/test/tabs/browser.toml index 8008d70f0c..1b4a6900bf 100644 --- a/browser/base/content/test/tabs/browser.toml +++ b/browser/base/content/test/tabs/browser.toml @@ -236,7 +236,6 @@ support-files = [ ] ["browser_overflowScroll.js"] -fail-if = ["a11y_checks"] # Bugs 1854233 and 1873049 scrollbutton-down/up are not labeled skip-if = [ "win11_2009", # Bug 1797751 ] diff --git a/browser/base/content/test/tabs/browser_close_during_beforeunload.js b/browser/base/content/test/tabs/browser_close_during_beforeunload.js index 32bbb65b62..035884d713 100644 --- a/browser/base/content/test/tabs/browser_close_during_beforeunload.js +++ b/browser/base/content/test/tabs/browser_close_during_beforeunload.js @@ -4,14 +4,7 @@ // beforeunload confirmation ignores the beforeunload listener and // unblocks the original close call. -const CONTENT_PROMPT_SUBDIALOG = Services.prefs.getBoolPref( - "prompts.contentPromptSubDialog", - false -); - -const DIALOG_TOPIC = CONTENT_PROMPT_SUBDIALOG - ? "common-dialog-loaded" - : "tabmodal-dialog-loaded"; +const DIALOG_TOPIC = "common-dialog-loaded"; add_task(async function () { await SpecialPowers.pushPrefEnv({ diff --git a/browser/base/content/test/tabs/browser_multiselect_tabs_bookmark.js b/browser/base/content/test/tabs/browser_multiselect_tabs_bookmark.js index a24e72c0bb..cd3728edcd 100644 --- a/browser/base/content/test/tabs/browser_multiselect_tabs_bookmark.js +++ b/browser/base/content/test/tabs/browser_multiselect_tabs_bookmark.js @@ -48,11 +48,6 @@ add_task(async function test() { false, "Bookmark Selected Tabs is hidden" ); - is( - PlacesCommandHook.uniqueSelectedPages.length, - 1, - "No more than one unique selected page" - ); info("Add a different page to selection"); let tab4 = await addTab_example_com(); @@ -69,11 +64,6 @@ add_task(async function test() { false, "Bookmark Selected Tabs is hidden" ); - is( - PlacesCommandHook.uniqueSelectedPages.length, - 2, - "More than one unique selected page" - ); for (let tab of [tab1, tab2, tab3, tab4]) { BrowserTestUtils.removeTab(tab); diff --git a/browser/base/content/test/tabs/browser_tab_preview.js b/browser/base/content/test/tabs/browser_tab_preview.js index e3dd1b6842..718afbb940 100644 --- a/browser/base/content/test/tabs/browser_tab_preview.js +++ b/browser/base/content/test/tabs/browser_tab_preview.js @@ -34,7 +34,7 @@ add_setup(async function () { set: [ ["browser.tabs.cardPreview.enabled", true], ["browser.tabs.cardPreview.showThumbnails", false], - ["browser.tabs.cardPreview.delayMs", 0], + ["ui.tooltip.delay_ms", 0], ], }); }); @@ -46,7 +46,7 @@ add_setup(async function () { * 2. Tab preview card shows the correct preview for the tab being hovered * 3. Tab preview card is dismissed when the mouse leaves the tab bar */ -add_task(async () => { +add_task(async function hoverTests() { const tabUrl1 = "data:text/html,<html><head><title>First New Tab</title></head><body>Hello</body></html>"; const tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, tabUrl1); @@ -85,6 +85,11 @@ add_task(async () => { BrowserTestUtils.removeTab(tab1); BrowserTestUtils.removeTab(tab2); + + // Move the mouse outside of the tab strip. + EventUtils.synthesizeMouseAtCenter(document.documentElement, { + type: "mouseover", + }); }); /** @@ -92,7 +97,7 @@ add_task(async () => { * when browser.tabs.cardPreview.showThumbnails is set to true, * while the currently selected tab never displays a thumbnail in its preview. */ -add_task(async () => { +add_task(async function thumbnailTests() { await SpecialPowers.pushPrefEnv({ set: [["browser.tabs.cardPreview.showThumbnails", true]], }); @@ -120,15 +125,28 @@ add_task(async () => { "Tab2 (selected) does not contain thumbnail" ); + const previewHidden = BrowserTestUtils.waitForEvent( + document.getElementById("tabbrowser-tab-preview"), + "previewhidden" + ); + BrowserTestUtils.removeTab(tab1); BrowserTestUtils.removeTab(tab2); await SpecialPowers.popPrefEnv(); + + // Removing the tab should close the preview. + await previewHidden; + + // Move the mouse outside of the tab strip. + EventUtils.synthesizeMouseAtCenter(document.documentElement, { + type: "mouseover", + }); }); /** * Wheel events at the document-level of the window should hide the preview. */ -add_task(async () => { +add_task(async function wheelTests() { const tabUrl1 = "about:blank"; const tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, tabUrl1); const tabUrl2 = "about:blank"; @@ -141,14 +159,49 @@ add_task(async () => { document.getElementById("tabbrowser-tab-preview"), "previewhidden" ); - EventUtils.synthesizeMouse(tabs, 0, tabs.outerHeight + 1, { - wheel: true, - deltaY: -1, - deltaMode: WheelEvent.DOM_DELTA_LINE, - }); + + // Copied from apz_test_native_event_utils.js + let message = 0; + switch (AppConstants.platform) { + case "win": + message = 0x020a; + break; + case "linux": + message = 4; + break; + case "macosx": + message = 1; + break; + } + + let rect = tabs.getBoundingClientRect(); + let screenRect = window.windowUtils.toScreenRect( + rect.x, + rect.y, + rect.width, + rect.height + ); + window.windowUtils.sendNativeMouseScrollEvent( + screenRect.left, + screenRect.bottom, + message, + 0, + 3, + 0, + 0, + Ci.nsIDOMWindowUtils.MOUSESCROLL_SCROLL_LINES, + tabs, + null + ); + await previewHidden; BrowserTestUtils.removeTab(tab1); BrowserTestUtils.removeTab(tab2); await SpecialPowers.popPrefEnv(); + + // Move the mouse outside of the tab strip. + EventUtils.synthesizeMouseAtCenter(document.documentElement, { + type: "mouseover", + }); }); |