Bug 1864896: Autofix unused function arguments (dom). r=emilio,media-playback-reviewers,dom-storage-reviewers,padenot,janv

Differential Revision: https://phabricator.services.mozilla.com/D202962
This commit is contained in:
Dave Townsend
2024-03-04 15:44:59 +00:00
parent 9af586f62e
commit 8c6a552556
407 changed files with 900 additions and 912 deletions

View File

@@ -9,7 +9,7 @@ if (DEBUG) {
dump("-*- IndexedDBHelper: " + s + "\n");
};
} else {
debug = function (s) {};
debug = function () {};
}
function getErrorName(err) {
@@ -70,7 +70,7 @@ IndexedDBHelper.prototype = {
debug("Opened database:" + self.dbName + " " + self.dbVersion);
}
self._db = event.target.result;
self._db.onversionchange = function (event) {
self._db.onversionchange = function () {
if (DEBUG) {
debug("WARNING: DB modified from a different window.");
}
@@ -106,7 +106,7 @@ IndexedDBHelper.prototype = {
}
invokeCallbacks(getErrorName(aEvent.target.error));
};
req.onblocked = function (aEvent) {
req.onblocked = function () {
if (DEBUG) {
debug("Opening database request is blocked.");
}

View File

@@ -28,11 +28,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
}
var asyncPPML = false;
function ppmASL(m) {
function ppmASL() {
asyncPPML = true;
}
var syncPPML = false;
function ppmSL(m) {
function ppmSL() {
syncPPML = true;
}
ppm.addMessageListener("processmessageAsync", ppmASL);
@@ -42,7 +42,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
cpm.sendSyncMessage("processmessageSync", "");
var asyncCPML = false;
function cpmASL(m) {
function cpmASL() {
asyncCPML = true;
}
cpm.addMessageListener("childprocessmessage", cpmASL);
@@ -93,7 +93,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
var weakListener = {
QueryInterface: ChromeUtils.generateQI(["nsISupportsWeakReference"]),
receiveMessage(msg) {
receiveMessage() {
if (weakMessageReceived) {
ok(false, 'Weak listener fired twice.');
return;
@@ -109,7 +109,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
var weakListener2 = {
QueryInterface: ChromeUtils.generateQI(["nsISupportsWeakReference"]),
receiveMessage(msg) {
receiveMessage() {
ok(false, 'Should not have received a message.');
}
};

View File

@@ -27,7 +27,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=616841
[ "D", "\u010C" ] ];
var nCmps = 0;
function recvContentReady(m) {
function recvContentReady() {
for (var i = 0; i < toCompare.length; ++i) {
var pair = toCompare[i];
messageManager.broadcastAsyncMessage("cmp",

View File

@@ -29,7 +29,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1339722
// behave similarly.
const TOPIC = "document-on-modify-request";
let win;
const observe = (subject, topic, data) => {
const observe = (subject, topic) => {
info("Got " + topic);
Services.obs.removeObserver(observe, TOPIC);
@@ -58,7 +58,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1339722
// Remove the iframe to cause frameloader destroy.
iframe.remove();
setTimeout($ => {
setTimeout(() => {
ok(!document.getElementById("testFrame"), "verify iframe removed");
SimpleTest.finish();
}, 0);

View File

@@ -55,7 +55,7 @@ SimpleTest.waitForExplicitFinish();
s.setAttribute("ggg", "testvalue");
await promiseFlushingMutationObserver();
const observer = new MutationObserver((aMutationList, aObserver) => {
const observer = new MutationObserver(() => {
ok(s.hasAttribute("ggg"), "Value check 3. There should be a value");
isnot(s.getAttribute("ggg"), "testvalue", "Value check 4");
is(s.getAttribute("ggg"), "othervalue", "Value check 5");

View File

@@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=429785
var errorLogged = false;
var listener = {
QueryInterface: ChromeUtils.generateQI(["nsIConsoleListener"]),
observe(msg) { errorLogged = true; }
observe() { errorLogged = true; }
};
function step2() {

View File

@@ -27,7 +27,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=430050
}
function startTest() {
const observer = new MutationObserver((aMutationList, aObserver) => {
const observer = new MutationObserver(() => {
document.getElementById('b').setAttribute("src",
"data:text/plain,failed");
const systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();

View File

@@ -42,7 +42,7 @@ windows.
"Both browsers should belong to the same document.");
let winID = getOuterWindowID(browser1.ownerGlobal);
let getChildRootOuterId = browser => {
let getChildRootOuterId = () => {
try {
return docShell.browserChild?.chromeOuterWindowID;
} catch(ex) { }

View File

@@ -63,10 +63,10 @@
}
}
function listener2(ev) {
function listener2() {
inProgressDoc[description] = false;
}
function listener3(ev) {
function listener3() {
inProgressWin[description] = false;
}
frame.addEventListener("DOMTitleChanged", listener);

View File

@@ -4120,7 +4120,7 @@ function runUnloadTests1()
let oldSrc = iframe.src;
let parentWindow = window;
iframe.addEventListener("load", function (aEvent) {
iframe.addEventListener("load", function () {
ok(true, description + "dummy page is loaded");
childWindow = iframe.contentWindow;
textareaInFrame = null;
@@ -4181,7 +4181,7 @@ function runUnloadTests2()
let oldSrc = iframe.src;
iframe.addEventListener("load", function (aEvent) {
iframe.addEventListener("load", function () {
ok(true, description + "dummy page is loaded");
childWindow = iframe.contentWindow;
textareaInFrame = null;

View File

@@ -79,7 +79,7 @@ function thirdEntry(event) {
gOuterDoc.exitFullscreen();
}
function earlyExit(event) {
function earlyExit() {
ok(false, "MozDOMFullscreen:Exited should only be triggered after cancel all fullscreen");
}

View File

@@ -82,7 +82,7 @@ function preventBFCache(aBrowsingContext, aPrevent) {
let target = content.document.getElementById("div");
target.addEventListener(
"mousedown",
function (e) {
function () {
content.window.history.back();
},
{ once: true }

View File

@@ -70,7 +70,7 @@ async function WaitRemoveDocumentAndCloseTab(aBrowser, aBrowsingContext) {
return new Promise(resolve => {
content.document.addEventListener(
"fullscreenchange",
e => {
() => {
resolve();
},
{ once: true }

View File

@@ -112,7 +112,7 @@ function enter2(event) {
promise = document.exitFullscreen();
}
function exit2(event) {
function exit2() {
is(document.fullscreenElement, null,
"Full-screen element should have rolled back.");
is(iframe.contentDocument.fullscreenElement, null,
@@ -156,7 +156,7 @@ function exit3(event) {
promise = outOfDocElement.requestFullscreen();
}
function error1(event) {
function error1() {
ok(!document.fullscreenElement,
"Requests for full-screen from not-in-doc elements should fail.");
assertPromiseRejected(promise, "in error1");
@@ -181,7 +181,7 @@ function enter4(event) {
"Should not have a full-screen element again.");
}
async function exit_to_arg_test_1(event) {
async function exit_to_arg_test_1() {
ok(!document.fullscreenElement,
"Should have left full-screen mode (third time).");
addFullscreenChangeContinuation("enter", enter_from_arg_test_1);
@@ -196,14 +196,14 @@ async function exit_to_arg_test_1(event) {
ok(!threw, "requestFullscreen with bogus arg (123) shouldn't throw exception");
}
function enter_from_arg_test_1(event) {
function enter_from_arg_test_1() {
ok(document.fullscreenElement,
"Should have entered full-screen after calling with bogus (ignored) argument (fourth time)");
addFullscreenChangeContinuation("exit", exit_to_arg_test_2);
document.exitFullscreen();
}
async function exit_to_arg_test_2(event) {
async function exit_to_arg_test_2() {
ok(!document.fullscreenElement,
"Should have left full-screen mode (fourth time).");
addFullscreenChangeContinuation("enter", enter_from_arg_test_2);
@@ -218,14 +218,14 @@ async function exit_to_arg_test_2(event) {
ok(!threw, "requestFullscreen with { vrDisplay: null } shouldn't throw exception");
}
function enter_from_arg_test_2(event) {
function enter_from_arg_test_2() {
ok(document.fullscreenElement,
"Should have entered full-screen after calling with vrDisplay null argument (fifth time)");
addFullscreenChangeContinuation("exit", exit4);
document.exitFullscreen();
}
function exit4(event) {
function exit4() {
ok(!document.fullscreenElement,
"Should be back in non-full-screen mode (fifth time)");
SpecialPowers.pushPrefEnv({"set":[["full-screen-api.allow-trusted-requests-only", true]]}, function() {
@@ -234,7 +234,7 @@ function exit4(event) {
});
}
function error2(event) {
function error2() {
ok(!document.fullscreenElement,
"Should still be in normal mode, because calling context isn't trusted.");
button = document.createElement("button");
@@ -246,13 +246,13 @@ function error2(event) {
sendMouseClick(button);
}
function enter5(event) {
function enter5() {
ok(document.fullscreenElement, "Moved to full-screen after mouse click");
addFullscreenChangeContinuation("exit", exit5);
document.exitFullscreen();
}
function exit5(event) {
function exit5() {
ok(!document.fullscreenElement,
"Should have left full-screen mode (last time).");
SpecialPowers.pushPrefEnv({
@@ -264,7 +264,7 @@ function exit5(event) {
});
}
function error3(event) {
function error3() {
ok(!document.fullscreenElement,
"Should still be in normal mode, because pref is not enabled.");

View File

@@ -2,7 +2,7 @@
<button>Launch</button>
<script>
let button = document.querySelector("button");
button.addEventListener("click", function(e) {
button.addEventListener("click", function() {
let newWindow = window.open("", "", "newWindow");
newWindow.document.write(`<!DOCTYPE HTML>
<button>click me!</button>

View File

@@ -2,7 +2,7 @@
<button>click me!</button>
<script>
let button = document.querySelector("button");
button.addEventListener("click", function(e) {
button.addEventListener("click", function() {
document.documentElement.requestFullscreen();
setTimeout(() => {
while(true) {

View File

@@ -137,7 +137,7 @@ function requestFullscreenMouseBtn(event, button) {
synthesizeMouseAtCenter(clickEl, { button });
}
async function testFullscreenMouseBtn(event, button, next) {
async function testFullscreenMouseBtn() {
await SpecialPowers.pushPrefEnv({
"set": [["full-screen-api.mouse-event-allow-left-button-only", true]]
});

View File

@@ -33,7 +33,7 @@ function is(a, b, msg) {
var escKeyReceived = false;
var escKeySent = false;
function keyHandler(event) {
function keyHandler() {
if (escKeyReceived == KeyboardEvent.DOM_VK_ESC) {
escKeyReceived = true;
}

View File

@@ -34,14 +34,14 @@ function finish() {
opener.nextTest();
}
function fullscreenchange1(event) {
function fullscreenchange1() {
is(document.fullscreenElement, document.body, "FSE should be doc");
addFullscreenChangeContinuation("exit", fullscreenchange2);
ok(!document.getElementById("subdoc").contentWindow.escKeySent, "Should not yet have sent ESC key press.");
document.getElementById("subdoc").contentWindow.startTest();
}
function fullscreenchange2(event) {
function fullscreenchange2() {
ok(document.getElementById("subdoc").contentWindow.escKeySent, "Should have sent ESC key press.");
ok(!document.getElementById("subdoc").contentWindow.escKeyReceived, "ESC key press to exit should not be delivered.");
ok(!document.fullscreenElement, "Should have left full-screen mode on ESC key press");

View File

@@ -29,7 +29,7 @@
var elem = shadowRoot.firstChild;
var gotFullscreenEvent = false;
document.addEventListener("fullscreenchange", function (e) {
document.addEventListener("fullscreenchange", function () {
if (document.fullscreenElement === host) {
is(shadowRoot.fullscreenElement, elem,
"Expected element entered fullsceen");

View File

@@ -32,7 +32,7 @@
var elem = document.getElementById("svg-elem")
, elemWasLocked = false;
document.addEventListener("fullscreenchange", function (e) {
document.addEventListener("fullscreenchange", function () {
if (document.fullscreenElement === elem) {
elemWasLocked = true;
document.exitFullscreen();

View File

@@ -11,7 +11,7 @@
window.addEventListener("fullscreen", onFullScreen, true);
function onFullScreen(event)
function onFullScreen()
{
window.arguments[0].done(window.fullScreen);
}

View File

@@ -83,7 +83,7 @@ function waitWidgetFullscreenEvent(
aIsInFullscreen,
aWaitUntil = false
) {
return BrowserTestUtils.waitForEvent(aWindow, "fullscreen", false, aEvent => {
return BrowserTestUtils.waitForEvent(aWindow, "fullscreen", false, () => {
if (
aWaitUntil &&
aIsInFullscreen !=
@@ -106,7 +106,7 @@ function waitForFullScreenObserver(
aIsInFullscreen,
aWaitUntil = false
) {
return TestUtils.topicObserved("fullscreen-painted", (subject, data) => {
return TestUtils.topicObserved("fullscreen-painted", () => {
if (
aWaitUntil &&
aIsInFullscreen !=

View File

@@ -111,7 +111,7 @@ function runNextTest() {
// otherwise, the fullscreen request might be denied.
if (testWindow.document.hidden) {
info("Waiting for document to unhide");
waitForEvent(testWindow.document, "visibilitychange", (event) => {
waitForEvent(testWindow.document, "visibilitychange", () => {
return !testWindow.document.hidden;
}, testWindow.begin);
return;

View File

@@ -21,7 +21,7 @@ const button = document.querySelector("button");
let clickCount = 0;
let lastFullscreenPromise = null;
let shouldEnterFullscreen = false;
button.addEventListener("click", function(e) {
button.addEventListener("click", function() {
clickCount++;
if (shouldEnterFullscreen) {
const fullscreenElement = document.getElementById("fullscreen");

View File

@@ -10,7 +10,7 @@ function asyncXHR(expectedStatus, nextTestFunc) {
xhr.open("GET", "http://localhost:4444/test_error_code.xml", true);
var sawError = false;
xhr.addEventListener("loadend", function doAsyncRequest_onLoad(event) {
xhr.addEventListener("loadend", function doAsyncRequest_onLoad() {
Assert.ok(sawError, "Should have received an error");
nextTestFunc();
});

View File

@@ -373,10 +373,10 @@ function allMechanisms(aCb, aClipOverride, aNegateAll) {
case 0:
// Keyboard issued
cutCopyAll(
function docut(aSucc) {
function docut() {
synthesizeKey("x", { accelKey: true });
},
function docopy(aSucc) {
function docopy() {
synthesizeKey("c", { accelKey: true });
},
function done() {
@@ -411,14 +411,14 @@ function allMechanisms(aCb, aClipOverride, aNegateAll) {
case 2:
// Not triggered by user gesture
cutCopyAll(
function doCut(aSucc) {
function doCut() {
is(
false,
document.execCommand("cut"),
"Can't directly execCommand not in a user callback"
);
},
function doCopy(aSucc) {
function doCopy() {
is(
false,
document.execCommand("copy"),

View File

@@ -16,7 +16,7 @@ SimpleTest.requestFlakyTimeout("Need to test setTimeout");
function startTest(aTestAsyncFun, aAllowPopup = true) {
return new Promise(aResolve => {
let target = document.getElementById("target");
target.addEventListener("click", (e) => {
target.addEventListener("click", () => {
aTestAsyncFun(() => {
let w = window.open("about:blank");
is(!!w, aAllowPopup, `Should ${aAllowPopup ? "allow" : "block"} popup`);

View File

@@ -78,7 +78,7 @@ if (!opener) {
SimpleTest.waitForFocus(async function() {
function waitForEvent(aTarget, aEvent) {
return new Promise((aResolve) => {
aTarget.addEventListener(aEvent, function listener(event) {
aTarget.addEventListener(aEvent, function listener() {
aResolve();
}, { once: true });
});

View File

@@ -93,12 +93,12 @@ TestInterfaceJS.prototype = {
pingPongNullableUnion(x) {
return x;
},
returnBadUnion(x) {
returnBadUnion() {
return 3;
},
testSequenceOverload(arg) {},
testSequenceUnion(arg) {},
testSequenceOverload() {},
testSequenceUnion() {},
testThrowError() {
throw new this._win.Error("We are an Error");
@@ -121,7 +121,7 @@ TestInterfaceJS.prototype = {
throw Cr.NS_BINDING_ABORTED;
},
testThrowNsresultFromNative(x) {
testThrowNsresultFromNative() {
// We want to throw an exception that we generate from an nsresult thrown
// by a C++ component.
Services.io.notImplemented();

View File

@@ -88,7 +88,7 @@ async function test_data_single() {
let blockingPromises = [];
for (let i = 0; i < 10; ++i) {
let unblocker;
let promise = new Promise((resolve, reject) => {
let promise = new Promise((resolve) => {
unblocker = resolve;
});
unblockers.push(unblocker);

View File

@@ -50,9 +50,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1123516
ok(true, "Calling iterators via xrays should fail");
}
setlike.forEach((v,k,t) => { is(v, win.document.documentElement, "Cross-compartment forEach works"); });
setlike.forEach((v) => { is(v, win.document.documentElement, "Cross-compartment forEach works"); });
TestInterfaceSetlikeNode.prototype.forEach.call(setlike,
(v,k,t) => { is(v, win.document.documentElement, "Cross-compartment forEach works"); });
(v) => { is(v, win.document.documentElement, "Cross-compartment forEach works"); });
is(TestInterfaceSetlikeNode.prototype.delete.call(setlike, win.document.documentElement), true,
"Cross-compartment unwrapping/comparison delete works");
/* eslint-disable-next-line no-shadow */

View File

@@ -21,7 +21,7 @@ add_task(function testObservableArray_length() {
let deleteCallbackTests = null;
let m = new TestInterfaceObservableArray({
setBooleanCallback(value, index) {
setBooleanCallback() {
setCallbackCount++;
},
deleteBooleanCallback(value, index) {
@@ -82,10 +82,10 @@ add_task(function testObservableArray_length_callback_throw() {
let deleteCallbackCount = 0;
let m = new TestInterfaceObservableArray({
setBooleanCallback(value, index) {
setBooleanCallback() {
setCallbackCount++;
},
deleteBooleanCallback(value, index) {
deleteBooleanCallback(value) {
deleteCallbackCount++;
if (value) {
throw new Error("deleteBooleanCallback");
@@ -268,7 +268,7 @@ add_task(function testObservableArray_setter_callback_throw() {
throw new Error("setBooleanCallback");
}
},
deleteBooleanCallback(value, index) {
deleteBooleanCallback(value) {
deleteCallbackCount++;
if (value) {
throw new Error("deleteBooleanCallback");
@@ -437,7 +437,7 @@ add_task(function testObservableArray_indexed_setter_callback_throw() {
let deleteCallbackCount = 0;
let m = new TestInterfaceObservableArray({
setBooleanCallback(value, index) {
setBooleanCallback(value) {
setCallbackCount++;
if (value) {
throw new Error("setBooleanCallback");
@@ -501,7 +501,7 @@ add_task(function testObservableArray_object() {
is(index, callbackIndex++, "setCallbackTests: test index argument");
isDeeply(values[index], value, "setCallbackTests: test value argument");
},
deleteObjectCallback(value, index) {
deleteObjectCallback() {
deleteCallbackCount++;
},
});
@@ -521,10 +521,10 @@ add_task(function testObservableArray_object() {
add_task(function testObservableArray_xrays() {
let m = new TestInterfaceObservableArray({
setObjectCallback(value, index) {
setObjectCallback() {
ok(false, "Shouldn't reach setObjectCallback");
},
deleteObjectCallback(value, index) {
deleteObjectCallback() {
ok(false, "Shouldn't reach deleteObjectCallback");
},
});

View File

@@ -110,7 +110,7 @@ add_task(function testObservableArray_helper_replaceElementAt_callback_throw() {
let deleteCallbackCount = 0;
let m = new TestInterfaceObservableArray({
setBooleanCallback(value, index) {
setBooleanCallback(value) {
setCallbackCount++;
if (value) {
throw new Error("setBooleanCallback");
@@ -170,7 +170,7 @@ add_task(function testObservableArray_helper_appendElement() {
setCallbackTests(value, index);
}
},
deleteBooleanCallback(value, index) {
deleteBooleanCallback() {
deleteCallbackCount++;
},
});
@@ -211,13 +211,13 @@ add_task(function testObservableArray_helper_appendElement_callback_throw() {
let deleteCallbackCount = 0;
let m = new TestInterfaceObservableArray({
setBooleanCallback(value, index) {
setBooleanCallback(value) {
setCallbackCount++;
if (value) {
throw new Error("setBooleanCallback");
}
},
deleteBooleanCallback(value, index) {
deleteBooleanCallback() {
deleteCallbackCount++;
},
});
@@ -257,7 +257,7 @@ add_task(function testObservableArray_helper_removeLastElement() {
let deleteCallbackTests = null;
let m = new TestInterfaceObservableArray({
setBooleanCallback(value, index) {
setBooleanCallback() {
setCallbackCount++;
},
deleteBooleanCallback(value, index) {
@@ -316,10 +316,10 @@ add_task(function testObservableArray_helper_removeLastElement_callback_throw()
let deleteCallbackCount = 0;
let m = new TestInterfaceObservableArray({
setBooleanCallback(value, index) {
setBooleanCallback() {
setCallbackCount++;
},
deleteBooleanCallback(value, index) {
deleteBooleanCallback(value) {
deleteCallbackCount++;
if (value) {
throw new Error("deleteBooleanCallback");

View File

@@ -184,7 +184,7 @@ add_task(function testObservableArrayExoticObjects_defineProperty_callback_throw
const minLen = 3;
let m = new TestInterfaceObservableArray({
setBooleanCallback(value, index) {
setBooleanCallback(value) {
setCallbackCount++;
if (value) {
throw new Error("setBooleanCallback");
@@ -300,7 +300,7 @@ add_task(function testObservableArrayExoticObjects_deleteProperty() {
let deleteCallbackTests = null;
let m = new TestInterfaceObservableArray({
setBooleanCallback(value, index) {
setBooleanCallback() {
setCallbackCount++;
},
deleteBooleanCallback(value, index) {
@@ -384,10 +384,10 @@ add_task(function testObservableArrayExoticObjects_deleteProperty_callback_throw
let deleteCallbackCount = 0;
let m = new TestInterfaceObservableArray({
setBooleanCallback(value, index) {
setBooleanCallback() {
setCallbackCount++;
},
deleteBooleanCallback(value, index) {
deleteBooleanCallback(value) {
deleteCallbackCount++;
if (value) {
throw new Error("deleteBooleanCallback");
@@ -731,7 +731,7 @@ add_task(function testObservableArrayExoticObjects_set_callback_throw() {
const minLen = 3;
let m = new TestInterfaceObservableArray({
setBooleanCallback(value, index) {
setBooleanCallback(value) {
setCallbackCount++;
if (value) {
throw new Error("setBooleanCallback");

View File

@@ -31,7 +31,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1107592
is(exn.stack, stack, "Should have the right stack in test " + testNumber);
}
function ensurePromiseFail(testNumber, value) {
function ensurePromiseFail(testNumber) {
ok(false, "Test " + testNumber + " should not have a fulfilled promise");
}

View File

@@ -37,7 +37,7 @@ function doTest() {
win.Object.defineProperty(win.Array.prototype, "0",
{
set(val) {
set() {
setterCalled = true;
},
});

View File

@@ -37,7 +37,7 @@ add_task(async function () {
await BrowserTestUtils.browserLoaded(win2.gBrowser.getBrowserForTab(tab2));
var browser2 = gBrowser.getBrowserForTab(tab2);
var p1 = SpecialPowers.spawn(browser1, [], function (opts) {
var p1 = SpecialPowers.spawn(browser1, [], function () {
return new content.window.Promise(resolve => {
content.window.bc = new content.window.BroadcastChannel("foobar");
content.window.bc.onmessage = function (e) {
@@ -46,7 +46,7 @@ add_task(async function () {
});
});
var p2 = SpecialPowers.spawn(browser2, [], function (opts) {
var p2 = SpecialPowers.spawn(browser2, [], function () {
return new content.window.Promise(resolve => {
content.window.bc = new content.window.BroadcastChannel("foobar");
content.window.bc.onmessage = function (e) {
@@ -55,7 +55,7 @@ add_task(async function () {
});
});
await SpecialPowers.spawn(browser1, [], function (opts) {
await SpecialPowers.spawn(browser1, [], function () {
return new content.window.Promise(resolve => {
var bc = new content.window.BroadcastChannel("foobar");
bc.postMessage("hello world from private browsing");
@@ -63,7 +63,7 @@ add_task(async function () {
});
});
await SpecialPowers.spawn(browser2, [], function (opts) {
await SpecialPowers.spawn(browser2, [], function () {
return new content.window.Promise(resolve => {
var bc = new content.window.BroadcastChannel("foobar");
bc.postMessage("hello world from non private browsing");

View File

@@ -52,7 +52,7 @@
counter++;
}
function page2Shown(e) {
function page2Shown() {
if (!expectedPersisted) {
SimpleTest.executeSoon(function() {
info("Posting a message.");

View File

@@ -28,7 +28,7 @@ async function useBroadcastChannel(contentWindow) {
outer.postMessage("foo");
await new Promise(resolve => {
bc.onmessage = e => {
bc.onmessage = () => {
contentWindow.messageCount += 1;
resolve();
};

View File

@@ -13,7 +13,7 @@ let a = new BroadcastChannel('a');
let b = new BroadcastChannel('a');
let count = 0;
a.onmessage = function(e) {
a.onmessage = function() {
++count;
a.close();

View File

@@ -7,8 +7,8 @@
"use strict";
function debug(msg) {
// dump("BrowserElementChild - " + msg + "\n");
function debug(_msg) {
// dump("BrowserElementChild - " + _msg + "\n");
}
var BrowserElementIsReady;

View File

@@ -6,7 +6,7 @@
/* eslint-env mozilla/frame-script */
function debug(msg) {
function debug() {
// dump("BrowserElementChildPreload - " + msg + "\n");
}

View File

@@ -13,7 +13,7 @@ const { BrowserElementPromptService } = ChromeUtils.import(
"resource://gre/modules/BrowserElementPromptService.jsm"
);
function debug(msg) {
function debug() {
// dump("BrowserElementParent - " + msg + "\n");
}

View File

@@ -9,7 +9,7 @@ var Cm = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
var EXPORTED_SYMBOLS = ["BrowserElementPromptService"];
function debug(msg) {
function debug() {
// dump("BrowserElementPromptService - " + msg + "\n");
}
@@ -30,7 +30,7 @@ BrowserElementPrompt.prototype = {
});
},
alertCheck(title, text, checkMsg, checkState) {
alertCheck(title, text) {
// Treat this like a normal alert() call, ignoring the checkState. The
// front-end can do its own suppression of the alert() if it wants.
this.alert(title, text);
@@ -45,7 +45,7 @@ BrowserElementPrompt.prototype = {
});
},
confirmCheck(title, text, checkMsg, checkState) {
confirmCheck(title, text) {
return this.confirm(title, text);
},
@@ -98,7 +98,7 @@ BrowserElementPrompt.prototype = {
return buttonProperties.indexToButtonNumberMap[ret.selectedButton];
},
prompt(title, text, value, checkMsg, checkState) {
prompt(title, text, value) {
let rv = this._browserElementChild.showModalPrompt(this._win, {
promptType: "prompt",
title,
@@ -117,15 +117,15 @@ BrowserElementPrompt.prototype = {
return rv !== null;
},
promptUsernameAndPassword(title, text, username, password) {
promptUsernameAndPassword() {
throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
},
promptPassword(title, text, password) {
promptPassword() {
throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
},
select(title, text, aSelectList, aOutSelection) {
select() {
throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
},
@@ -227,7 +227,7 @@ function BrowserElementAuthPrompt() {}
BrowserElementAuthPrompt.prototype = {
QueryInterface: ChromeUtils.generateQI(["nsIAuthPrompt2"]),
promptAuth: function promptAuth(channel, level, authInfo) {
promptAuth: function promptAuth() {
throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
},
@@ -706,7 +706,7 @@ var BrowserElementPromptService = {
delete this._browserElementChildMap[outerWindowID.data];
},
observe(subject, topic, data) {
observe(subject, topic) {
switch (topic) {
case "outer-window-destroyed":
this._observeOuterWindowDestroyed(subject);

View File

@@ -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),

View File

@@ -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 () {

View File

@@ -67,7 +67,7 @@ caches
);
return snafu.put(req, res);
})
.then(function (v) {
.then(function () {
return snafu;
});
})

View File

@@ -162,7 +162,7 @@ function testRequest(
.then(function () {
return caches
.match(request, { cacheName: name + "mambojambo" })
.then(function (result) {
.then(function () {
is(
typeof r,
"undefined",

View File

@@ -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);
});
}

View File

@@ -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);
});
}

View File

@@ -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) {

View File

@@ -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() {

View File

@@ -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);
});
}

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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;

View File

@@ -49,7 +49,7 @@ ConsoleAPIStorageService.prototype = {
"nsIObserver",
]),
observe: function CS_observe(aSubject, aTopic, aData) {
observe: function CS_observe(aSubject, aTopic) {
if (aTopic == "xpcom-shutdown") {
Services.obs.removeObserver(this, "xpcom-shutdown");
Services.obs.removeObserver(this, "inner-window-destroyed");

View File

@@ -20,9 +20,9 @@
}
});
}
).then((cred) => {
).then(() => {
ok(false, "incorrectly got a credential");
}).catch((err) => {
}).catch(() => {
ok(true, "correctly got an error");
}).finally(() => {
SimpleTest.finish();

View File

@@ -20,9 +20,9 @@
}
});
}
).then((cred) => {
).then(() => {
ok(false, "incorrectly got a credential");
}).catch((err) => {
}).catch(() => {
ok(true, "correctly got an error");
}).finally(() => {
SimpleTest.finish();

View File

@@ -22,9 +22,9 @@
}
});
}
).then((cred) => {
).then(() => {
ok(false, "incorrectly got a credential");
}).catch((err) => {
}).catch(() => {
ok(true, "correctly got an error");
}).finally(() => {
SimpleTest.finish();

View File

@@ -17,9 +17,9 @@
}
});
}
).then((cred) => {
).then(() => {
ok(false, "incorrectly got a credential");
}).catch((err) => {
}).catch(() => {
ok(true, "correctly got an error");
}).finally(() => {
SimpleTest.finish();

View File

@@ -15,9 +15,9 @@
}
});
}
).then((cred) => {
).then(() => {
ok(false, "incorrectly got a credential");
}).catch((err) => {
}).catch(() => {
ok(true, "correctly got an error");
}).finally(() => {
SimpleTest.finish();

View File

@@ -20,9 +20,9 @@
}
});
}
).then((cred) => {
).then(() => {
ok(false, "incorrectly got a credential");
}).catch((err) => {
}).catch(() => {
ok(true, "correctly got an error");
}).finally(() => {
SimpleTest.finish();

View File

@@ -20,9 +20,9 @@
}
});
}
).then((cred) => {
).then(() => {
ok(false, "incorrectly got a credential");
}).catch((err) => {
}).catch(() => {
ok(true, "correctly got an error");
}).finally(() => {
SimpleTest.finish();

View File

@@ -20,9 +20,9 @@
}
});
}
).then((cred) => {
).then(() => {
ok(false, "incorrectly got a credential");
}).catch((err) => {
}).catch(() => {
ok(true, "correctly got an error");
}).finally(() => {
SimpleTest.finish();

View File

@@ -31,7 +31,7 @@
is(cred.type,
"identity",
"Correct type on the credential");
}).catch((err) => {
}).catch(() => {
ok(false, "must not have an error");
}).finally(() => {
SimpleTest.finish();

View File

@@ -31,7 +31,7 @@
is(cred.type,
"identity",
"Correct type on the credential");
}).catch((err) => {
}).catch(() => {
ok(false, "must not have an error");
}).finally(() => {
SimpleTest.finish();

View File

@@ -37,7 +37,7 @@
is(cred.type,
"identity",
"Correct type on the credential");
}).catch((err) => {
}).catch(() => {
ok(false, "must not have an error");
}).finally(() => {
SimpleTest.finish();

View File

@@ -20,9 +20,9 @@
}
});
}
).then((cred) => {
).then(() => {
ok(false, "incorrectly got a credential");
}).catch((err) => {
}).catch(() => {
ok(true, "correctly got an error");
}).finally(() => {
SimpleTest.finish();

View File

@@ -112,7 +112,7 @@ function WorkerTest(worker, name, test) {
// We expect only boolean responses from the worker script.
worker.onmessage = e => this.complete(e.data);
worker.onerror = e => this.complete(false);
worker.onerror = () => this.complete(false);
};
var base = new Test(name, test);

View File

@@ -31,7 +31,7 @@ function memcmp_complete(test, value) {
};
}
function error(test) {
function error() {
return function (x) {
throw x;
};

View File

@@ -56,7 +56,7 @@ TestArray.addTest(
crypto.subtle.importKey("raw", tv.raw, alg, true, ["encrypt"])
.then(
error(that),
complete(that, function(x) { return true; })
complete(that, function() { return true; })
);
}
);
@@ -982,7 +982,7 @@ TestArray.addTest(
.then(doVerify)
.then(
error(that),
complete(that, function(x) { return true; })
complete(that, function() { return true; })
);
}
);

View File

@@ -61,7 +61,7 @@ TestArray.addTest(
function setKeyPair(x) { pair = x; }
function doDerive(n) {
return function(x) {
return function() {
return crypto.subtle.deriveBits({ name: "ECDH", public: pair.publicKey }, pair.privateKey, n * 8);
};
}

View File

@@ -76,7 +76,7 @@ TestArray.addTest(
function doVerify(x) {
return crypto.subtle.verify(alg.name, x, tv.rsassa.sig256, tv.rsassa.data);
}
function fail(x) { error(that); }
function fail() { error(that); }
crypto.subtle.importKey("jwk", tv.rsassa.jwk_pub, alg, false, ["verify"])
.then( doVerify, fail )

View File

@@ -59,7 +59,7 @@ function runTextDecoderOptions() {
* - This function is not testing the decode function.
*
*/
function testConstructorFatalOption(data, expectedString) {
function testConstructorFatalOption() {
//invalid string to decode passed, fatal = false
testCharset({
fatal: false,

View File

@@ -3,7 +3,7 @@
// eslint-disable-next-line mozilla/reject-importGlobalProperties
Cu.importGlobalProperties(["File"]);
addMessageListener("file.open", function (e) {
addMessageListener("file.open", function () {
var testFile = Services.dirsvc
.QueryInterface(Ci.nsIProperties)
.get("ProfD", Ci.nsIFile);
@@ -29,7 +29,7 @@ addMessageListener("file.open", function (e) {
});
});
addMessageListener("emptyfile.open", function (e) {
addMessageListener("emptyfile.open", function () {
var testFile = Services.dirsvc
.QueryInterface(Ci.nsIProperties)
.get("ProfD", Ci.nsIFile);

View File

@@ -3,7 +3,7 @@
Cu.importGlobalProperties(["File", "Directory"]);
var tmpFile, tmpDir;
addMessageListener("entries.open", function (e) {
addMessageListener("entries.open", function () {
tmpFile = Services.dirsvc
.QueryInterface(Ci.nsIProperties)
.get("TmpD", Ci.nsIFile);
@@ -40,7 +40,7 @@ addMessageListener("entries.open", function (e) {
});
});
addMessageListener("entries.delete", function (e) {
addMessageListener("entries.delete", function () {
tmpFile.remove(true);
tmpDir.remove(true);
sendAsyncMessage("entries.deleted");

View File

@@ -168,7 +168,7 @@ function test_directoryEntry_getFile_simple() {
function(e) {
is(e.name, "foo.txt", "We have the right FileEntry.");
test_getParent(e, directoryEntry, /* nested */ false);
}, function(e) {
}, function() {
ok(false, "This should not happen.");
});
}
@@ -178,7 +178,7 @@ function test_directoryEntry_getFile_deep() {
function(e) {
is(e.name, "bar..txt", "We have the right FileEntry.");
test_getParent(e, directoryEntry, /* nested */ true);
}, function(e) {
}, function() {
ok(false, "This should not happen.");
});
}
@@ -228,7 +228,7 @@ function test_directoryEntry_getDirectory_simple() {
function(e) {
is(e.name, "subdir", "We have the right DirectoryEntry.");
test_getParent(e, directoryEntry, /* nested */ false);
}, function(e) {
}, function() {
ok(false, "This should not happen.");
});
}
@@ -238,7 +238,7 @@ function test_directoryEntry_getDirectory_deep() {
function(e) {
is(e.name, "subsubdir", "We have the right DirectoryEntry.");
test_getParent(e, directoryEntry, /* nested */ true);
}, function(e) {
}, function() {
ok(false, "This should not happen.");
});
}
@@ -308,7 +308,7 @@ function test_root_getFile_simple() {
function(e) {
is(e.name, fileEntry.name, "We have the right FileEntry.");
next();
}, function(e) {
}, function() {
ok(false, "This should not happen.");
});
}
@@ -318,7 +318,7 @@ function test_root_getFile_deep() {
function(e) {
is(e.name, "bar..txt", "We have the right FileEntry.");
next();
}, function(e) {
}, function() {
ok(false, "This should not happen.");
});
}
@@ -368,7 +368,7 @@ function test_root_getDirectory_simple() {
function(e) {
is(e.name, directoryEntry.name, "We have the right DirectoryEntry.");
next();
}, function(e) {
}, function() {
ok(false, "This should not happen.");
});
}
@@ -378,7 +378,7 @@ function test_root_getDirectory_deep() {
function(e) {
is(e.name, "subsubdir", "We have the right DirectoryEntry.");
next();
}, function(e) {
}, function() {
ok(false, "This should not happen.");
});
}
@@ -402,7 +402,7 @@ function test_getParent(entry, parentEntry, nested) {
} else {
test_getParent(e, parentEntry, false);
}
}, function(e) {
}, function() {
ok(false, "This should not happen.");
});
}

View File

@@ -153,7 +153,7 @@ addMessageListener("dir.open", function (e) {
});
});
addMessageListener("file.open", function (e) {
addMessageListener("file.open", function () {
var testFile = Services.dirsvc
.QueryInterface(Ci.nsIProperties)
.get("ProfD", Ci.nsIFile);
@@ -164,7 +164,7 @@ addMessageListener("file.open", function (e) {
});
});
addMessageListener("symlink.open", function (e) {
addMessageListener("symlink.open", function () {
let testDir = createTestFile();
let testFile = testDir.clone();
testFile.append("subdir");

View File

@@ -2,17 +2,17 @@
let dialogObserverTopic = "common-dialog-loaded";
function dialogObserver(subj, topic, data) {
function dialogObserver(subj) {
subj.document.querySelector("dialog").acceptDialog();
sendAsyncMessage("promptAccepted");
}
addMessageListener("init", message => {
addMessageListener("init", () => {
Services.obs.addObserver(dialogObserver, dialogObserverTopic);
sendAsyncMessage("initDone");
});
addMessageListener("cleanup", message => {
addMessageListener("cleanup", () => {
Services.obs.removeObserver(dialogObserver, dialogObserverTopic);
sendAsyncMessage("cleanupDone");
});

View File

@@ -40,7 +40,7 @@ function create_fileList(aPath) {
script.sendAsyncMessage("dir.open", { path: aPath });
}
function test_simpleFilePicker(aPath) {
function test_simpleFilePicker() {
var url = SimpleTest.getTestFileURL("script_fileList.js");
var script = SpecialPowers.loadChromeScript(url);

View File

@@ -3,7 +3,7 @@
<body>
<script>
function createDb() {
return new Promise((resolve, reject) => {
return new Promise((resolve) => {
const openRequest = indexedDB.open("test-abort-on-reload", 1);
openRequest.onsuccess = () => {
const db = openRequest.result;
@@ -14,7 +14,7 @@
};
resolve();
};
openRequest.onupgradeneeded = (evt) => {
openRequest.onupgradeneeded = () => {
// Interrupt upgrade
window.location.reload();
opener.info('reload requested\n');
@@ -24,7 +24,7 @@
}
function reset() {
return new Promise((resolve, reject) => {
return new Promise((resolve) => {
const request = indexedDB.deleteDatabase("test-abort-on-reload");
request.onsuccess = resolve;
});

View File

@@ -6,7 +6,7 @@
request.onupgradeneeded = function(e) {
var db = e.target.result;
// This should never be called
db.onversionchange = function(e) {
db.onversionchange = function() {
db.transaction(["mystore"]).objectStore("mystore").put({ hello: "fail" }, 42);
};
var trans = e.target.transaction;

View File

@@ -80,7 +80,7 @@ dump("EXCEPTION IN CREATION: " + e + "\n " + e.stack + "\n");
objectStore.delete(42).onsuccess = closeDBTellOwningThread;
}
function closeDBTellOwningThread(event) {
function closeDBTellOwningThread() {
// Now that worker has latched the blob, clean up the database.
db.close();
db = null;

View File

@@ -12,7 +12,7 @@ async function idbCheckFunc() {
try {
console.log("opening db");
const req = factory.open("db", 1);
const result = await new Promise((resolve, reject) => {
const result = await new Promise(resolve => {
req.onerror = () => {
resolve("error");
};
@@ -21,7 +21,7 @@ async function idbCheckFunc() {
resolve("created");
};
// ...so this will lose the race
req.onsuccess = event => {
req.onsuccess = () => {
resolve("already-exists");
};
});

View File

@@ -6,7 +6,7 @@ const nsIQuotaManagerService = Ci.nsIQuotaManagerService;
var gURI = Services.io.newURI("http://localhost");
function onUsageCallback(request) {}
function onUsageCallback() {}
function onLoad() {
var quotaManagerService = Cc[

View File

@@ -29,7 +29,7 @@
finishTest();
}
function unexpectedSuccessHandler(event) {
function unexpectedSuccessHandler() {
ok(false, "got success when it was not expected!");
finishTest();
}
@@ -43,7 +43,7 @@
}, 0);
}
window.onerror = function(message, filename, lineno) {
window.onerror = function(message) {
is(message, "ConstraintError", "Expect a constraint error");
};
@@ -82,7 +82,7 @@
request = objectStore.add({}, 1);
request.onsuccess = unexpectedSuccessHandler;
request.onerror = function(event) {
request.onerror = function() {
// Don't do anything! ConstraintError is expected in window.onerror.
};
event = yield undefined;

View File

@@ -101,7 +101,7 @@
event = yield undefined;
request = objectStore.add({}, 1);
request.onsuccess = function(event) {
request.onsuccess = function() {
ok(false, "Did not expect second add to succeed.");
};
request.onerror = errorEventCounter;
@@ -119,7 +119,7 @@
event = yield undefined;
request = objectStore.add({}, 1);
request.onsuccess = function(event) {
request.onsuccess = function() {
ok(false, "Did not expect second add to succeed.");
};
request.onerror = errorEventCounter;

View File

@@ -31,7 +31,7 @@
finishTest();
}
function unexpectedSuccessHandler(event) {
function unexpectedSuccessHandler() {
ok(false, "got success when it was not expected!");
finishTest();
}
@@ -105,7 +105,7 @@
ok(db.objectStoreNames.contains("foo"), "Has correct objectStore");
request = objectStore.add({}, 1);
request.onsuccess = function(event) {
request.onsuccess = function() {
throw new Error("foo");
};

View File

@@ -74,7 +74,7 @@ function triggerSecondaryCommand(popup, win) {
EventUtils.synthesizeMouseAtCenter(notification.secondaryButton, {}, win);
}
function dismissNotification(popup) {
function dismissNotification() {
info("dismissing notification");
executeSoon(function () {
EventUtils.synthesizeKey("KEY_Escape");

View File

@@ -484,7 +484,7 @@ function workerScript() {
self.executeSoon = function (_fun_) {
var channel = new MessageChannel();
channel.port1.postMessage("");
channel.port2.onmessage = function (event) {
channel.port2.onmessage = function () {
_fun_();
};
};

View File

@@ -23,7 +23,7 @@ function madeMod() {
parent.postMessage("didcommit", "*");
};
store.put({ hello: "officer" }, 42).onsuccess = function(e) {
store.put({ hello: "officer" }, 42).onsuccess = function() {
// Make this transaction run until the end of time or until the page is
// navigated away, whichever comes first.
function doGet() {

View File

@@ -17,7 +17,7 @@
openedWindow = window.open("abort_on_reload.html");
}
function messageListener(event) {
function messageListener() {
ok(true, "reload recorded");
if (++reloads == 20) {

View File

@@ -37,7 +37,7 @@ async function useIDB(contentWindow) {
store.get(0).onsuccess = spin;
}
store.put(0, "purgatory").onsuccess = e => {
store.put(0, "purgatory").onsuccess = () => {
contentWindow.putCount += 1;
spin();
};

View File

@@ -14,7 +14,7 @@
let iframe = document.getElementById("iframe1");
iframe.src = evt.data.iframeUrl;
iframe.addEventListener("load", e => {
iframe.addEventListener("load", () => {
iframe.contentWindow.postMessage(JSON.stringify(evt.data), "*");
});

View File

@@ -33,7 +33,7 @@ function* testSteps() {
let db = request.result;
is(db.version, 1, "Got version 1");
db.onversionchange = function (event) {
db.onversionchange = function () {
info("Closing database " + thisIndex);
db.close();
@@ -51,7 +51,7 @@ function* testSteps() {
request.onerror = errorHandler;
request.onsuccess = grabEventAndContinueHandler;
request.onblocked = function (event) {
request.onblocked = function () {
ok(false, "Should not receive a blocked event");
};
@@ -95,7 +95,7 @@ function* testSteps() {
let db = request.result;
is(db.version, 1, "Got version 1");
db.onversionchange = function (event) {
db.onversionchange = function () {
if (thisIndex == databaseCount - 1) {
info("Closing all databases with version 1");
@@ -121,7 +121,7 @@ function* testSteps() {
request.onerror = errorHandler;
request.onsuccess = grabEventAndContinueHandler;
request.onblocked = function (event) {
request.onblocked = function () {
ok(false, "Should not receive a blocked event");
};

View File

@@ -74,12 +74,12 @@ function* testSteps() {
event.stopPropagation();
};
trans.oncomplete = function (event) {
trans.oncomplete = function () {
i++;
j++;
testGenerator.next(true);
};
trans.onabort = function (event) {
trans.onabort = function () {
is(trans.error.name, "QuotaExceededError", "Reached quota limit");
testGenerator.next(false);
};

View File

@@ -70,7 +70,7 @@ function* testSteps() {
request = db.transaction("foo").objectStore("foo").openCursor();
request.onerror = errorHandler;
request.onsuccess = function (event) {
request.onsuccess = function () {
let cursor = request.result;
if (cursor) {
ok(false, "Shouldn't have any entries");

Some files were not shown because too many files have changed in this diff Show More