summaryrefslogtreecommitdiffstats
path: root/dom/cache
diff options
context:
space:
mode:
Diffstat (limited to 'dom/cache')
-rw-r--r--dom/cache/Cache.cpp5
-rw-r--r--dom/cache/CacheStorage.cpp5
-rw-r--r--dom/cache/Connection.cpp5
-rw-r--r--dom/cache/DBAction.cpp3
-rw-r--r--dom/cache/DBSchema.cpp14
-rw-r--r--dom/cache/Manager.cpp36
-rw-r--r--dom/cache/test/browser/browser_cache_pb_window.js26
-rw-r--r--dom/cache/test/mochitest/driver.js8
-rw-r--r--dom/cache/test/mochitest/test_cache.js2
-rw-r--r--dom/cache/test/mochitest/test_cache_match_request.js2
-rw-r--r--dom/cache/test/mochitest/test_cache_orphaned_body.html12
-rw-r--r--dom/cache/test/mochitest/test_cache_orphaned_cache.html8
-rw-r--r--dom/cache/test/mochitest/test_cache_padding.html6
-rw-r--r--dom/cache/test/mochitest/test_cache_restart.html6
-rw-r--r--dom/cache/test/mochitest/test_cache_shrink.html8
-rw-r--r--dom/cache/test/mochitest/test_cache_tons_of_fd.html2
-rw-r--r--dom/cache/test/mochitest/test_cache_updateUsage.html6
-rw-r--r--dom/cache/test/mochitest/test_caches.js2
-rw-r--r--dom/cache/test/xpcshell/test_empty_directories.js2
19 files changed, 100 insertions, 58 deletions
diff --git a/dom/cache/Cache.cpp b/dom/cache/Cache.cpp
index d9b94f6b14..3f84e08e66 100644
--- a/dom/cache/Cache.cpp
+++ b/dom/cache/Cache.cpp
@@ -81,13 +81,12 @@ static bool IsValidPutResponseStatus(Response& aResponse,
ErrorResult& aRv) {
if ((aPolicy == PutStatusPolicy::RequireOK && !aResponse.Ok()) ||
aResponse.Status() == 206) {
- nsCString type(ResponseTypeValues::GetString(aResponse.Type()));
-
nsAutoString url;
aResponse.GetUrl(url);
aRv.ThrowTypeError<MSG_CACHE_ADD_FAILED_RESPONSE>(
- type, IntToCString(aResponse.Status()), NS_ConvertUTF16toUTF8(url));
+ GetEnumString(aResponse.Type()), IntToCString(aResponse.Status()),
+ NS_ConvertUTF16toUTF8(url));
return false;
}
diff --git a/dom/cache/CacheStorage.cpp b/dom/cache/CacheStorage.cpp
index e2622fafa2..b5647ba791 100644
--- a/dom/cache/CacheStorage.cpp
+++ b/dom/cache/CacheStorage.cpp
@@ -467,8 +467,9 @@ already_AddRefed<CacheStorage> CacheStorage::Constructor(
static_assert(
CHROME_ONLY_NAMESPACE == (uint32_t)CacheStorageNamespace::Chrome,
"Chrome namespace should match webidl Chrome enum");
- static_assert(NUMBER_OF_NAMESPACES == CacheStorageNamespaceValues::Count,
- "Number of namespace should match webidl count");
+ static_assert(
+ NUMBER_OF_NAMESPACES == ContiguousEnumSize<CacheStorageNamespace>::value,
+ "Number of namespace should match webidl count");
Namespace ns = static_cast<Namespace>(aNamespace);
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
diff --git a/dom/cache/Connection.cpp b/dom/cache/Connection.cpp
index 32e5549101..e9c9becebc 100644
--- a/dom/cache/Connection.cpp
+++ b/dom/cache/Connection.cpp
@@ -227,6 +227,11 @@ Connection::GetVariableLimit(int32_t* aResultOut) {
}
NS_IMETHODIMP
+Connection::SetVariableLimit(int32_t aLimit) {
+ return mBase->SetVariableLimit(aLimit);
+}
+
+NS_IMETHODIMP
Connection::BeginTransaction() { return mBase->BeginTransaction(); }
NS_IMETHODIMP
diff --git a/dom/cache/DBAction.cpp b/dom/cache/DBAction.cpp
index 119242d93c..8f1e962747 100644
--- a/dom/cache/DBAction.cpp
+++ b/dom/cache/DBAction.cpp
@@ -14,6 +14,7 @@
#include "mozilla/dom/quota/PersistenceType.h"
#include "mozilla/dom/quota/ResultExtensions.h"
#include "mozilla/net/nsFileProtocolHandler.h"
+#include "mozilla/AppShutdown.h"
#include "mozIStorageConnection.h"
#include "mozIStorageService.h"
#include "mozStorageCID.h"
@@ -62,7 +63,7 @@ void DBAction::RunOnTarget(
MOZ_DIAGNOSTIC_ASSERT(aDirectoryMetadata);
MOZ_DIAGNOSTIC_ASSERT(aDirectoryMetadata->mDir);
- if (IsCanceled()) {
+ if (IsCanceled() || AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownQM)) {
aResolver->Resolve(NS_ERROR_ABORT);
return;
}
diff --git a/dom/cache/DBSchema.cpp b/dom/cache/DBSchema.cpp
index a7e16fda22..0c2c9cd4fb 100644
--- a/dom/cache/DBSchema.cpp
+++ b/dom/cache/DBSchema.cpp
@@ -278,7 +278,7 @@ static_assert(int(HeadersGuardEnum::None) == 0 &&
int(HeadersGuardEnum::Request_no_cors) == 2 &&
int(HeadersGuardEnum::Response) == 3 &&
int(HeadersGuardEnum::Immutable) == 4 &&
- HeadersGuardEnumValues::Count == 5,
+ ContiguousEnumSize<HeadersGuardEnum>::value == 5,
"HeadersGuardEnum values are as expected");
static_assert(int(ReferrerPolicy::_empty) == 0 &&
int(ReferrerPolicy::No_referrer) == 1 &&
@@ -289,18 +289,18 @@ static_assert(int(ReferrerPolicy::_empty) == 0 &&
int(ReferrerPolicy::Same_origin) == 6 &&
int(ReferrerPolicy::Strict_origin) == 7 &&
int(ReferrerPolicy::Strict_origin_when_cross_origin) == 8 &&
- ReferrerPolicyValues::Count == 9,
+ ContiguousEnumSize<ReferrerPolicy>::value == 9,
"ReferrerPolicy values are as expected");
static_assert(int(RequestMode::Same_origin) == 0 &&
int(RequestMode::No_cors) == 1 &&
int(RequestMode::Cors) == 2 &&
int(RequestMode::Navigate) == 3 &&
- RequestModeValues::Count == 4,
+ ContiguousEnumSize<RequestMode>::value == 4,
"RequestMode values are as expected");
static_assert(int(RequestCredentials::Omit) == 0 &&
int(RequestCredentials::Same_origin) == 1 &&
int(RequestCredentials::Include) == 2 &&
- RequestCredentialsValues::Count == 3,
+ ContiguousEnumSize<RequestCredentials>::value == 3,
"RequestCredentials values are as expected");
static_assert(int(RequestCache::Default) == 0 &&
int(RequestCache::No_store) == 1 &&
@@ -308,19 +308,19 @@ static_assert(int(RequestCache::Default) == 0 &&
int(RequestCache::No_cache) == 3 &&
int(RequestCache::Force_cache) == 4 &&
int(RequestCache::Only_if_cached) == 5 &&
- RequestCacheValues::Count == 6,
+ ContiguousEnumSize<RequestCache>::value == 6,
"RequestCache values are as expected");
static_assert(int(RequestRedirect::Follow) == 0 &&
int(RequestRedirect::Error) == 1 &&
int(RequestRedirect::Manual) == 2 &&
- RequestRedirectValues::Count == 3,
+ ContiguousEnumSize<RequestRedirect>::value == 3,
"RequestRedirect values are as expected");
static_assert(int(ResponseType::Basic) == 0 && int(ResponseType::Cors) == 1 &&
int(ResponseType::Default) == 2 &&
int(ResponseType::Error) == 3 &&
int(ResponseType::Opaque) == 4 &&
int(ResponseType::Opaqueredirect) == 5 &&
- ResponseTypeValues::Count == 6,
+ ContiguousEnumSize<ResponseType>::value == 6,
"ResponseType values are as expected");
// If the static_asserts below fails, it means that you have changed the
diff --git a/dom/cache/Manager.cpp b/dom/cache/Manager.cpp
index ef36309e13..68a19e5862 100644
--- a/dom/cache/Manager.cpp
+++ b/dom/cache/Manager.cpp
@@ -651,6 +651,15 @@ class Manager::CacheMatchAction final : public Manager::BaseAction {
/* aCreate */ false)));
}
+ // If we entered shutdown on the main thread while we were doing IO,
+ // bail out now.
+ if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownQM)) {
+ if (stream) {
+ stream->Close();
+ }
+ return NS_ERROR_ABORT;
+ }
+
mStreamList->Add(mResponse.mBodyId, std::move(stream));
return NS_OK;
@@ -718,6 +727,15 @@ class Manager::CacheMatchAllAction final : public Manager::BaseAction {
/* aCreate */ false)));
}
+ // If we entered shutdown on the main thread while we were doing IO,
+ // bail out now.
+ if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownQM)) {
+ if (stream) {
+ stream->Close();
+ }
+ return NS_ERROR_ABORT;
+ }
+
mStreamList->Add(mSavedResponses[i].mBodyId, std::move(stream));
}
@@ -1264,6 +1282,15 @@ class Manager::CacheKeysAction final : public Manager::BaseAction {
/* aCreate */ false)));
}
+ // If we entered shutdown on the main thread while we were doing IO,
+ // bail out now.
+ if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownQM)) {
+ if (stream) {
+ stream->Close();
+ }
+ return NS_ERROR_ABORT;
+ }
+
mStreamList->Add(mSavedRequests[i].mBodyId, std::move(stream));
}
@@ -1334,6 +1361,15 @@ class Manager::StorageMatchAction final : public Manager::BaseAction {
/* aCreate */ false)));
}
+ // If we entered shutdown on the main thread while we were doing IO,
+ // bail out now.
+ if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownQM)) {
+ if (stream) {
+ stream->Close();
+ }
+ return NS_ERROR_ABORT;
+ }
+
mStreamList->Add(mSavedResponse.mBodyId, std::move(stream));
return NS_OK;
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;