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 /dom/cache/test | |
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 'dom/cache/test')
-rw-r--r-- | dom/cache/test/browser/browser_cache_pb_window.js | 26 | ||||
-rw-r--r-- | dom/cache/test/mochitest/driver.js | 8 | ||||
-rw-r--r-- | dom/cache/test/mochitest/test_cache.js | 2 | ||||
-rw-r--r-- | dom/cache/test/mochitest/test_cache_match_request.js | 2 | ||||
-rw-r--r-- | dom/cache/test/mochitest/test_cache_orphaned_body.html | 12 | ||||
-rw-r--r-- | dom/cache/test/mochitest/test_cache_orphaned_cache.html | 8 | ||||
-rw-r--r-- | dom/cache/test/mochitest/test_cache_padding.html | 6 | ||||
-rw-r--r-- | dom/cache/test/mochitest/test_cache_restart.html | 6 | ||||
-rw-r--r-- | dom/cache/test/mochitest/test_cache_shrink.html | 8 | ||||
-rw-r--r-- | dom/cache/test/mochitest/test_cache_tons_of_fd.html | 2 | ||||
-rw-r--r-- | dom/cache/test/mochitest/test_cache_updateUsage.html | 6 | ||||
-rw-r--r-- | dom/cache/test/mochitest/test_caches.js | 2 | ||||
-rw-r--r-- | dom/cache/test/xpcshell/test_empty_directories.js | 2 |
13 files changed, 45 insertions, 45 deletions
diff --git a/dom/cache/test/browser/browser_cache_pb_window.js b/dom/cache/test/browser/browser_cache_pb_window.js index bb45210796..bd59063a32 100644 --- a/dom/cache/test/browser/browser_cache_pb_window.js +++ b/dom/cache/test/browser/browser_cache_pb_window.js @@ -2,15 +2,15 @@ var name = "pb-window-cache"; function testMatch(browser) { - return SpecialPowers.spawn(browser, [name], function (name) { + return SpecialPowers.spawn(browser, [name], function () { return new Promise((resolve, reject) => { content.caches .match("http://foo.com") - .then(function (response) { + .then(function () { ok(true, "caches.match() should be successful"); resolve(); }) - .catch(function (err) { + .catch(function () { ok(false, "caches.match() should not throw error"); reject(); }); @@ -23,11 +23,11 @@ function testHas(browser) { return new Promise(function (resolve, reject) { content.caches .has(name) - .then(function (result) { + .then(function () { ok(true, "caches.has() should be successful"); resolve(); }) - .catch(function (err) { + .catch(function () { ok(false, "caches.has() should not throw error"); reject(); }); @@ -40,11 +40,11 @@ function testOpen(browser) { return new Promise(function (resolve, reject) { content.caches .open(name) - .then(function (c) { + .then(function () { ok(true, "caches.open() should be successful"); resolve(); }) - .catch(function (err) { + .catch(function () { ok(false, "caches.open() should not throw error"); reject(); }); @@ -57,11 +57,11 @@ function testDelete(browser) { return new Promise(function (resolve, reject) { content.caches .delete(name) - .then(function (result) { + .then(function () { ok(true, "caches.delete() should be successful"); resolve(); }) - .catch(function (err) { + .catch(function () { ok(false, "caches.delete should not throw error"); reject(); }); @@ -70,15 +70,15 @@ function testDelete(browser) { } function testKeys(browser) { - return SpecialPowers.spawn(browser, [name], function (name) { + return SpecialPowers.spawn(browser, [name], function () { return new Promise(function (resolve, reject) { content.caches .keys() - .then(function (names) { + .then(function () { ok(true, "caches.keys() should be successful"); resolve(); }) - .catch(function (err) { + .catch(function () { ok(false, "caches.keys should not throw error"); reject(); }); @@ -129,7 +129,7 @@ function test() { privateTab = BrowserTestUtils.addTab(pw.gBrowser, "http://example.com/"); return BrowserTestUtils.browserLoaded(privateTab.linkedBrowser); }) - .then(tab => { + .then(() => { return Promise.all([ testMatch(privateTab.linkedBrowser), testHas(privateTab.linkedBrowser), diff --git a/dom/cache/test/mochitest/driver.js b/dom/cache/test/mochitest/driver.js index db0231c168..646135a70e 100644 --- a/dom/cache/test/mochitest/driver.js +++ b/dom/cache/test/mochitest/driver.js @@ -32,14 +32,14 @@ function runTests(testFile, order) { // adapted from dom/indexedDB/test/helpers.js function clearStorage() { - var clearUnpartitionedStorage = new Promise(function (resolve, reject) { + var clearUnpartitionedStorage = new Promise(function (resolve) { var qms = SpecialPowers.Services.qms; var principal = SpecialPowers.wrap(document).nodePrincipal; var request = qms.clearStoragesForPrincipal(principal); var cb = SpecialPowers.wrapCallback(resolve); request.callback = cb; }); - var clearPartitionedStorage = new Promise(function (resolve, reject) { + var clearPartitionedStorage = new Promise(function (resolve) { var qms = SpecialPowers.Services.qms; var principal = SpecialPowers.wrap(document).partitionedPrincipal; var request = qms.clearStoragesForPrincipal(principal); @@ -77,7 +77,7 @@ function runTests(testFile, order) { navigator.serviceWorker == null && SpecialPowers.getBoolPref("dom.cache.privateBrowsing.enabled") ) { - return new Promise(function (resolve, reject) { + return new Promise(function (resolve) { resolve(true); }); } @@ -86,7 +86,7 @@ function runTests(testFile, order) { } function runFrameTest() { - return new Promise(function (resolve, reject) { + return new Promise(function (resolve) { var iframe = document.createElement("iframe"); iframe.src = "frame.html"; iframe.onload = function () { diff --git a/dom/cache/test/mochitest/test_cache.js b/dom/cache/test/mochitest/test_cache.js index 7d6d01b34b..1bbe3304c5 100644 --- a/dom/cache/test/mochitest/test_cache.js +++ b/dom/cache/test/mochitest/test_cache.js @@ -67,7 +67,7 @@ caches ); return snafu.put(req, res); }) - .then(function (v) { + .then(function () { return snafu; }); }) diff --git a/dom/cache/test/mochitest/test_cache_match_request.js b/dom/cache/test/mochitest/test_cache_match_request.js index f7a7001444..c6a96c0f2f 100644 --- a/dom/cache/test/mochitest/test_cache_match_request.js +++ b/dom/cache/test/mochitest/test_cache_match_request.js @@ -162,7 +162,7 @@ function testRequest( .then(function () { return caches .match(request, { cacheName: name + "mambojambo" }) - .then(function (result) { + .then(function () { is( typeof r, "undefined", diff --git a/dom/cache/test/mochitest/test_cache_orphaned_body.html b/dom/cache/test/mochitest/test_cache_orphaned_body.html index 98c0f42267..d540d90c9d 100644 --- a/dom/cache/test/mochitest/test_cache_orphaned_body.html +++ b/dom/cache/test/mochitest/test_cache_orphaned_body.html @@ -23,7 +23,7 @@ function setupTestIframe() { } function clearStorage() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { var qms = SpecialPowers.Services.qms; var principal = SpecialPowers.wrap(document).nodePrincipal; var request = qms.clearStoragesForPrincipal(principal); @@ -33,7 +33,7 @@ function clearStorage() { } function storageUsage() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { var qms = SpecialPowers.Services.qms; var principal = SpecialPowers.wrap(document).nodePrincipal; var cb = SpecialPowers.wrapCallback(function(request) { @@ -45,7 +45,7 @@ function storageUsage() { } function groupUsage() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { navigator.storage.estimate().then(storageEstimation => { resolve(storageEstimation.usage, 0); }); @@ -53,7 +53,7 @@ function groupUsage() { } function workerGroupUsage() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { function workerScript() { navigator.storage.estimate().then(storageEstimation => { postMessage(storageEstimation.usage); @@ -71,7 +71,7 @@ function workerGroupUsage() { } function resetStorage() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { var qms = SpecialPowers.Services.qms; var principal = SpecialPowers.wrap(document).nodePrincipal; var request = qms.resetStoragesForPrincipal(principal); @@ -81,7 +81,7 @@ function resetStorage() { } function gc() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { SpecialPowers.exactGC(resolve); }); } diff --git a/dom/cache/test/mochitest/test_cache_orphaned_cache.html b/dom/cache/test/mochitest/test_cache_orphaned_cache.html index 7724a26fef..7d08fc3c55 100644 --- a/dom/cache/test/mochitest/test_cache_orphaned_cache.html +++ b/dom/cache/test/mochitest/test_cache_orphaned_cache.html @@ -23,7 +23,7 @@ function setupTestIframe() { } function clearStorage() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { var qms = SpecialPowers.Services.qms; var principal = SpecialPowers.wrap(document).nodePrincipal; var request = qms.clearStoragesForPrincipal(principal); @@ -33,7 +33,7 @@ function clearStorage() { } function storageUsage() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { var qms = SpecialPowers.Services.qms; var principal = SpecialPowers.wrap(document).nodePrincipal; var cb = SpecialPowers.wrapCallback(function(request) { @@ -45,7 +45,7 @@ function storageUsage() { } function resetStorage() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { var qms = SpecialPowers.Services.qms; var principal = SpecialPowers.wrap(document).nodePrincipal; var request = qms.resetStoragesForPrincipal(principal); @@ -55,7 +55,7 @@ function resetStorage() { } function gc() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { SpecialPowers.exactGC(resolve); }); } diff --git a/dom/cache/test/mochitest/test_cache_padding.html b/dom/cache/test/mochitest/test_cache_padding.html index 61b890e948..a912f47547 100644 --- a/dom/cache/test/mochitest/test_cache_padding.html +++ b/dom/cache/test/mochitest/test_cache_padding.html @@ -23,7 +23,7 @@ function setupTestIframe() { } function clearStorage() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { var qms = SpecialPowers.Services.qms; var principal = SpecialPowers.wrap(document).nodePrincipal; var request = qms.clearStoragesForPrincipal(principal); @@ -33,7 +33,7 @@ function clearStorage() { } function resetStorage() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { var qms = SpecialPowers.Services.qms; var principal = SpecialPowers.wrap(document).nodePrincipal; var request = qms.resetStoragesForPrincipal(principal); @@ -43,7 +43,7 @@ function resetStorage() { } function getStorageUsage(fromMemory) { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { var qms = SpecialPowers.Services.qms; var principal = SpecialPowers.wrap(document).nodePrincipal; var cb = SpecialPowers.wrapCallback(function(request) { diff --git a/dom/cache/test/mochitest/test_cache_restart.html b/dom/cache/test/mochitest/test_cache_restart.html index bebb45c093..2472f7ab4e 100644 --- a/dom/cache/test/mochitest/test_cache_restart.html +++ b/dom/cache/test/mochitest/test_cache_restart.html @@ -22,7 +22,7 @@ function setupTestIframe() { } function resetStorage() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { var qms = SpecialPowers.Services.qms; var principal = SpecialPowers.wrap(document).nodePrincipal; var request = qms.resetStoragesForPrincipal(principal); @@ -47,9 +47,9 @@ SpecialPowers.pushPrefEnv({ }).then(function() { return resetStorage(); }).then(function() { - return cache.match(url).then(function(resp) { + return cache.match(url).then(function() { ok(false, "old cache reference should not work after reset"); - }).catch(function(err) { + }).catch(function() { ok(true, "old cache reference should not work after reset"); }); }).then(function() { diff --git a/dom/cache/test/mochitest/test_cache_shrink.html b/dom/cache/test/mochitest/test_cache_shrink.html index 0d50f9e94b..def68ec770 100644 --- a/dom/cache/test/mochitest/test_cache_shrink.html +++ b/dom/cache/test/mochitest/test_cache_shrink.html @@ -23,7 +23,7 @@ function setupTestIframe() { } function clearStorage() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { var qms = SpecialPowers.Services.qms; var principal = SpecialPowers.wrap(document).nodePrincipal; var request = qms.clearStoragesForPrincipal(principal); @@ -33,7 +33,7 @@ function clearStorage() { } function storageUsage() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { var qms = SpecialPowers.Services.qms; var principal = SpecialPowers.wrap(document).nodePrincipal; var cb = SpecialPowers.wrapCallback(function(request) { @@ -45,7 +45,7 @@ function storageUsage() { } function resetStorage() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { var qms = SpecialPowers.Services.qms; var principal = SpecialPowers.wrap(document).nodePrincipal; var request = qms.resetStoragesForPrincipal(principal); @@ -55,7 +55,7 @@ function resetStorage() { } function gc() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { SpecialPowers.exactGC(resolve); }); } diff --git a/dom/cache/test/mochitest/test_cache_tons_of_fd.html b/dom/cache/test/mochitest/test_cache_tons_of_fd.html index c370201e50..00f896448c 100644 --- a/dom/cache/test/mochitest/test_cache_tons_of_fd.html +++ b/dom/cache/test/mochitest/test_cache_tons_of_fd.html @@ -23,7 +23,7 @@ } function clearStorage() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { var qms = SpecialPowers.Services.qms; var principal = SpecialPowers.wrap(document).nodePrincipal; var request = qms.clearStoragesForPrincipal(principal); diff --git a/dom/cache/test/mochitest/test_cache_updateUsage.html b/dom/cache/test/mochitest/test_cache_updateUsage.html index f095886a1b..5feb70a89b 100644 --- a/dom/cache/test/mochitest/test_cache_updateUsage.html +++ b/dom/cache/test/mochitest/test_cache_updateUsage.html @@ -23,7 +23,7 @@ function setupTestIframe() { } function clearStorage() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { var qms = SpecialPowers.Services.qms; var principal = SpecialPowers.wrap(document).nodePrincipal; var request = qms.clearStoragesForPrincipal(principal); @@ -33,7 +33,7 @@ function clearStorage() { } function resetStorage() { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { var qms = SpecialPowers.Services.qms; var principal = SpecialPowers.wrap(document).nodePrincipal; var request = qms.resetStoragesForPrincipal(principal); @@ -43,7 +43,7 @@ function resetStorage() { } function getStorageUsage(fromMemory) { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { var qms = SpecialPowers.Services.qms; var principal = SpecialPowers.wrap(document).nodePrincipal; var cb = SpecialPowers.wrapCallback(function(request) { diff --git a/dom/cache/test/mochitest/test_caches.js b/dom/cache/test/mochitest/test_caches.js index c1d3abaff1..31a4238792 100644 --- a/dom/cache/test/mochitest/test_caches.js +++ b/dom/cache/test/mochitest/test_caches.js @@ -17,7 +17,7 @@ function testHas() { ok(!has, name + " should not exist yet"); return caches.open(name); }) - .then(function (c) { + .then(function () { return caches.has(name); }) .then(function (has) { diff --git a/dom/cache/test/xpcshell/test_empty_directories.js b/dom/cache/test/xpcshell/test_empty_directories.js index da8158d993..15fa9d351a 100644 --- a/dom/cache/test/xpcshell/test_empty_directories.js +++ b/dom/cache/test/xpcshell/test_empty_directories.js @@ -3,7 +3,7 @@ */ function resetStorage() { - return new Promise(function (resolve, reject) { + return new Promise(function (resolve) { var qms = Services.qms; var request = qms.reset(); request.callback = resolve; |