Bug 1864896: Autofix unused function arguments (testing). r=webdriver-reviewers,perftest-reviewers,jmaher,devtools-reviewers,sparky

Differential Revision: https://phabricator.services.mozilla.com/D202990
This commit is contained in:
Dave Townsend 2024-03-05 14:21:16 +00:00
Родитель b8f4c2d785
Коммит 3918ef71d8
59 изменённых файлов: 148 добавлений и 169 удалений

Просмотреть файл

@ -10,7 +10,7 @@
var req = indexedDB.open(name, ver); var req = indexedDB.open(name, ver);
req.onerror = reject; req.onerror = reject;
req.onsuccess = (event) => { req.onsuccess = () => {
resolve(req.result); resolve(req.result);
}; };

Просмотреть файл

@ -17,7 +17,7 @@ function success(position) {
message.innerHTML += "<p>Altitude: " + position.coords.altitude + "</p>"; message.innerHTML += "<p>Altitude: " + position.coords.altitude + "</p>";
} }
function error(msg) { function error() {
let message = document.getElementById("status"); let message = document.getElementById("status");
message.innerHTML = "Failed to get geolocation."; message.innerHTML = "Failed to get geolocation.";
} }

Просмотреть файл

@ -704,7 +704,7 @@ export var BrowserTestUtils = {
* @resolves When STATE_START reaches the tab's progress listener * @resolves When STATE_START reaches the tab's progress listener
*/ */
browserStarted(browser, expectedURI) { browserStarted(browser, expectedURI) {
let testFn = function (aStateFlags, aStatus) { let testFn = function (aStateFlags) {
return ( return (
aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK && aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK &&
aStateFlags & Ci.nsIWebProgressListener.STATE_START aStateFlags & Ci.nsIWebProgressListener.STATE_START
@ -763,7 +763,7 @@ export var BrowserTestUtils = {
} else { } else {
urlMatches = urlToMatch => urlToMatch != "about:blank"; urlMatches = urlToMatch => urlToMatch != "about:blank";
} }
return new Promise((resolve, reject) => { return new Promise(resolve => {
tabbrowser.tabContainer.addEventListener( tabbrowser.tabContainer.addEventListener(
"TabOpen", "TabOpen",
function tabOpenListener(openEvent) { function tabOpenListener(openEvent) {
@ -829,15 +829,9 @@ export var BrowserTestUtils = {
* @resolves When onLocationChange fires. * @resolves When onLocationChange fires.
*/ */
waitForLocationChange(tabbrowser, url) { waitForLocationChange(tabbrowser, url) {
return new Promise((resolve, reject) => { return new Promise(resolve => {
let progressListener = { let progressListener = {
onLocationChange( onLocationChange(aBrowser, aWebProgress, aRequest, aLocationURI) {
aBrowser,
aWebProgress,
aRequest,
aLocationURI,
aFlags
) {
if ( if (
(url && aLocationURI.spec != url) || (url && aLocationURI.spec != url) ||
(!url && aLocationURI.spec == "about:blank") (!url && aLocationURI.spec == "about:blank")
@ -885,7 +879,7 @@ export var BrowserTestUtils = {
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let observe = async (win, topic, data) => { let observe = async (win, topic) => {
if (topic != "domwindowopened") { if (topic != "domwindowopened") {
return; return;
} }
@ -1002,7 +996,7 @@ export var BrowserTestUtils = {
*/ */
domWindowOpened(win, checkFn) { domWindowOpened(win, checkFn) {
return new Promise(resolve => { return new Promise(resolve => {
async function observer(subject, topic, data) { async function observer(subject, topic) {
if (topic == "domwindowopened" && (!win || subject === win)) { if (topic == "domwindowopened" && (!win || subject === win)) {
let observedWindow = subject; let observedWindow = subject;
if (checkFn && !(await checkFn(observedWindow))) { if (checkFn && !(await checkFn(observedWindow))) {
@ -1055,7 +1049,7 @@ export var BrowserTestUtils = {
*/ */
domWindowClosed(win) { domWindowClosed(win) {
return new Promise(resolve => { return new Promise(resolve => {
function observer(subject, topic, data) { function observer(subject, topic) {
if (topic == "domwindowclosed" && (!win || subject === win)) { if (topic == "domwindowclosed" && (!win || subject === win)) {
Services.ww.unregisterNotification(observer); Services.ww.unregisterNotification(observer);
resolve(subject); resolve(subject);
@ -1167,7 +1161,7 @@ export var BrowserTestUtils = {
win.gBrowser._insertBrowser(win.gBrowser.getTabForBrowser(browser)); win.gBrowser._insertBrowser(win.gBrowser.getTabForBrowser(browser));
}); });
let observer = (subject, topic, data) => { let observer = subject => {
if (browserSet.has(subject)) { if (browserSet.has(subject)) {
browserSet.delete(subject); browserSet.delete(subject);
} }
@ -1202,7 +1196,7 @@ export var BrowserTestUtils = {
return new Promise(resolve => { return new Promise(resolve => {
let browser = tab.linkedBrowser; let browser = tab.linkedBrowser;
let flushTopic = "sessionstore-browser-shutdown-flush"; let flushTopic = "sessionstore-browser-shutdown-flush";
let observer = (subject, topic, data) => { let observer = subject => {
if (subject === browser) { if (subject === browser) {
Services.obs.removeObserver(observer, flushTopic); Services.obs.removeObserver(observer, flushTopic);
// Wait for the next event tick to make sure other listeners are // Wait for the next event tick to make sure other listeners are
@ -1615,7 +1609,7 @@ export var BrowserTestUtils = {
} }
}, },
observe(subject, topic, data) { observe(subject, topic) {
switch (topic) { switch (topic) {
case "test-complete": case "test-complete":
this._cleanupContentEventListeners(); this._cleanupContentEventListeners();
@ -2054,7 +2048,7 @@ export var BrowserTestUtils = {
let expectedPromises = []; let expectedPromises = [];
let crashCleanupPromise = new Promise((resolve, reject) => { let crashCleanupPromise = new Promise((resolve, reject) => {
let observer = (subject, topic, data) => { let observer = (subject, topic) => {
if (topic != "ipc:content-shutdown") { if (topic != "ipc:content-shutdown") {
reject("Received incorrect observer topic: " + topic); reject("Received incorrect observer topic: " + topic);
return; return;
@ -2129,7 +2123,7 @@ export var BrowserTestUtils = {
if (shouldShowTabCrashPage) { if (shouldShowTabCrashPage) {
expectedPromises.push( expectedPromises.push(
new Promise((resolve, reject) => { new Promise(resolve => {
browser.addEventListener( browser.addEventListener(
"AboutTabCrashedReady", "AboutTabCrashedReady",
function onCrash() { function onCrash() {
@ -2187,7 +2181,7 @@ export var BrowserTestUtils = {
}); });
let sawNormalCrash = false; let sawNormalCrash = false;
let observer = (subject, topic, data) => { let observer = () => {
sawNormalCrash = true; sawNormalCrash = true;
}; };
@ -2232,7 +2226,7 @@ export var BrowserTestUtils = {
waitForAttribute(attr, element, value) { waitForAttribute(attr, element, value) {
let MutationObserver = element.ownerGlobal.MutationObserver; let MutationObserver = element.ownerGlobal.MutationObserver;
return new Promise(resolve => { return new Promise(resolve => {
let mut = new MutationObserver(mutations => { let mut = new MutationObserver(() => {
if ( if (
(!value && element.hasAttribute(attr)) || (!value && element.hasAttribute(attr)) ||
(value && element.getAttribute(attr) === value) (value && element.getAttribute(attr) === value)
@ -2263,7 +2257,7 @@ export var BrowserTestUtils = {
let MutationObserver = element.ownerGlobal.MutationObserver; let MutationObserver = element.ownerGlobal.MutationObserver;
return new Promise(resolve => { return new Promise(resolve => {
dump("Waiting for removal\n"); dump("Waiting for removal\n");
let mut = new MutationObserver(mutations => { let mut = new MutationObserver(() => {
if (!element.hasAttribute(attr)) { if (!element.hasAttribute(attr)) {
resolve(); resolve();
mut.disconnect(); mut.disconnect();

Просмотреть файл

@ -14,7 +14,7 @@ function AboutPage(aboutHost, chromeURL, uriFlags) {
AboutPage.prototype = { AboutPage.prototype = {
QueryInterface: ChromeUtils.generateQI(["nsIAboutModule"]), QueryInterface: ChromeUtils.generateQI(["nsIAboutModule"]),
getURIFlags(aURI) { getURIFlags() {
// eslint-disable-line no-unused-vars // eslint-disable-line no-unused-vars
return this.uriFlags; return this.uriFlags;
}, },

Просмотреть файл

@ -26,7 +26,7 @@ const windowTracker = {
Services.obs.addObserver(this, "chrome-document-global-created"); Services.obs.addObserver(this, "chrome-document-global-created");
}, },
async observe(window, topic, data) { async observe(window, topic) {
if (topic === "chrome-document-global-created") { if (topic === "chrome-document-global-created") {
await new Promise(resolve => await new Promise(resolve =>
window.addEventListener("DOMContentLoaded", resolve, { once: true }) window.addEventListener("DOMContentLoaded", resolve, { once: true })

Просмотреть файл

@ -13,7 +13,7 @@ add_task(async function () {
gBrowser, gBrowser,
url: "about:blank", url: "about:blank",
}, },
async function (browser) { async function () {
ok(true, "Collecting baseline coverage for browser-chrome tests."); ok(true, "Collecting baseline coverage for browser-chrome tests.");
await new Promise(c => setTimeout(c, 30 * 1000)); await new Promise(c => setTimeout(c, 30 * 1000));
} }

Просмотреть файл

@ -45,7 +45,7 @@ var TabDestroyObserver = {
Services.obs.removeObserver(this, "message-manager-disconnect"); Services.obs.removeObserver(this, "message-manager-disconnect");
}, },
observe(subject, topic, data) { observe(subject, topic) {
if (topic == "message-manager-close") { if (topic == "message-manager-close") {
this.outstanding.add(subject); this.outstanding.add(subject);
} else if (topic == "message-manager-disconnect") { } else if (topic == "message-manager-disconnect") {
@ -516,7 +516,7 @@ Tester.prototype = {
this.SimpleTest.waitForFocus(aCallback); this.SimpleTest.waitForFocus(aCallback);
}, },
finish: function Tester_finish(aSkipSummary) { finish: function Tester_finish() {
var passCount = this.tests.reduce((a, f) => a + f.passCount, 0); var passCount = this.tests.reduce((a, f) => a + f.passCount, 0);
var failCount = this.tests.reduce((a, f) => a + f.failCount, 0); var failCount = this.tests.reduce((a, f) => a + f.failCount, 0);
var todoCount = this.tests.reduce((a, f) => a + f.todoCount, 0); var todoCount = this.tests.reduce((a, f) => a + f.todoCount, 0);
@ -564,7 +564,7 @@ Tester.prototype = {
this.repeat = 0; this.repeat = 0;
}, },
observe: function Tester_observe(aSubject, aTopic, aData) { observe: function Tester_observe(aSubject, aTopic) {
if (!aTopic) { if (!aTopic) {
this.onConsoleMessage(aSubject); this.onConsoleMessage(aSubject);
} }

Просмотреть файл

@ -215,7 +215,7 @@ function createMochitestServer(serverBasePath) {
}); });
return file; return file;
}, },
QueryInterface(aIID) { QueryInterface() {
return this; return this;
}, },
}; };

Просмотреть файл

@ -6,7 +6,7 @@ addMessageListener("foo", function (message) {
sendAsyncMessage("bar", message); sendAsyncMessage("bar", message);
}); });
addMessageListener("valid-assert", function (message) { addMessageListener("valid-assert", function () {
assert.ok(true, "valid assertion"); assert.ok(true, "valid assertion");
assert.equal(1, 1, "another valid assertion"); assert.equal(1, 1, "another valid assertion");
sendAsyncMessage("valid-assert-done"); sendAsyncMessage("valid-assert-done");

Просмотреть файл

@ -14,11 +14,11 @@
<script class="testbody" type="text/javascript"> <script class="testbody" type="text/javascript">
var eventCount = 0; var eventCount = 0;
function testEventListener(e) { function testEventListener() {
++eventCount; ++eventCount;
} }
function testEventListener2(e) { function testEventListener2() {
++eventCount; ++eventCount;
} }

Просмотреть файл

@ -37,7 +37,7 @@ function endOfFirstTest() {
// that is used to run the chrome script. // that is used to run the chrome script.
script2 = SpecialPowers.loadChromeScript(_ => { script2 = SpecialPowers.loadChromeScript(_ => {
/* eslint-env mozilla/chrome-script */ /* eslint-env mozilla/chrome-script */
addMessageListener("valid-assert", function (message) { addMessageListener("valid-assert", function () {
assert.equal(typeof XMLHttpRequest, "function", "XMLHttpRequest is defined"); assert.equal(typeof XMLHttpRequest, "function", "XMLHttpRequest is defined");
assert.equal(typeof CSS, "undefined", "CSS is not defined"); assert.equal(typeof CSS, "undefined", "CSS is not defined");
sendAsyncMessage("valid-assert-done"); sendAsyncMessage("valid-assert-done");

Просмотреть файл

@ -22,7 +22,7 @@ var script = SpecialPowers.loadChromeScript(function loadChromeScriptTest() {
sendAsyncMessage("bar", message); sendAsyncMessage("bar", message);
}); });
addMessageListener("valid-assert", function (message) { addMessageListener("valid-assert", function () {
assert.ok(true, "valid assertion"); assert.ok(true, "valid assertion");
assert.equal(1, 1, "another valid assertion"); assert.equal(1, 1, "another valid assertion");
sendAsyncMessage("valid-assert-done"); sendAsyncMessage("valid-assert-done");

Просмотреть файл

@ -23,7 +23,7 @@
is(f.type, fileType, "File should have the specified type"); is(f.type, fileType, "File should have the specified type");
test2(); test2();
}, },
function (msg) { ok(false, "Should be able to create a file without an error"); test2(); } function () { ok(false, "Should be able to create a file without an error"); test2(); }
); );
} }
@ -36,7 +36,7 @@
SpecialPowers.createFiles([{name: "/\/\/\/\/\/\/\/\/\/\/\invalidname",}], SpecialPowers.createFiles([{name: "/\/\/\/\/\/\/\/\/\/\/\invalidname",}],
function () { test3Check(false); }, function () { test3Check(false); },
function (msg) { test3Check(true); } function () { test3Check(true); }
); );
} }
@ -75,7 +75,7 @@
ok(f.name, "test4 test file should have a name"); ok(f.name, "test4 test file should have a name");
SimpleTest.finish(); SimpleTest.finish();
}, },
function (msg) { function () {
ok(false, "Should be able to create a file without a name without an error"); ok(false, "Should be able to create a file without a name without an error");
SimpleTest.finish(); SimpleTest.finish();
} }

Просмотреть файл

@ -247,7 +247,7 @@ function starttest() {
/* test synthesizeMouse* */ /* test synthesizeMouse* */
//focus trick enables us to run this in iframes //focus trick enables us to run this in iframes
$("radioTarget1").addEventListener('focus', function (aEvent) { $("radioTarget1").addEventListener('focus', function () {
synthesizeMouse($("radioTarget1"), 1, 1, {}); synthesizeMouse($("radioTarget1"), 1, 1, {});
is($("radioTarget1").checked, true, "synthesizeMouse should work") is($("radioTarget1").checked, true, "synthesizeMouse should work")
$("radioTarget1").checked = false; $("radioTarget1").checked = false;
@ -260,7 +260,7 @@ function starttest() {
$("radioTarget1").focus(); $("radioTarget1").focus();
//focus trick enables us to run this in iframes //focus trick enables us to run this in iframes
$("textBoxA").addEventListener("focus", function (aEvent) { $("textBoxA").addEventListener("focus", function () {
check = false; check = false;
$("textBoxA").addEventListener("click", function() { check = true; }, { once: true }); $("textBoxA").addEventListener("click", function() { check = true; }, { once: true });
synthesizeMouseAtCenter($("textBoxA"), {}); synthesizeMouseAtCenter($("textBoxA"), {});

Просмотреть файл

@ -1405,13 +1405,10 @@ function synthesizeAndWaitNativeMouseMove(
); );
let eventRegisteredPromise = new Promise(resolve => { let eventRegisteredPromise = new Promise(resolve => {
mm.addMessageListener( mm.addMessageListener("Test:MouseMoveRegistered", function processed() {
"Test:MouseMoveRegistered", mm.removeMessageListener("Test:MouseMoveRegistered", processed);
function processed(message) { resolve();
mm.removeMessageListener("Test:MouseMoveRegistered", processed); });
resolve();
}
);
}); });
let eventReceivedPromise = ContentTask.spawn( let eventReceivedPromise = ContentTask.spawn(
browser, browser,
@ -1579,7 +1576,7 @@ function synthesizeAndWaitKey(
); );
let keyRegisteredPromise = new Promise(resolve => { let keyRegisteredPromise = new Promise(resolve => {
mm.addMessageListener("Test:KeyRegistered", function processed(message) { mm.addMessageListener("Test:KeyRegistered", function processed() {
mm.removeMessageListener("Test:KeyRegistered", processed); mm.removeMessageListener("Test:KeyRegistered", processed);
resolve(); resolve();
}); });
@ -3884,7 +3881,7 @@ class EventCounter {
// SpecialPowers is picky and needs to be passed an explicit reference to // SpecialPowers is picky and needs to be passed an explicit reference to
// the function to be called. To avoid having to bind "this", we therefore // the function to be called. To avoid having to bind "this", we therefore
// define the method this way, via a property. // define the method this way, via a property.
this.handleEvent = aEvent => { this.handleEvent = () => {
this.eventCount++; this.eventCount++;
}; };

Просмотреть файл

@ -48,7 +48,7 @@ LogController.extend = function (args, skip) {
}; };
/* logs message with given level. Currently used locally by log() and error() */ /* logs message with given level. Currently used locally by log() and error() */
LogController.logWithLevel = function (level, message /*, ...*/) { LogController.logWithLevel = function (level /*, ...*/) {
var msg = LogController.createLogMessage( var msg = LogController.createLogMessage(
level, level,
LogController.extend(arguments, 1) LogController.extend(arguments, 1)

Просмотреть файл

@ -384,7 +384,7 @@ function usesFailurePatterns() {
* @return {boolean} Whether a matched failure pattern is found. * @return {boolean} Whether a matched failure pattern is found.
*/ */
function recordIfMatchesFailurePattern(name, diag) { function recordIfMatchesFailurePattern(name, diag) {
let index = SimpleTest.expected.findIndex(([pat, count]) => { let index = SimpleTest.expected.findIndex(([pat]) => {
return ( return (
pat == null || pat == null ||
(typeof name == "string" && name.includes(pat)) || (typeof name == "string" && name.includes(pat)) ||

Просмотреть файл

@ -63,7 +63,7 @@ function extend(obj, /* optional */ skip) {
return ret; return ret;
} }
function flattenArguments(lst /* ...*/) { function flattenArguments(/* ...*/) {
var res = []; var res = [];
var args = extend(arguments); var args = extend(arguments);
while (args.length) { while (args.length) {

Просмотреть файл

@ -100,7 +100,7 @@
window.promiseAllPaintsDone = function (subdoc = null, flush = false) { window.promiseAllPaintsDone = function (subdoc = null, flush = false) {
var flushmode = flush ? FlushModes.FLUSH : FlushModes.NOFLUSH; var flushmode = flush ? FlushModes.FLUSH : FlushModes.NOFLUSH;
return new Promise(function (resolve, reject) { return new Promise(function (resolve) {
// The callback is given the components of the rect, but resolve() can // The callback is given the components of the rect, but resolve() can
// only be given one arg, so we turn it back into an array. // only be given one arg, so we turn it back into an array.
waitForPaints((l, r, t, b) => resolve([l, r, t, b]), subdoc, flushmode); waitForPaints((l, r, t, b) => resolve([l, r, t, b]), subdoc, flushmode);

Просмотреть файл

@ -247,7 +247,7 @@ TestRunner.logger.addListener(
var gTestList = []; var gTestList = [];
var RunSet = {}; var RunSet = {};
RunSet.runall = function (e) { RunSet.runall = function () {
// Filter tests to include|exclude tests based on data in params.filter. // Filter tests to include|exclude tests based on data in params.filter.
// This allows for including or excluding tests from the gTestList // This allows for including or excluding tests from the gTestList
// TODO Only used by ipc tests, remove once those are implemented sanely // TODO Only used by ipc tests, remove once those are implemented sanely
@ -265,7 +265,7 @@ RunSet.runall = function (e) {
} }
}; };
RunSet.runtests = function (e) { RunSet.runtests = function () {
// Which tests we're going to run // Which tests we're going to run
var my_tests = gTestList; var my_tests = gTestList;

Просмотреть файл

@ -34,7 +34,7 @@ export class MockRegistry {
QueryInterface: ChromeUtils.generateQI(["nsIWindowsRegKey"]), QueryInterface: ChromeUtils.generateQI(["nsIWindowsRegKey"]),
// --- Overridden nsIWindowsRegKey interface functions --- // --- Overridden nsIWindowsRegKey interface functions ---
open(root, path, mode) { open(root, path) {
let rootKey = registry.getRoot(root); let rootKey = registry.getRoot(root);
if (!rootKey.has(path)) { if (!rootKey.has(path)) {
rootKey.set(path, new Map()); rootKey.set(path, new Map());
@ -60,7 +60,7 @@ export class MockRegistry {
return this.values.has(name); return this.values.has(name);
}, },
getValueType(name) { getValueType() {
return Ci.nsIWindowsRegKey.TYPE_STRING; return Ci.nsIWindowsRegKey.TYPE_STRING;
}, },

Просмотреть файл

@ -207,33 +207,30 @@ export var TestUtils = {
*/ */
waitForPrefChange(prefName, checkFn) { waitForPrefChange(prefName, checkFn) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
Services.prefs.addObserver( Services.prefs.addObserver(prefName, function observer() {
prefName, try {
function observer(subject, topic, data) { let prefValue = null;
try { switch (Services.prefs.getPrefType(prefName)) {
let prefValue = null; case Services.prefs.PREF_STRING:
switch (Services.prefs.getPrefType(prefName)) { prefValue = Services.prefs.getStringPref(prefName);
case Services.prefs.PREF_STRING: break;
prefValue = Services.prefs.getStringPref(prefName); case Services.prefs.PREF_INT:
break; prefValue = Services.prefs.getIntPref(prefName);
case Services.prefs.PREF_INT: break;
prefValue = Services.prefs.getIntPref(prefName); case Services.prefs.PREF_BOOL:
break; prefValue = Services.prefs.getBoolPref(prefName);
case Services.prefs.PREF_BOOL: break;
prefValue = Services.prefs.getBoolPref(prefName);
break;
}
if (checkFn && !checkFn(prefValue)) {
return;
}
Services.prefs.removeObserver(prefName, observer);
resolve(prefValue);
} catch (ex) {
Services.prefs.removeObserver(prefName, observer);
reject(ex);
} }
if (checkFn && !checkFn(prefValue)) {
return;
}
Services.prefs.removeObserver(prefName, observer);
resolve(prefValue);
} catch (ex) {
Services.prefs.removeObserver(prefName, observer);
reject(ex);
} }
); });
}); });
}, },

Просмотреть файл

@ -68,7 +68,7 @@ function promiseBrowserLoaded(browser, url, redirectUrl) {
"nsIWebProgressListener", "nsIWebProgressListener",
]), ]),
onStateChange(webProgress, request, stateFlags, statusCode) { onStateChange(webProgress, request, stateFlags) {
request.QueryInterface(Ci.nsIChannel); request.QueryInterface(Ci.nsIChannel);
let requestURI = let requestURI =
@ -233,7 +233,7 @@ class ContentPage {
this.browser.messageManager.loadFrameScript(frameScript, false, true); this.browser.messageManager.loadFrameScript(frameScript, false, true);
} }
didChangeBrowserRemoteness(event) { didChangeBrowserRemoteness() {
// XXX: Tests can load their own additional frame scripts, so we may need to // XXX: Tests can load their own additional frame scripts, so we may need to
// track all scripts that have been loaded, and reload them here? // track all scripts that have been loaded, and reload them here?
this.loadFrameScript(frameScript); this.loadFrameScript(frameScript);

Просмотреть файл

@ -52,7 +52,7 @@ addEventListener("DOMContentLoaded", function () {
}); });
find_all(".sortable").forEach(function (elem) { find_all(".sortable").forEach(function (elem) {
elem.addEventListener("click", function (event) { elem.addEventListener("click", function () {
toggle_sort_states(elem); toggle_sort_states(elem);
var colIndex = toArray(elem.parentNode.childNodes).indexOf(elem); var colIndex = toArray(elem.parentNode.childNodes).indexOf(elem);
var key = elem.classList.contains("numeric") ? key_num : key_alpha; var key = elem.classList.contains("numeric") ? key_num : key_alpha;

Просмотреть файл

@ -4,7 +4,7 @@
/* eslint-env node */ /* eslint-env node */
"use strict"; "use strict";
async function test(context, commands) {} async function test() {}
module.exports = { module.exports = {
test, test,

Просмотреть файл

@ -69,7 +69,7 @@ function SPConsoleListener(callback, contentWindow) {
SPConsoleListener.prototype = { SPConsoleListener.prototype = {
// Overload the observe method for both nsIConsoleListener and nsIObserver. // Overload the observe method for both nsIConsoleListener and nsIObserver.
// The topic will be null for nsIConsoleListener. // The topic will be null for nsIConsoleListener.
observe(msg, topic) { observe(msg) {
let m = { let m = {
message: msg.message, message: msg.message,
errorMessage: null, errorMessage: null,
@ -162,7 +162,7 @@ export class SpecialPowersChild extends JSWindowActorChild {
); );
} }
observe(aSubject, aTopic, aData) { observe() {
// Ignore the "{chrome/content}-document-global-created" event. It // Ignore the "{chrome/content}-document-global-created" event. It
// is only observed to force creation of the actor. // is only observed to force creation of the actor.
} }
@ -1089,7 +1089,7 @@ export class SpecialPowersChild extends JSWindowActorChild {
} }
return val; return val;
} }
_getPref(prefName, prefType, { defaultValue }) { _getPref(prefName, prefType) {
switch (prefType) { switch (prefType) {
case "BOOL": case "BOOL":
return Services.prefs.getBoolPref(prefName); return Services.prefs.getBoolPref(prefName);
@ -1132,7 +1132,7 @@ export class SpecialPowersChild extends JSWindowActorChild {
removeAutoCompletePopupEventListener(window, eventname, listener) { removeAutoCompletePopupEventListener(window, eventname, listener) {
this._getAutoCompletePopup(window).removeEventListener(eventname, listener); this._getAutoCompletePopup(window).removeEventListener(eventname, listener);
} }
getFormFillController(window) { getFormFillController() {
return Cc["@mozilla.org/satchel/form-fill-controller;1"].getService( return Cc["@mozilla.org/satchel/form-fill-controller;1"].getService(
Ci.nsIFormFillController Ci.nsIFormFillController
); );
@ -1927,11 +1927,11 @@ export class SpecialPowersChild extends JSWindowActorChild {
return this.sendQuery("SPRemoveServiceWorkerDataForExampleDomain", {}); return this.sendQuery("SPRemoveServiceWorkerDataForExampleDomain", {});
} }
cleanUpSTSData(origin, flags) { cleanUpSTSData(origin) {
return this.sendQuery("SPCleanUpSTSData", { origin }); return this.sendQuery("SPCleanUpSTSData", { origin });
} }
async requestDumpCoverageCounters(cb) { async requestDumpCoverageCounters() {
// We want to avoid a roundtrip between child and parent. // We want to avoid a roundtrip between child and parent.
if (!lazy.PerTestCoverageUtils.enabled) { if (!lazy.PerTestCoverageUtils.enabled) {
return; return;
@ -1940,7 +1940,7 @@ export class SpecialPowersChild extends JSWindowActorChild {
await this.sendQuery("SPRequestDumpCoverageCounters", {}); await this.sendQuery("SPRequestDumpCoverageCounters", {});
} }
async requestResetCoverageCounters(cb) { async requestResetCoverageCounters() {
// We want to avoid a roundtrip between child and parent. // We want to avoid a roundtrip between child and parent.
if (!lazy.PerTestCoverageUtils.enabled) { if (!lazy.PerTestCoverageUtils.enabled) {
return; return;
@ -2275,7 +2275,7 @@ SpecialPowersChild.prototype._proxiedObservers = {
); );
}, },
"specialpowers-service-worker-shutdown": function (aMessage) { "specialpowers-service-worker-shutdown": function () {
Services.obs.notifyObservers(null, "specialpowers-service-worker-shutdown"); Services.obs.notifyObservers(null, "specialpowers-service-worker-shutdown");
}, },

Просмотреть файл

@ -247,7 +247,7 @@ export class SpecialPowersParent extends JSWindowActorParent {
swm.removeListener(this._serviceWorkerListener); swm.removeListener(this._serviceWorkerListener);
} }
observe(aSubject, aTopic, aData) { observe(aSubject, aTopic) {
function addDumpIDToMessage(propertyName) { function addDumpIDToMessage(propertyName) {
try { try {
var id = aSubject.getPropertyAsAString(propertyName); var id = aSubject.getPropertyAsAString(propertyName);

Просмотреть файл

@ -257,7 +257,7 @@ let SpecialPowersHandler = {
return Reflect.has(this.wrapped.get(target).obj, prop); return Reflect.has(this.wrapped.get(target).obj, prop);
}, },
get(target, prop, receiver) { get(target, prop) {
let global = Cu.getGlobalForObject(this); let global = Cu.getGlobalForObject(this);
return wrapExceptions(global, () => { return wrapExceptions(global, () => {
let obj = waiveXraysIfAppropriate(this.wrapped.get(target).obj, prop); let obj = waiveXraysIfAppropriate(this.wrapped.get(target).obj, prop);
@ -266,7 +266,7 @@ let SpecialPowersHandler = {
}); });
}, },
set(target, prop, val, receiver) { set(target, prop, val) {
return wrapExceptions(Cu.getGlobalForObject(this), () => { return wrapExceptions(Cu.getGlobalForObject(this), () => {
let obj = waiveXraysIfAppropriate(this.wrapped.get(target).obj, prop); let obj = waiveXraysIfAppropriate(this.wrapped.get(target).obj, prop);
return Reflect.set(obj, prop, unwrapIfWrapped(val)); return Reflect.set(obj, prop, unwrapIfWrapped(val));
@ -279,7 +279,7 @@ let SpecialPowersHandler = {
}); });
}, },
defineProperty(target, prop, descriptor) { defineProperty() {
throw new Error( throw new Error(
"Can't call defineProperty on SpecialPowers wrapped object" "Can't call defineProperty on SpecialPowers wrapped object"
); );
@ -332,7 +332,7 @@ let SpecialPowersHandler = {
return Cu.cloneInto(props, Cu.getGlobalForObject(this)); return Cu.cloneInto(props, Cu.getGlobalForObject(this));
}, },
preventExtensions(target) { preventExtensions() {
throw new Error( throw new Error(
"Can't call preventExtensions on SpecialPowers wrapped object" "Can't call preventExtensions on SpecialPowers wrapped object"
); );

10
testing/talos/talos/bootstrap.js поставляемый
Просмотреть файл

@ -27,7 +27,7 @@ const windowTracker = {
Services.ww.registerNotification(this); Services.ww.registerNotification(this);
}, },
async observe(window, topic, data) { async observe(window, topic) {
if (topic === "domwindowopened") { if (topic === "domwindowopened") {
await new Promise(resolve => await new Promise(resolve =>
window.addEventListener("DOMWindowCreated", resolve, { once: true }) window.addEventListener("DOMWindowCreated", resolve, { once: true })
@ -50,13 +50,13 @@ function readSync(uri) {
return new TextDecoder().decode(buffer); return new TextDecoder().decode(buffer);
} }
function startup(data, reason) { function startup(data) {
Services.scriptloader.loadSubScript( Services.scriptloader.loadSubScript(
data.resourceURI.resolve("content/initialize_browser.js") data.resourceURI.resolve("content/initialize_browser.js")
); );
windowTracker.init(); windowTracker.init();
} }
function shutdown(data, reason) {} function shutdown() {}
function install(data, reason) {} function install() {}
function uninstall(data, reason) {} function uninstall() {}

Просмотреть файл

@ -55,7 +55,7 @@
ensureAccessibleTreeForNode(node); ensureAccessibleTreeForNode(node);
} }
addEventListener("DOMContentLoaded", e => { addEventListener("DOMContentLoaded", () => {
Cu.exportFunction(initAccessibility, content, { Cu.exportFunction(initAccessibility, content, {
defineAs: "initAccessibility", defineAs: "initAccessibility",
}); });

Просмотреть файл

@ -8,8 +8,8 @@ function _contentHeroHandler(isload) {
var obs = null; var obs = null;
var el = content.window.document.querySelector("[elementtiming]"); var el = content.window.document.querySelector("[elementtiming]");
if (el) { if (el) {
function callback(entries, observer) { function callback(entries) {
entries.forEach(entry => { entries.forEach(() => {
sendAsyncMessage("PageLoader:LoadEvent", { sendAsyncMessage("PageLoader:LoadEvent", {
time: content.window.performance.now(), time: content.window.performance.now(),
name: "tphero", name: "tphero",

Просмотреть файл

@ -9,7 +9,7 @@ function _contentPaintHandler() {
if (utils.isMozAfterPaintPending) { if (utils.isMozAfterPaintPending) {
addEventListener( addEventListener(
"MozAfterPaint", "MozAfterPaint",
function afterpaint(e) { function afterpaint() {
removeEventListener("MozAfterPaint", afterpaint, true); removeEventListener("MozAfterPaint", afterpaint, true);
sendAsyncMessage("PageLoader:LoadEvent", {}); sendAsyncMessage("PageLoader:LoadEvent", {});
}, },

Просмотреть файл

@ -241,7 +241,7 @@ async function plInit() {
// pages should be able to load in the same mode as the initial page - due // pages should be able to load in the same mode as the initial page - due
// to this reinitialization on the switch. // to this reinitialization on the switch.
let tab = gBrowser.selectedTab; let tab = gBrowser.selectedTab;
tab.addEventListener("TabRemotenessChange", function (evt) { tab.addEventListener("TabRemotenessChange", function () {
loadFrameScripts(tab.linkedBrowser); loadFrameScripts(tab.linkedBrowser);
}); });
loadFrameScripts(tab.linkedBrowser); loadFrameScripts(tab.linkedBrowser);
@ -300,7 +300,7 @@ function plLoadPage() {
} }
let tab = gBrowser.selectedTab; let tab = gBrowser.selectedTab;
tab.addEventListener("TabRemotenessChange", evt => { tab.addEventListener("TabRemotenessChange", () => {
addMsgListeners(tab.linkedBrowser); addMsgListeners(tab.linkedBrowser);
}); });
addMsgListeners(tab.linkedBrowser); addMsgListeners(tab.linkedBrowser);
@ -581,13 +581,10 @@ function waitForPDFPaint() {
function forceContentGC() { function forceContentGC() {
return new Promise(resolve => { return new Promise(resolve => {
let mm = browserWindow.gBrowser.selectedBrowser.messageManager; let mm = browserWindow.gBrowser.selectedBrowser.messageManager;
mm.addMessageListener( mm.addMessageListener("Talos:ForceGC:OK", function onTalosContentForceGC() {
"Talos:ForceGC:OK", mm.removeMessageListener("Talos:ForceGC:OK", onTalosContentForceGC);
function onTalosContentForceGC(msg) { resolve();
mm.removeMessageListener("Talos:ForceGC:OK", onTalosContentForceGC); });
resolve();
}
);
mm.sendAsyncMessage("Talos:ForceGC"); mm.sendAsyncMessage("Talos:ForceGC");
}); });
} }

Просмотреть файл

@ -267,7 +267,7 @@ function testScroll(target, stepSize, opt_reportFunc, opt_numSteps) {
TalosPowersParent.exec("stopFrameTimeRecording", handle, cb, win); TalosPowersParent.exec("stopFrameTimeRecording", handle, cb, win);
} }
return new Promise(function (resolve, reject) { return new Promise(function (resolve) {
setSmooth(); setSmooth();
var handle = -1; var handle = -1;

Просмотреть файл

@ -28,7 +28,7 @@ this.sessionrestore = class extends ExtensionAPI {
this.run(); this.run();
} }
observe(subject, topic, data) { observe(subject, topic) {
if (topic == "browser-idle-startup-tasks-finished") { if (topic == "browser-idle-startup-tasks-finished") {
this.promiseIdleFinished.resolve(); this.promiseIdleFinished.resolve();
} }

Просмотреть файл

@ -27,7 +27,7 @@ this.startup_about_home_paint = class extends ExtensionAPI {
}); });
} }
observe(subject, topic, data) { observe(subject, topic) {
if (topic == "browser-idle-startup-tasks-finished") { if (topic == "browser-idle-startup-tasks-finished") {
this.checkForTelemetry(); this.checkForTelemetry();
} }

Просмотреть файл

@ -371,7 +371,7 @@ TalosPowersService.prototype = {
}, },
*/ */
ParentExecServices: { ParentExecServices: {
ping(arg, callback, win) { ping(arg, callback) {
callback(); callback();
}, },
@ -387,15 +387,15 @@ TalosPowersService.prototype = {
callback(rv); callback(rv);
}, },
requestDumpCoverageCounters(arg, callback, win) { requestDumpCoverageCounters(arg, callback) {
PerTestCoverageUtils.afterTest().then(callback); PerTestCoverageUtils.afterTest().then(callback);
}, },
requestResetCoverageCounters(arg, callback, win) { requestResetCoverageCounters(arg, callback) {
PerTestCoverageUtils.beforeTest().then(callback); PerTestCoverageUtils.beforeTest().then(callback);
}, },
dumpAboutSupport(arg, callback, win) { dumpAboutSupport(arg, callback) {
const { Troubleshoot } = ChromeUtils.importESModule( const { Troubleshoot } = ChromeUtils.importESModule(
"resource://gre/modules/Troubleshoot.sys.mjs" "resource://gre/modules/Troubleshoot.sys.mjs"
); );

Просмотреть файл

@ -35,7 +35,7 @@ addMessageListener("TalosContentProfiler:Response", msg => {
addEventListener( addEventListener(
"TalosPowersContentForceCCAndGC", "TalosPowersContentForceCCAndGC",
e => { () => {
Cu.forceGC(); Cu.forceGC();
Cu.forceCC(); Cu.forceCC();
Cu.forceShrinkingGC(); Cu.forceShrinkingGC();
@ -46,7 +46,7 @@ addEventListener(
addEventListener( addEventListener(
"TalosPowersContentFocus", "TalosPowersContentFocus",
e => { () => {
if ( if (
content.location.protocol != "file:" && content.location.protocol != "file:" &&
content.location.hostname != "localhost" && content.location.hostname != "localhost" &&
@ -72,7 +72,7 @@ addEventListener(
addEventListener( addEventListener(
"TalosPowersContentGetStartupInfo", "TalosPowersContentGetStartupInfo",
e => { () => {
sendAsyncMessage("TalosPowersContent:GetStartupInfo"); sendAsyncMessage("TalosPowersContent:GetStartupInfo");
addMessageListener( addMessageListener(
"TalosPowersContent:GetStartupInfo:Result", "TalosPowersContent:GetStartupInfo:Result",
@ -103,7 +103,7 @@ addEventListener(
addEventListener( addEventListener(
"TalosPowersContentDumpConsole", "TalosPowersContentDumpConsole",
e => { () => {
var messages; var messages;
try { try {
messages = Services.console.getMessageArray(); messages = Services.console.getMessageArray();
@ -147,7 +147,7 @@ addEventListener(
*/ */
addEventListener( addEventListener(
"TalosPowersWebRenderCapture", "TalosPowersWebRenderCapture",
e => { () => {
if (content && content.windowUtils) { if (content && content.windowUtils) {
content.windowUtils.wrCapture(); content.windowUtils.wrCapture();
} else { } else {

Просмотреть файл

@ -116,7 +116,7 @@ this.cpstartup = class extends ExtensionAPI {
removeTab(tab) { removeTab(tab) {
return new Promise(resolve => { return new Promise(resolve => {
let browser = tab.linkedBrowser; let browser = tab.linkedBrowser;
let observer = (subject, topic, data) => { let observer = subject => {
if (subject === browser) { if (subject === browser) {
Services.obs.removeObserver(observer, BROWSER_FLUSH_TOPIC); Services.obs.removeObserver(observer, BROWSER_FLUSH_TOPIC);
resolve(); resolve();

Просмотреть файл

@ -7,7 +7,7 @@
addEventListener( addEventListener(
"CPStartup:Ping", "CPStartup:Ping",
e => { () => {
let evt = new content.CustomEvent("CPStartup:Pong", { bubbles: true }); let evt = new content.CustomEvent("CPStartup:Pong", { bubbles: true });
content.dispatchEvent(evt); content.dispatchEvent(evt);
}, },

Просмотреть файл

@ -5,7 +5,7 @@
/* eslint-disable no-restricted-globals */ /* eslint-disable no-restricted-globals */
export class DampLoadChild extends JSWindowActorChild { export class DampLoadChild extends JSWindowActorChild {
handleEvent(evt) { handleEvent() {
this.sendAsyncMessage("DampLoadChild:PageShow", { this.sendAsyncMessage("DampLoadChild:PageShow", {
browsingContext: this.browsingContext, browsingContext: this.browsingContext,
}); });

Просмотреть файл

@ -216,7 +216,7 @@ Damp.prototype = {
return tab; return tab;
}, },
async testTeardown(url) { async testTeardown() {
// Disable closing animation to avoid intermittents and prevent having to wait for // Disable closing animation to avoid intermittents and prevent having to wait for
// animation's end. (See bug 1480953) // animation's end. (See bug 1480953)
this._win.gBrowser.removeCurrentTab({ animate: false }); this._win.gBrowser.removeCurrentTab({ animate: false });

Просмотреть файл

@ -145,7 +145,7 @@ async function stepDebuggerAndLog(dbg, tab, testFunction) {
} }
} }
async function testProjectSearch(dbg, tab) { async function testProjectSearch(dbg) {
dump("Executing project search\n"); dump("Executing project search\n");
const test = runTest(`custom.jsdebugger.project-search.DAMP`); const test = runTest(`custom.jsdebugger.project-search.DAMP`);
const firstSearchResultTest = runTest( const firstSearchResultTest = runTest(
@ -216,7 +216,7 @@ async function testPreview(dbg, tab, testFunction) {
await garbageCollect(); await garbageCollect();
} }
async function testOpeningLargeMinifiedFile(dbg, tab) { async function testOpeningLargeMinifiedFile(dbg) {
const fileFirstMinifiedChars = `(()=>{var e,t,n,r,o={82603`; const fileFirstMinifiedChars = `(()=>{var e,t,n,r,o={82603`;
dump("Open minified.js (large minified file)\n"); dump("Open minified.js (large minified file)\n");

Просмотреть файл

@ -352,13 +352,7 @@ async function removeBreakpoints(dbg) {
} }
exports.removeBreakpoints = removeBreakpoints; exports.removeBreakpoints = removeBreakpoints;
async function pauseDebugger( async function pauseDebugger(dbg, tab, testFunction, { line, file }) {
dbg,
tab,
testFunction,
{ line, file },
pauseOptions
) {
const { getSelectedLocation, isMapScopesEnabled } = dbg.selectors; const { getSelectedLocation, isMapScopesEnabled } = dbg.selectors;
const state = dbg.store.getState(); const state = dbg.store.getState();

Просмотреть файл

@ -114,7 +114,7 @@ function waitForDOMPredicate(
return Promise.resolve(rv); return Promise.resolve(rv);
} }
return new Promise(resolve => { return new Promise(resolve => {
const observer = new target.ownerGlobal.MutationObserver(mutations => { const observer = new target.ownerGlobal.MutationObserver(() => {
rv = predicate(); rv = predicate();
if (rv) { if (rv) {
resolve(rv); resolve(rv);

Просмотреть файл

@ -45,7 +45,7 @@ async function waitForAllRequestsFinished(
let payloadReady = 0; let payloadReady = 0;
let resolveWithLessThanMaxRequestsTimer = null; let resolveWithLessThanMaxRequestsTimer = null;
function onPayloadReady(_, id) { function onPayloadReady() {
payloadReady++; payloadReady++;
dump(`Waiting for ${maxExpectedRequests - payloadReady} requests\n`); dump(`Waiting for ${maxExpectedRequests - payloadReady} requests\n`);
maybeResolve(); maybeResolve();

Просмотреть файл

@ -12,7 +12,7 @@ class DampTestActor extends Actor {
super(conn, dampTestSpec); super(conn, dampTestSpec);
} }
testMethod(arg, { option }, arraySize) { testMethod(arg, { option }) {
// Emit an event with second argument's option. // Emit an event with second argument's option.
this.emit("testEvent", option); this.emit("testEvent", option);

Просмотреть файл

@ -67,7 +67,7 @@ module.exports = async function () {
bigObject["attribute-" + i] = bigString; bigObject["attribute-" + i] = bigString;
} }
let bigArray = Array.from({ length: ARRAY_SIZE }, (_, i) => bigObject); let bigArray = Array.from({ length: ARRAY_SIZE }, _ => bigObject);
// Open against options to avoid noise from tools // Open against options to avoid noise from tools
let toolbox = await openToolbox("options"); let toolbox = await openToolbox("options");

Просмотреть файл

@ -40,7 +40,7 @@ function waitForPayload(count, panelWin) {
return new Promise(resolve => { return new Promise(resolve => {
let payloadReady = 0; let payloadReady = 0;
function onPayloadReady(_, id) { function onPayloadReady() {
payloadReady++; payloadReady++;
maybeResolve(); maybeResolve();
} }

Просмотреть файл

@ -160,7 +160,7 @@ this.tabpaint = class extends ExtensionAPI {
* Resolves once the tab has been fully removed. Resolves * Resolves once the tab has been fully removed. Resolves
* with the time (in ms) it took to open the tab from content. * with the time (in ms) it took to open the tab from content.
*/ */
async openTabFromContent(gBrowser) { async openTabFromContent() {
TalosParentProfiler.subtestStart("TabPaint Content Start"); TalosParentProfiler.subtestStart("TabPaint Content Start");
let start_time = Cu.now(); let start_time = Cu.now();
@ -200,7 +200,7 @@ this.tabpaint = class extends ExtensionAPI {
TalosParentProfiler.mark("Tabpaint: Remove Tab"); TalosParentProfiler.mark("Tabpaint: Remove Tab");
return new Promise(resolve => { return new Promise(resolve => {
let browser = tab.linkedBrowser; let browser = tab.linkedBrowser;
let observer = (subject, topic, data) => { let observer = subject => {
if (subject === browser) { if (subject === browser) {
Services.obs.removeObserver(observer, BROWSER_FLUSH_TOPIC); Services.obs.removeObserver(observer, BROWSER_FLUSH_TOPIC);
resolve(); resolve();

Просмотреть файл

@ -3,7 +3,7 @@
(function () { (function () {
addEventListener( addEventListener(
"load", "load",
loadevt => { () => {
if (!content.location.pathname.endsWith("target.html")) { if (!content.location.pathname.endsWith("target.html")) {
return; return;
} }
@ -62,7 +62,7 @@
addEventListener( addEventListener(
"TabPaint:Ping", "TabPaint:Ping",
e => { () => {
let evt = new content.CustomEvent("TabPaint:Pong", { bubbles: true }); let evt = new content.CustomEvent("TabPaint:Pong", { bubbles: true });
content.dispatchEvent(evt); content.dispatchEvent(evt);
}, },
@ -79,7 +79,7 @@
true true
); );
addMessageListener("TabPaint:OpenFromContent", msg => { addMessageListener("TabPaint:OpenFromContent", () => {
let evt = new content.CustomEvent("TabPaint:OpenFromContent", { let evt = new content.CustomEvent("TabPaint:OpenFromContent", {
bubbles: true, bubbles: true,
}); });

Просмотреть файл

@ -13,7 +13,7 @@ function init() {
tpRecordTime([fromParent, fromContent].join(","), 0, "tabpaint-from-parent, tabpaint-from-content"); tpRecordTime([fromParent, fromContent].join(","), 0, "tabpaint-from-parent, tabpaint-from-content");
}, {once: true}); }, {once: true});
window.addEventListener("TabPaint:OpenFromContent", (event) => { window.addEventListener("TabPaint:OpenFromContent", () => {
let target = document.getElementById("target"); let target = document.getElementById("target");
//win.performance.now() + win.performance.timing.navigationStart gives the UNIX timestamp. //win.performance.now() + win.performance.timing.navigationStart gives the UNIX timestamp.

Просмотреть файл

@ -21,7 +21,7 @@ export class TalosTabSwitchChild extends RemotePageChild {
super.actorCreated(); super.actorCreated();
} }
handleEvent(event) {} handleEvent() {}
receiveMessage(message) { receiveMessage(message) {
if (message.name == "GarbageCollect") { if (message.name == "GarbageCollect") {

Просмотреть файл

@ -27,7 +27,7 @@ const TPSProcessScript = {
chan.originalURI = aURI; chan.originalURI = aURI;
return chan; return chan;
} }
getURIFlags(aURI) { getURIFlags() {
return ( return (
Ci.nsIAboutModule.ALLOW_SCRIPT | Ci.nsIAboutModule.ALLOW_SCRIPT |
Ci.nsIAboutModule.URI_MUST_LOAD_IN_CHILD | Ci.nsIAboutModule.URI_MUST_LOAD_IN_CHILD |

Просмотреть файл

@ -39,7 +39,7 @@ function content_focused() {
runTest(); runTest();
} }
function fullscreen(event) { function fullscreen() {
if ((document.fullscreenElement && document.fullscreenElement !== null) || if ((document.fullscreenElement && document.fullscreenElement !== null) ||
document.mozFullScreen) { document.mozFullScreen) {
startTest(); startTest();

Просмотреть файл

@ -188,7 +188,7 @@
const WARMUP_TIMESTAMPS = 30; // Must be at least 2 const WARMUP_TIMESTAMPS = 30; // Must be at least 2
const MEASURED_FRAMES = 100; const MEASURED_FRAMES = 100;
var gDoneCallback = function placeholder(intervals) {}; var gDoneCallback = function placeholder() {};
var gCurrentTimestamp = 0; var gCurrentTimestamp = 0;
var gResultTimestamps = []; var gResultTimestamps = [];
@ -202,7 +202,7 @@
}); });
} }
function draw(timestamp) { function draw() {
// It's possible that under some implementations (even if not our current one), // It's possible that under some implementations (even if not our current one),
// the rAF callback arg will be in some way "optimized", e.g. always point to the // the rAF callback arg will be in some way "optimized", e.g. always point to the
// estimated next vsync timestamp, in order to allow the callee to have less // estimated next vsync timestamp, in order to allow the callee to have less

Просмотреть файл

@ -19,7 +19,7 @@ browser.webRequest.onBeforeRequest.addListener(
let filter = browser.webRequest.filterResponseData(details.requestId); let filter = browser.webRequest.filterResponseData(details.requestId);
filter.onstop = event => { filter.onstop = () => {
filter.close(); filter.close();
}; };
filter.ondata = event => { filter.ondata = event => {
@ -48,7 +48,7 @@ browser.webRequest.onHeadersReceived.addListener(
["blocking", "responseHeaders"] ["blocking", "responseHeaders"]
); );
browser.webRequest.onErrorOccurred.addListener(details => {}, { browser.webRequest.onErrorOccurred.addListener(() => {}, {
urls: ["https://*/*", "http://*/*"], urls: ["https://*/*", "http://*/*"],
}); });
@ -73,7 +73,7 @@ browser.tabs.onUpdated.addListener((tabId, changed, tab) => {
}); });
}); });
browser.tabs.onActivated.addListener(({ tabId, windowId }) => { browser.tabs.onActivated.addListener(({ tabId }) => {
browser.pageAction.show(tabId); browser.pageAction.show(tabId);
}); });
@ -81,8 +81,8 @@ browser.tabs.onCreated.addListener(tab => {
browser.pageAction.show(tab.id); browser.pageAction.show(tab.id);
}); });
browser.tabs.onRemoved.addListener((tabId, removeInfo) => {}); browser.tabs.onRemoved.addListener(() => {});
browser.tabs.onAttached.addListener((tabId, attachInfo) => {}); browser.tabs.onAttached.addListener(() => {});
browser.tabs.onDetached.addListener((tabId, detachInfo) => {}); browser.tabs.onDetached.addListener(() => {});

Просмотреть файл

@ -434,7 +434,7 @@ function _setupDevToolsServer(breakpointFiles, callback) {
// Or when devtools are destroyed and we should stop observing. // Or when devtools are destroyed and we should stop observing.
"xpcshell-test-devtools-shutdown", "xpcshell-test-devtools-shutdown",
]; ];
let observe = function (subject, topic, data) { let observe = function (subject, topic) {
if (topic === "devtools-thread-ready") { if (topic === "devtools-thread-ready") {
const threadActor = subject.wrappedJSObject; const threadActor = subject.wrappedJSObject;
threadActor.setBreakpointOnLoad(breakpointFiles); threadActor.setBreakpointOnLoad(breakpointFiles);
@ -745,7 +745,7 @@ function _execute_test() {
* @param aFiles Array of files to load. * @param aFiles Array of files to load.
*/ */
function _load_files(aFiles) { function _load_files(aFiles) {
function load_file(element, index, array) { function load_file(element) {
try { try {
let startTime = Cu.now(); let startTime = Cu.now();
load(element); load(element);
@ -1829,7 +1829,7 @@ function run_next_test() {
} }
function frontLoadSetups() { function frontLoadSetups() {
_gTests.sort(([propsA, funcA], [propsB, funcB]) => { _gTests.sort(([propsA], [propsB]) => {
if (propsB.isSetup === propsA.isSetup) { if (propsB.isSetup === propsA.isSetup) {
return 0; return 0;
} }

Просмотреть файл

@ -56,7 +56,7 @@ var framer_module = node_http2_root + "/lib/protocol/framer";
var http2_framer = require(framer_module); var http2_framer = require(framer_module);
var Serializer = http2_framer.Serializer; var Serializer = http2_framer.Serializer;
var originalTransform = Serializer.prototype._transform; var originalTransform = Serializer.prototype._transform;
var newTransform = function (frame, encoding, done) { var newTransform = function (frame) {
if (frame.type == "DATA") { if (frame.type == "DATA") {
// Insert our empty DATA frame // Insert our empty DATA frame
const emptyFrame = {}; const emptyFrame = {};
@ -1757,7 +1757,7 @@ server.on("connection", function (socket) {
}); });
}); });
server.on("connect", function (req, clientSocket, head) { server.on("connect", function (req, clientSocket) {
clientSocket.write( clientSocket.write(
"HTTP/1.1 404 Not Found\r\nProxy-agent: Node.js-Proxy\r\n\r\n" "HTTP/1.1 404 Not Found\r\nProxy-agent: Node.js-Proxy\r\n\r\n"
); );