From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- .../downloads/test/unit/common_test_Download.js | 35 ++++++++++------------ toolkit/components/downloads/test/unit/head.js | 10 ++----- .../downloads/test/unit/test_DownloadHistory.js | 2 +- .../downloads/test/unit/test_DownloadLegacy.js | 2 ++ .../downloads/test/unit/test_DownloadList.js | 4 +-- .../downloads/test/unit/test_Download_noext_win.js | 2 +- 6 files changed, 24 insertions(+), 31 deletions(-) (limited to 'toolkit/components/downloads/test/unit') diff --git a/toolkit/components/downloads/test/unit/common_test_Download.js b/toolkit/components/downloads/test/unit/common_test_Download.js index 1360271686..c824030c56 100644 --- a/toolkit/components/downloads/test/unit/common_test_Download.js +++ b/toolkit/components/downloads/test/unit/common_test_Download.js @@ -85,7 +85,7 @@ async function expectNonZeroDownloadTargetSize(downloadTarget) { */ function waitForFileLaunched() { return new Promise(resolve => { - let waitFn = base => ({ + let waitFn = () => ({ launchFile(file, mimeInfo) { Integration.downloads.unregister(waitFn); if ( @@ -109,7 +109,7 @@ function waitForFileLaunched() { */ function waitForDirectoryShown() { return new Promise(resolve => { - let waitFn = base => ({ + let waitFn = () => ({ showContainingDirectory(path) { Integration.downloads.unregister(waitFn); resolve(path); @@ -716,7 +716,7 @@ add_task(async function test_empty_noprogress() { aResponse.setHeader("Content-Type", "text/plain", false); deferRequestReceived.resolve(); }, - function secondPart(aRequest, aResponse) {} + function secondPart() {} ); // Start the download, without allowing the request to finish. @@ -1892,7 +1892,7 @@ add_task(async function test_cancel_midway_restart_with_content_encoding() { * Download with parental controls enabled. */ add_task(async function test_blocked_parental_controls() { - let blockFn = base => ({ + let blockFn = () => ({ shouldBlockForParentalControls: () => Promise.resolve(true), }); @@ -2001,7 +2001,7 @@ add_task(async function test_blocked_applicationReputation() { add_task(async function test_blocked_applicationReputation_race() { let isFirstShouldBlockCall = true; - let blockFn = base => ({ + let blockFn = () => ({ shouldBlockForReputationCheck(download) { if (isFirstShouldBlockCall) { isFirstShouldBlockCall = false; @@ -2680,23 +2680,20 @@ add_task(async function test_partitionKey() { Services.prefs.setBoolPref("privacy.partition.network_state", true); function promiseVerifyDownloadChannel(url, partitionKey) { - return TestUtils.topicObserved( - "http-on-modify-request", - (subject, data) => { - let httpChannel = subject.QueryInterface(Ci.nsIHttpChannel); - if (httpChannel.URI.spec != url) { - return false; - } + return TestUtils.topicObserved("http-on-modify-request", subject => { + let httpChannel = subject.QueryInterface(Ci.nsIHttpChannel); + if (httpChannel.URI.spec != url) { + return false; + } - let reqLoadInfo = httpChannel.loadInfo; - let cookieJarSettings = reqLoadInfo.cookieJarSettings; + let reqLoadInfo = httpChannel.loadInfo; + let cookieJarSettings = reqLoadInfo.cookieJarSettings; - // Check the partitionKey of the cookieJarSettings. - Assert.equal(cookieJarSettings.partitionKey, partitionKey); + // Check the partitionKey of the cookieJarSettings. + Assert.equal(cookieJarSettings.partitionKey, partitionKey); - return true; - } - ); + return true; + }); } let test_url = httpUrl("source.txt"); diff --git a/toolkit/components/downloads/test/unit/head.js b/toolkit/components/downloads/test/unit/head.js index 19d85b6f7c..a67f600ec7 100644 --- a/toolkit/components/downloads/test/unit/head.js +++ b/toolkit/components/downloads/test/unit/head.js @@ -718,7 +718,7 @@ async function promiseBlockedDownload({ useLegacySaver, verdict = Downloads.Error.BLOCK_VERDICT_UNCOMMON, } = {}) { - let blockFn = base => ({ + let blockFn = () => ({ shouldBlockForReputationCheck: () => Promise.resolve({ shouldBlock: true, @@ -1159,13 +1159,7 @@ add_setup(function test_common_initialize() { // saved to disk without asking for a destination interactively. let mock = { QueryInterface: ChromeUtils.generateQI(["nsIHelperAppLauncherDialog"]), - promptForSaveToFileAsync( - aLauncher, - aWindowContext, - aDefaultFileName, - aSuggestedFileExtension, - aForcePrompt - ) { + promptForSaveToFileAsync(aLauncher) { // The dialog should create the empty placeholder file. let file = getTempFile(TEST_TARGET_FILE_NAME); file.create(Ci.nsIFile.NORMAL_FILE_TYPE, FileUtils.PERMS_FILE); diff --git a/toolkit/components/downloads/test/unit/test_DownloadHistory.js b/toolkit/components/downloads/test/unit/test_DownloadHistory.js index 69eb1c4728..7bcf097062 100644 --- a/toolkit/components/downloads/test/unit/test_DownloadHistory.js +++ b/toolkit/components/downloads/test/unit/test_DownloadHistory.js @@ -44,7 +44,7 @@ class TestView { } this.checkForExpectedDownloads(); } - onDownloadChanged(download) { + onDownloadChanged() { this.checkForExpectedDownloads(); } onDownloadRemoved(download) { diff --git a/toolkit/components/downloads/test/unit/test_DownloadLegacy.js b/toolkit/components/downloads/test/unit/test_DownloadLegacy.js index 972820f29e..839611ec22 100644 --- a/toolkit/components/downloads/test/unit/test_DownloadLegacy.js +++ b/toolkit/components/downloads/test/unit/test_DownloadLegacy.js @@ -11,6 +11,8 @@ // Execution of common tests +Services.prefs.setBoolPref("dom.block_download_insecure", false); + // This is used in common_test_Download.js // eslint-disable-next-line no-unused-vars var gUseLegacySaver = true; diff --git a/toolkit/components/downloads/test/unit/test_DownloadList.js b/toolkit/components/downloads/test/unit/test_DownloadList.js index f7d03900af..7045824c9c 100644 --- a/toolkit/components/downloads/test/unit/test_DownloadList.js +++ b/toolkit/components/downloads/test/unit/test_DownloadList.js @@ -322,7 +322,7 @@ add_task(async function test_history_expiration() { let deferred = Promise.withResolvers(); let removeNotifications = 0; let downloadView = { - onDownloadRemoved(aDownload) { + onDownloadRemoved() { if (++removeNotifications == 2) { deferred.resolve(); } @@ -369,7 +369,7 @@ add_task(async function test_history_clear() { let deferred = Promise.withResolvers(); let removeNotifications = 0; let downloadView = { - onDownloadRemoved(aDownload) { + onDownloadRemoved() { if (++removeNotifications == 2) { deferred.resolve(); } diff --git a/toolkit/components/downloads/test/unit/test_Download_noext_win.js b/toolkit/components/downloads/test/unit/test_Download_noext_win.js index 0e226229f6..b0e1466b52 100644 --- a/toolkit/components/downloads/test/unit/test_Download_noext_win.js +++ b/toolkit/components/downloads/test/unit/test_Download_noext_win.js @@ -47,7 +47,7 @@ add_task(async function () { */ function waitForDirectoryShown() { return new Promise(resolve => { - let waitFn = base => ({ + let waitFn = () => ({ showContainingDirectory(path) { Integration.downloads.unregister(waitFn); resolve(path); -- cgit v1.2.3