diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /toolkit/components/downloads/test/unit/common_test_Download.js | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz firefox-adbda400be353e676059e335c3c0aaf99e719475.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/downloads/test/unit/common_test_Download.js')
-rw-r--r-- | toolkit/components/downloads/test/unit/common_test_Download.js | 35 |
1 files changed, 16 insertions, 19 deletions
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"); |