summaryrefslogtreecommitdiffstats
path: root/docshell/test/browser
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /docshell/test/browser
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-upstream/125.0.1.tar.xz
firefox-upstream/125.0.1.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'docshell/test/browser')
-rw-r--r--docshell/test/browser/Bug422543Child.sys.mjs2
-rw-r--r--docshell/test/browser/browser_browsingContext-02.js4
-rw-r--r--docshell/test/browser/browser_browsingContext-webProgress.js2
-rw-r--r--docshell/test/browser/browser_bug1206879.js4
-rw-r--r--docshell/test/browser/browser_bug1594938.js4
-rw-r--r--docshell/test/browser/browser_bug1691153.js2
-rw-r--r--docshell/test/browser/browser_bug422543.js2
-rw-r--r--docshell/test/browser/browser_bug554155.js2
-rw-r--r--docshell/test/browser/browser_bug670318.js2
-rw-r--r--docshell/test/browser/browser_bug673467.js2
-rw-r--r--docshell/test/browser/browser_bug852909.js4
-rw-r--r--docshell/test/browser/browser_click_link_within_view_source.js2
-rw-r--r--docshell/test/browser/browser_cross_process_csp_inheritance.js2
-rw-r--r--docshell/test/browser/browser_csp_sandbox_no_script_js_uri.js5
-rw-r--r--docshell/test/browser/browser_csp_uir.js4
-rw-r--r--docshell/test/browser/browser_data_load_inherit_csp.js4
-rw-r--r--docshell/test/browser/browser_onbeforeunload_navigation.js2
-rw-r--r--docshell/test/browser/browser_onbeforeunload_parent.js2
-rw-r--r--docshell/test/browser/browser_targetTopLevelLinkClicksToBlank.js4
-rw-r--r--docshell/test/browser/file_bug1328501_framescript.js4
-rw-r--r--docshell/test/browser/head_browser_onbeforeunload.js9
21 files changed, 31 insertions, 37 deletions
diff --git a/docshell/test/browser/Bug422543Child.sys.mjs b/docshell/test/browser/Bug422543Child.sys.mjs
index 524ac33ffd..5870c1d9a7 100644
--- a/docshell/test/browser/Bug422543Child.sys.mjs
+++ b/docshell/test/browser/Bug422543Child.sys.mjs
@@ -4,7 +4,7 @@ class SHistoryListener {
this.last = "initial";
}
- OnHistoryNewEntry(aNewURI) {
+ OnHistoryNewEntry() {
this.last = "newentry";
}
diff --git a/docshell/test/browser/browser_browsingContext-02.js b/docshell/test/browser/browser_browsingContext-02.js
index 8439b869b0..480e8f5494 100644
--- a/docshell/test/browser/browser_browsingContext-02.js
+++ b/docshell/test/browser/browser_browsingContext-02.js
@@ -178,7 +178,7 @@ add_task(async function () {
}
let topBrowserId = topBC.browserId;
- ok(topBrowserId > 0, "Should have a browser ID.");
+ Assert.greater(topBrowserId, 0, "Should have a browser ID.");
for (let [name, bc] of Object.entries({
first,
second,
@@ -193,7 +193,7 @@ add_task(async function () {
);
}
- ok(sixth.browserId > 0, "sixth should have a browserId.");
+ Assert.greater(sixth.browserId, 0, "sixth should have a browserId.");
isnot(
sixth.browserId,
topBrowserId,
diff --git a/docshell/test/browser/browser_browsingContext-webProgress.js b/docshell/test/browser/browser_browsingContext-webProgress.js
index 225242be60..d4b566d9d3 100644
--- a/docshell/test/browser/browser_browsingContext-webProgress.js
+++ b/docshell/test/browser/browser_browsingContext-webProgress.js
@@ -209,7 +209,7 @@ function waitForNextDocumentStart(webProgress) {
"nsIWebProgressListener",
"nsISupportsWeakReference",
]),
- onStateChange(progress, request, flags, status) {
+ onStateChange(progress, request, flags) {
if (
flags & Ci.nsIWebProgressListener.STATE_IS_DOCUMENT &&
flags & Ci.nsIWebProgressListener.STATE_START
diff --git a/docshell/test/browser/browser_bug1206879.js b/docshell/test/browser/browser_bug1206879.js
index 38e17633b8..114a3c448b 100644
--- a/docshell/test/browser/browser_bug1206879.js
+++ b/docshell/test/browser/browser_bug1206879.js
@@ -14,7 +14,7 @@ add_task(async function () {
let webprogress = content.docShell.QueryInterface(Ci.nsIWebProgress);
let locationChangeCount = 0;
let listener = {
- onLocationChange(aWebProgress, aRequest, aLocation, aFlags) {
+ onLocationChange(aWebProgress, aRequest, aLocation) {
info("onLocationChange: " + aLocation.spec);
locationChangeCount++;
this.resolve();
@@ -24,7 +24,7 @@ add_task(async function () {
"nsISupportsWeakReference",
]),
};
- let locationPromise = new Promise((resolve, reject) => {
+ let locationPromise = new Promise(resolve => {
listener.resolve = resolve;
});
webprogress.addProgressListener(
diff --git a/docshell/test/browser/browser_bug1594938.js b/docshell/test/browser/browser_bug1594938.js
index 569afe6901..30c8de5cb9 100644
--- a/docshell/test/browser/browser_bug1594938.js
+++ b/docshell/test/browser/browser_bug1594938.js
@@ -24,7 +24,7 @@ add_task(async function test() {
let listenerCalled = false;
let listener = {
- OnHistoryNewEntry: aNewURI => {},
+ OnHistoryNewEntry: () => {},
OnHistoryReload: () => {
listenerCalled = true;
this.content.setTimeout(() => {
@@ -64,7 +64,7 @@ add_task(async function test() {
let listenerCalled = false;
let listener = {
- OnHistoryNewEntry: aNewURI => {},
+ OnHistoryNewEntry: () => {},
OnHistoryReload: () => {
listenerCalled = true;
setTimeout(() => {
diff --git a/docshell/test/browser/browser_bug1691153.js b/docshell/test/browser/browser_bug1691153.js
index ed4969dae8..4e03ef29e2 100644
--- a/docshell/test/browser/browser_bug1691153.js
+++ b/docshell/test/browser/browser_bug1691153.js
@@ -28,7 +28,7 @@ add_task(async () => {
browser,
[],
async function () {
- let blobPromise = new Promise((resolve, reject) => {
+ let blobPromise = new Promise(resolve => {
content.addEventListener("message", event => {
if (event.data.bloburl) {
info("Sanity check: recvd blob URL as " + event.data.bloburl);
diff --git a/docshell/test/browser/browser_bug422543.js b/docshell/test/browser/browser_bug422543.js
index d2b6370d03..64160a0be5 100644
--- a/docshell/test/browser/browser_bug422543.js
+++ b/docshell/test/browser/browser_bug422543.js
@@ -172,7 +172,7 @@ class SHistoryListener {
this.last = "initial";
}
- OnHistoryNewEntry(aNewURI) {
+ OnHistoryNewEntry() {
this.last = "newentry";
}
diff --git a/docshell/test/browser/browser_bug554155.js b/docshell/test/browser/browser_bug554155.js
index 223f6241de..748d5056e7 100644
--- a/docshell/test/browser/browser_bug554155.js
+++ b/docshell/test/browser/browser_bug554155.js
@@ -6,7 +6,7 @@ add_task(async function test() {
let numLocationChanges = 0;
let listener = {
- onLocationChange(browser, webProgress, request, uri, flags) {
+ onLocationChange(browser, webProgress, request, uri) {
info("location change: " + (uri && uri.spec));
numLocationChanges++;
},
diff --git a/docshell/test/browser/browser_bug670318.js b/docshell/test/browser/browser_bug670318.js
index 6fad3d39e6..12854c0402 100644
--- a/docshell/test/browser/browser_bug670318.js
+++ b/docshell/test/browser/browser_bug670318.js
@@ -101,7 +101,7 @@ add_task(async function test() {
return new Promise(resolve => {
addEventListener(
"load",
- evt => {
+ () => {
let history = docShell.QueryInterface(
Ci.nsIWebNavigation
).sessionHistory;
diff --git a/docshell/test/browser/browser_bug673467.js b/docshell/test/browser/browser_bug673467.js
index 507410254c..6a771866dd 100644
--- a/docshell/test/browser/browser_bug673467.js
+++ b/docshell/test/browser/browser_bug673467.js
@@ -32,7 +32,7 @@ function test() {
let iframe = content.document.getElementById("iframe");
iframe.addEventListener(
"load",
- function listener(aEvent) {
+ function listener() {
// Wait for the iframe to load the new document, not about:blank.
if (!iframe.src) {
return;
diff --git a/docshell/test/browser/browser_bug852909.js b/docshell/test/browser/browser_bug852909.js
index 108baa0626..d148a830d5 100644
--- a/docshell/test/browser/browser_bug852909.js
+++ b/docshell/test/browser/browser_bug852909.js
@@ -10,7 +10,7 @@ function test() {
BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(image);
}
-function image(event) {
+function image() {
ok(
!gBrowser.selectedTab.mayEnableCharacterEncodingMenu,
"Docshell should say the menu should be disabled for images."
@@ -24,7 +24,7 @@ function image(event) {
BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(pdf);
}
-function pdf(event) {
+function pdf() {
ok(
!gBrowser.selectedTab.mayEnableCharacterEncodingMenu,
"Docshell should say the menu should be disabled for PDF.js."
diff --git a/docshell/test/browser/browser_click_link_within_view_source.js b/docshell/test/browser/browser_click_link_within_view_source.js
index 73542f977a..96082798b1 100644
--- a/docshell/test/browser/browser_click_link_within_view_source.js
+++ b/docshell/test/browser/browser_click_link_within_view_source.js
@@ -18,7 +18,7 @@ add_task(async function test_click_link_within_view_source() {
DUMMY_FILE_URI.append(DUMMY_FILE);
DUMMY_FILE_URI = Services.io.newFileURI(DUMMY_FILE_URI).spec;
- await BrowserTestUtils.withNewTab(TEST_FILE_URI, async function (aBrowser) {
+ await BrowserTestUtils.withNewTab(TEST_FILE_URI, async function () {
let tabSpec = gBrowser.selectedBrowser.currentURI.spec;
info("loading: " + tabSpec);
ok(
diff --git a/docshell/test/browser/browser_cross_process_csp_inheritance.js b/docshell/test/browser/browser_cross_process_csp_inheritance.js
index 76be61d0f9..beba5bae91 100644
--- a/docshell/test/browser/browser_cross_process_csp_inheritance.js
+++ b/docshell/test/browser/browser_cross_process_csp_inheritance.js
@@ -79,7 +79,7 @@ function verifyResult(
}
async function simulateCspInheritanceForNewTab(aTestName, aSamePID) {
- await BrowserTestUtils.withNewTab(TEST_URI, async function (browser) {
+ await BrowserTestUtils.withNewTab(TEST_URI, async function () {
// do some sanity checks
let currentURI = await getCurrentURI(gBrowser.selectedBrowser);
is(currentURI, TEST_URI, aTestName + ": correct test uri loaded");
diff --git a/docshell/test/browser/browser_csp_sandbox_no_script_js_uri.js b/docshell/test/browser/browser_csp_sandbox_no_script_js_uri.js
index d0b92084ec..b5ee19c98e 100644
--- a/docshell/test/browser/browser_csp_sandbox_no_script_js_uri.js
+++ b/docshell/test/browser/browser_csp_sandbox_no_script_js_uri.js
@@ -20,8 +20,9 @@ add_task(async function test_csp_sandbox_no_script_js_uri() {
let observerPromise = SpecialPowers.spawn(browser, [], () => {
return new Promise(resolve => {
SpecialPowers.addObserver(function obs(subject) {
- ok(
- subject == content,
+ Assert.equal(
+ subject,
+ content,
"Should block script spawned via javascript uri"
);
SpecialPowers.removeObserver(
diff --git a/docshell/test/browser/browser_csp_uir.js b/docshell/test/browser/browser_csp_uir.js
index 2eb36d3d4d..7a7bb55994 100644
--- a/docshell/test/browser/browser_csp_uir.js
+++ b/docshell/test/browser/browser_csp_uir.js
@@ -40,7 +40,7 @@ add_task(async function test_csp_inheritance_regular_click() {
});
add_task(async function test_csp_inheritance_ctrl_click() {
- await BrowserTestUtils.withNewTab(TEST_URI, async function (browser) {
+ await BrowserTestUtils.withNewTab(TEST_URI, async function () {
let loadPromise = BrowserTestUtils.waitForNewTab(
gBrowser,
RESULT_URI,
@@ -61,7 +61,7 @@ add_task(async function test_csp_inheritance_ctrl_click() {
add_task(
async function test_csp_inheritance_right_click_open_link_in_new_tab() {
- await BrowserTestUtils.withNewTab(TEST_URI, async function (browser) {
+ await BrowserTestUtils.withNewTab(TEST_URI, async function () {
let loadPromise = BrowserTestUtils.waitForNewTab(gBrowser, RESULT_URI);
// set the data href + simulate right-click open link in tab
BrowserTestUtils.waitForEvent(document, "popupshown", false, event => {
diff --git a/docshell/test/browser/browser_data_load_inherit_csp.js b/docshell/test/browser/browser_data_load_inherit_csp.js
index b2bc86e0ea..d638d601a3 100644
--- a/docshell/test/browser/browser_data_load_inherit_csp.js
+++ b/docshell/test/browser/browser_data_load_inherit_csp.js
@@ -59,7 +59,7 @@ add_task(async function test_data_csp_inheritance_regular_click() {
});
add_task(async function test_data_csp_inheritance_ctrl_click() {
- await BrowserTestUtils.withNewTab(HTML_URI, async function (browser) {
+ await BrowserTestUtils.withNewTab(HTML_URI, async function () {
let loadPromise = BrowserTestUtils.waitForNewTab(gBrowser, DATA_URI, true);
// set the data href + simulate ctrl+click
await setDataHrefOnLink(gBrowser.selectedBrowser, DATA_URI);
@@ -77,7 +77,7 @@ add_task(async function test_data_csp_inheritance_ctrl_click() {
add_task(
async function test_data_csp_inheritance_right_click_open_link_in_new_tab() {
- await BrowserTestUtils.withNewTab(HTML_URI, async function (browser) {
+ await BrowserTestUtils.withNewTab(HTML_URI, async function () {
let loadPromise = BrowserTestUtils.waitForNewTab(
gBrowser,
DATA_URI,
diff --git a/docshell/test/browser/browser_onbeforeunload_navigation.js b/docshell/test/browser/browser_onbeforeunload_navigation.js
index 23dc3b528e..ee49923e68 100644
--- a/docshell/test/browser/browser_onbeforeunload_navigation.js
+++ b/docshell/test/browser/browser_onbeforeunload_navigation.js
@@ -15,7 +15,7 @@ var tabStateListener = {
resolveLoad: null,
expectLoad: null,
- onStateChange(webprogress, request, flags, status) {
+ onStateChange(webprogress, request, flags) {
const WPL = Ci.nsIWebProgressListener;
if (flags & WPL.STATE_IS_WINDOW) {
if (flags & WPL.STATE_START) {
diff --git a/docshell/test/browser/browser_onbeforeunload_parent.js b/docshell/test/browser/browser_onbeforeunload_parent.js
index 72c5004334..f4441b38a7 100644
--- a/docshell/test/browser/browser_onbeforeunload_parent.js
+++ b/docshell/test/browser/browser_onbeforeunload_parent.js
@@ -22,7 +22,7 @@ add_task(async function () {
);
info(`Testing tab close from parent process`);
- await doTest(actions, -1, (tab, frames) => {
+ await doTest(actions, -1, tab => {
let eventLoopSpun = false;
Services.tm.dispatchToMainThread(() => {
eventLoopSpun = true;
diff --git a/docshell/test/browser/browser_targetTopLevelLinkClicksToBlank.js b/docshell/test/browser/browser_targetTopLevelLinkClicksToBlank.js
index 9d5a91bef9..3bd8815e81 100644
--- a/docshell/test/browser/browser_targetTopLevelLinkClicksToBlank.js
+++ b/docshell/test/browser/browser_targetTopLevelLinkClicksToBlank.js
@@ -246,7 +246,7 @@ add_task(async function skip_blank_target_for_some_loads() {
await SpecialPowers.spawn(currentBrowser, [TEST_PAGE], async newPageURL => {
let anchor = content.document.querySelector(`a[href=".."]`);
anchor.href = "javascript:void(0);";
- anchor.addEventListener("click", e => {
+ anchor.addEventListener("click", () => {
content.location.href = newPageURL;
});
let userInput = content.windowUtils.setHandlingUserInput(true);
@@ -268,7 +268,7 @@ add_task(async function skip_blank_target_for_some_loads() {
await SpecialPowers.spawn(currentBrowser, [TEST_PAGE], async newPageURL => {
let anchor = content.document.querySelector(`a[href=".."]`);
anchor.href = `javascript:"string-to-navigate-to"`;
- anchor.addEventListener("click", e => {
+ anchor.addEventListener("click", () => {
content.location.href = newPageURL;
});
let userInput = content.windowUtils.setHandlingUserInput(true);
diff --git a/docshell/test/browser/file_bug1328501_framescript.js b/docshell/test/browser/file_bug1328501_framescript.js
index 19c86c75e7..1f20f631df 100644
--- a/docshell/test/browser/file_bug1328501_framescript.js
+++ b/docshell/test/browser/file_bug1328501_framescript.js
@@ -4,13 +4,13 @@
addEventListener(
"frames-loaded",
- e => sendAsyncMessage("test:frames-loaded"),
+ () => sendAsyncMessage("test:frames-loaded"),
true,
true
);
let requestObserver = {
- observe(subject, topic, data) {
+ observe(subject, topic) {
if (topic == "http-on-opening-request") {
// Get DOMWindow on all child docshells to force about:blank
// content viewers being created.
diff --git a/docshell/test/browser/head_browser_onbeforeunload.js b/docshell/test/browser/head_browser_onbeforeunload.js
index 6bb334b793..3ba0bf54ac 100644
--- a/docshell/test/browser/head_browser_onbeforeunload.js
+++ b/docshell/test/browser/head_browser_onbeforeunload.js
@@ -4,19 +4,12 @@ const BASE_URL = "http://mochi.test:8888/browser/docshell/test/browser/";
const TEST_PAGE = BASE_URL + "file_onbeforeunload_0.html";
-const CONTENT_PROMPT_SUBDIALOG = Services.prefs.getBoolPref(
- "prompts.contentPromptSubDialog",
- false
-);
-
const { PromptTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/PromptTestUtils.sys.mjs"
);
async function withTabModalPromptCount(expected, task) {
- const DIALOG_TOPIC = CONTENT_PROMPT_SUBDIALOG
- ? "common-dialog-loaded"
- : "tabmodal-dialog-loaded";
+ const DIALOG_TOPIC = "common-dialog-loaded";
let count = 0;
function observer() {