--- a/browser/components/extensions/test/xpcshell/test_ext_browsingData_cookies_cache.js
+++ b/browser/components/extensions/test/xpcshell/test_ext_browsingData_cookies_cache.js
@@ -23,16 +23,18 @@ const COOKIE_ORG = {
let since, oldCookie;
function addCookie(cookie) {
Services.cookies.add(cookie.host, cookie.path, cookie.name, "test", false, false, false, Date.now() / 1000 + 10000);
ok(Services.cookies.cookieExists(cookie), `Cookie ${cookie.name} was created.`);
}
async function setUpCookies() {
+ Services.cookies.removeAll();
+
// Add a cookie which will end up with an older creationTime.
oldCookie = Object.assign({}, COOKIE, {name: Date.now()});
addCookie(oldCookie);
await new Promise(resolve => setTimeout(resolve, 10));
since = Date.now();
await new Promise(resolve => setTimeout(resolve, 10));
// Add a cookie which will end up with a more recent creationTime.
--- a/toolkit/components/extensions/Schemas.jsm
+++ b/toolkit/components/extensions/Schemas.jsm
@@ -811,17 +811,17 @@ class InjectionContext extends Context {
* format.
*/
const FORMATS = {
hostname(string, context) {
let valid = true;
try {
valid = new URL(`http://${string}`).host === string;
- } catch(_) {
+ } catch (e) {
valid = false;
}
if (!valid) {
throw new Error(`Invalid hostname ${string}`);
}
return string;