summaryrefslogtreecommitdiffstats
path: root/toolkit/components/prompts/test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /toolkit/components/prompts/test
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/prompts/test')
-rw-r--r--toolkit/components/prompts/test/chromeScript.js49
-rw-r--r--toolkit/components/prompts/test/prompt_common.js10
-rw-r--r--toolkit/components/prompts/test/test_bug619644.html2
-rw-r--r--toolkit/components/prompts/test/test_subresources_prompts.html7
4 files changed, 6 insertions, 62 deletions
diff --git a/toolkit/components/prompts/test/chromeScript.js b/toolkit/components/prompts/test/chromeScript.js
index 9a6bacc8a4..f873c5d04b 100644
--- a/toolkit/components/prompts/test/chromeScript.js
+++ b/toolkit/components/prompts/test/chromeScript.js
@@ -31,52 +31,6 @@ async function handlePromptWhenItAppears(action, modalType, isSelect) {
}
}
-function checkTabModal(prompt, browser) {
- let doc = browser.ownerDocument;
-
- let { bottom: toolboxBottom } = doc
- .getElementById("navigator-toolbox")
- .getBoundingClientRect();
-
- let { mainContainer } = prompt.ui;
-
- let { x, y } = mainContainer.getBoundingClientRect();
- ok(y > 0, "Container should have y > 0");
- // Inset by 1px since the corner point doesn't return the frame due to the
- // border-radius.
- is(
- doc.elementFromPoint(x + 1, y + 1).parentNode,
- mainContainer,
- "Check tabmodalprompt is visible"
- );
-
- info("Click to the left of the dialog over the content area");
- isnot(
- doc.elementFromPoint(x - 10, y + 50),
- browser,
- "Check clicks on the content area don't go to the browser"
- );
- is(
- doc.elementFromPoint(x - 10, y + 50),
- prompt.element,
- "Check clicks on the content area go to the prompt dialog background"
- );
-
- if (prompt.args.modalType == Ci.nsIPrompt.MODAL_TYPE_TAB) {
- ok(
- y <= toolboxBottom - 5,
- "Dialog should overlap the toolbox by at least 5px"
- );
- } else {
- ok(y >= toolboxBottom, "Dialog must not overlap with toolbox.");
- }
-
- ok(
- browser.hasAttribute("tabmodalPromptShowing"),
- "Check browser has @tabmodalPromptShowing"
- );
-}
-
async function handlePrompt(action, modalType, isSelect) {
let ui;
let browserWin = Services.wm.getMostRecentWindow("navigator:browser");
@@ -142,8 +96,7 @@ function getPromptState(ui) {
state.checkHidden = ui.checkboxContainer.hidden;
state.checkMsg = state.checkHidden ? "" : ui.checkbox.label;
state.checked = state.checkHidden ? false : ui.checkbox.checked;
- // TabModalPrompts don't have an infoIcon
- state.iconClass = ui.infoIcon ? ui.infoIcon.className : null;
+ state.iconClass = ui.infoIcon.className;
state.textValue = ui.loginTextbox.value;
state.passValue = ui.password1Textbox.value;
diff --git a/toolkit/components/prompts/test/prompt_common.js b/toolkit/components/prompts/test/prompt_common.js
index 8d583060da..25b0a4c438 100644
--- a/toolkit/components/prompts/test/prompt_common.js
+++ b/toolkit/components/prompts/test/prompt_common.js
@@ -17,10 +17,6 @@ function propBagToObject(bag) {
}
var modalType;
-var tabSubDialogsEnabled = SpecialPowers.Services.prefs.getBoolPref(
- "prompts.tabChromePromptSubDialog",
- false
-);
var isSelectDialog = false;
var isOSX = "nsILocalFileMac" in SpecialPowers.Ci;
var isE10S = SpecialPowers.Services.appinfo.processType == 2;
@@ -160,7 +156,7 @@ function onloadPromiseFor(id) {
return new Promise(resolve => {
iframe.addEventListener(
"load",
- function (e) {
+ function () {
resolve(true);
},
{ once: true }
@@ -227,7 +223,7 @@ function checkPromptState(promptState, expectedState) {
is(promptState.checked, expectedState.checked, "Checking checkbox checked");
if (
modalType === Ci.nsIPrompt.MODAL_TYPE_WINDOW ||
- (modalType === Ci.nsIPrompt.MODAL_TYPE_TAB && tabSubDialogsEnabled)
+ modalType === Ci.nsIPrompt.MODAL_TYPE_TAB
) {
is(
promptState.iconClass,
@@ -366,7 +362,7 @@ function PrompterProxy(chromeScript) {
return new Proxy(
{},
{
- get(target, prop, receiver) {
+ get(target, prop) {
return (...args) => {
// Array of indices of out/inout params to copy from the parent back to the caller.
let outParams = [];
diff --git a/toolkit/components/prompts/test/test_bug619644.html b/toolkit/components/prompts/test/test_bug619644.html
index 2b424c71a6..03650d6d6d 100644
--- a/toolkit/components/prompts/test/test_bug619644.html
+++ b/toolkit/components/prompts/test/test_bug619644.html
@@ -31,7 +31,7 @@ function inittest() {
SimpleTest.waitForExplicitFinish();
}
-function runtest(e) {
+function runtest() {
modalType = Ci.nsIPrompt.MODAL_TYPE_CONTENT;
window.removeEventListener("message", runtest);
diff --git a/toolkit/components/prompts/test/test_subresources_prompts.html b/toolkit/components/prompts/test/test_subresources_prompts.html
index b71ad0694e..134af95c6d 100644
--- a/toolkit/components/prompts/test/test_subresources_prompts.html
+++ b/toolkit/components/prompts/test/test_subresources_prompts.html
@@ -33,11 +33,6 @@ var iframe1Loaded = onloadPromiseFor("iframe_diff_origin");
var iframe2Loaded = onloadPromiseFor("iframe_same_origin");
var iframe_prompt = document.getElementById("iframe_prompt");
-// Depending on pref state we either show auth prompts as windows or on tab level.
-let authPromptModalType = SpecialPowers.Services.prefs.getIntPref(
- "prompts.modalType.httpAuth"
-);
-
add_task(async function runTest() {
modalType = Ci.nsIPrompt.MODAL_TYPE_CONTENT;
@@ -104,7 +99,7 @@ add_task(async function runTestAuth() {
// cross-origin subresources load
// Let prompt_common know what kind of modal type is enabled for auth prompts.
- modalType = authPromptModalType;
+ modalType = Ci.nsIPrompt.MODAL_TYPE_TAB;
let state, action;