summaryrefslogtreecommitdiffstats
path: root/browser/base/content/test/tabs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /browser/base/content/test/tabs
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/base/content/test/tabs')
-rw-r--r--browser/base/content/test/tabs/browser.toml1
-rw-r--r--browser/base/content/test/tabs/browser_close_during_beforeunload.js9
-rw-r--r--browser/base/content/test/tabs/browser_multiselect_tabs_bookmark.js10
-rw-r--r--browser/base/content/test/tabs/browser_tab_preview.js71
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",
+ });
});