From 1a7d0e6a5d21f2f729cab42cb63ceb5ba96aeeed Mon Sep 17 00:00:00 2001 From: Geoff Brown Date: Wed, 28 Jun 2017 06:58:03 -0600 Subject: [PATCH] Bug 1375903 - Enable eslint on testing/talos - additional changes; r=jmaher --- .eslintignore | 1 + testing/talos/.eslintrc.js | 26 + testing/talos/talos/base_profile/prefs.js | 1 + testing/talos/talos/generate-tart-xpi.html | 1 + testing/talos/talos/generate-tresize-xpi.html | 1 + .../talos/talos/pageloader/chrome/Profiler.js | 2 +- .../talos/talos/pageloader/chrome/memory.js | 1 + .../talos/pageloader/chrome/pageloader.js | 10 +- .../talos/talos/pageloader/chrome/report.js | 4 +- .../talos/talos/pageloader/chrome/tscroll.js | 2 - .../talos/pageloader/components/tp-cmdline.js | 2 +- testing/talos/talos/scripts/talos-debug.js | 7 +- testing/talos/talos/scripts/xpigen.js | 11 +- testing/talos/talos/startup_test/tpaint.html | 4 +- .../tresize/addon/content/tresize.js | 2 +- .../chrome/talos-powers-content.js | 2 + .../components/TalosPowersService.js | 1 - testing/talos/talos/tests/a11y/a11y.js | 1 + testing/talos/talos/tests/a11y/dhtml.html | 1 + .../talos/talos/tests/a11y/tablemutation.html | 5 +- .../addon/content/addon-test-frontend.js | 2 + .../tests/devtools/addon/content/damp.html | 6 +- .../tests/devtools/addon/content/damp.js | 12 +- .../tests/perf-reftest/bloom-basic-ref.html | 1 + .../talos/tests/perf-reftest/bloom-basic.html | 1 + testing/talos/talos/tests/quit.js | 2 +- .../talos/talos/tests/tabpaint/bootstrap.js | 4 +- .../talos/talos/tests/tabswitch/bootstrap.js | 8 +- .../talos/tests/tart/addon/content/tart.html | 3 +- .../talos/tests/tart/addon/content/tart.js | 6 +- .../talos/tests/video/video_playback.html | 3 + .../webgl/benchmarks/terrain/perftest.html | 808 +++++++++--------- .../webgl/benchmarks/video/video_upload.html | 1 + 33 files changed, 493 insertions(+), 449 deletions(-) create mode 100644 testing/talos/.eslintrc.js diff --git a/.eslintignore b/.eslintignore index 415d52c8ab54..19a765f968be 100644 --- a/.eslintignore +++ b/.eslintignore @@ -306,6 +306,7 @@ testing/modules/sinon-2.3.2.js # octothorpe used for pref file comment causes parsing error testing/mozbase/mozprofile/tests/files/prefs_with_comments.js testing/talos/talos/scripts/jszip.min.js +testing/talos/talos/startup_test/sessionrestore/profile/sessionstore.js testing/talos/talos/tests/canvasmark/** testing/talos/talos/tests/dromaeo/** testing/talos/talos/tests/v8_7/** diff --git a/testing/talos/.eslintrc.js b/testing/talos/.eslintrc.js new file mode 100644 index 000000000000..d33aa34894a0 --- /dev/null +++ b/testing/talos/.eslintrc.js @@ -0,0 +1,26 @@ +"use strict"; + +module.exports = { + + globals: { + "Cc": false, + "Ci": false, + "Cu": false, + "content": true, + "dumpLog": false, + "netscape": false, + "addMessageListener": false, + "goQuitApplication": false, + "MozillaFileLogger": false, + "Profiler": true, + "Services": false, + "gBrowser": false, + "removeMessageListener": false, + "sendAsyncMessage": false, + "sendSyncMessage": false, + "TalosPowersContent": true, + "TalosPowersParent": true, + "TalosContentProfiler": true, + "tpRecordTime": true + } +}; diff --git a/testing/talos/talos/base_profile/prefs.js b/testing/talos/talos/base_profile/prefs.js index 9944e75f5b02..6c2922f6aa2d 100755 --- a/testing/talos/talos/base_profile/prefs.js +++ b/testing/talos/talos/base_profile/prefs.js @@ -2,6 +2,7 @@ // prefs in user.js don't get recognized until the second browser launch // which is too late for our purposes of using quit.js. Loading the principals // from prefs.js avoids this issue. +/* globals user_pref */ user_pref("capability.principal.codebase.p0.granted", "UniversalPreferencesWrite UniversalXPConnect UniversalPreferencesRead"); user_pref("capability.principal.codebase.p0.id", "file://"); user_pref("capability.principal.codebase.p0.subjectName", ""); diff --git a/testing/talos/talos/generate-tart-xpi.html b/testing/talos/talos/generate-tart-xpi.html index b79c7c38d516..c65e592c2ef5 100644 --- a/testing/talos/talos/generate-tart-xpi.html +++ b/testing/talos/talos/generate-tart-xpi.html @@ -11,6 +11,7 @@ diff --git a/testing/talos/talos/tests/devtools/addon/content/damp.js b/testing/talos/talos/tests/devtools/addon/content/damp.js index a122b7431563..15b76d25aca7 100644 --- a/testing/talos/talos/tests/devtools/addon/content/damp.js +++ b/testing/talos/talos/tests/devtools/addon/content/damp.js @@ -14,6 +14,8 @@ const webserver = Services.prefs.getCharPref("addon.test.damp.webserver"); const SIMPLE_URL = webserver + "/tests/devtools/addon/content/pages/simple.html"; const COMPLICATED_URL = webserver + "/tests/tp5n/bild.de/www.bild.de/index.html"; +/* globals res:true */ + function Damp() { // Path to the temp file where the heap snapshot file is saved. Set by // saveHeapSnapshot and read by readHeapSnapshot. @@ -32,9 +34,8 @@ Damp.prototype = { let tab = this._win.gBrowser.selectedTab = this._win.gBrowser.addTab(url); let browser = tab.linkedBrowser; browser.addEventListener("load", function onload() { - browser.removeEventListener("load", onload, true); resolve(tab); - }, true); + }, {capture: true, once: true}); }); }, @@ -47,14 +48,12 @@ Damp.prototype = { let startReloadTimestamp = performance.now(); return new Promise((resolve, reject) => { let browser = gBrowser.selectedBrowser; - let self = this; browser.addEventListener("load", function onload() { - browser.removeEventListener("load", onload, true); let stopReloadTimestamp = performance.now(); resolve({ time: stopReloadTimestamp - startReloadTimestamp }); - }, true); + }, {capture: true, once: true}); browser.reload(); }); }, @@ -181,8 +180,7 @@ Damp.prototype = { let TOTAL_MESSAGES = 100; let tab = yield this.testSetup(SIMPLE_URL); let messageManager = tab.linkedBrowser.messageManager; - let {toolbox} = yield this.openToolbox("webconsole"); - let webconsole = toolbox.getPanel("webconsole"); + yield this.openToolbox("webconsole"); // Load a frame script using a data URI so we can do logs // from the page. So this is running in content. diff --git a/testing/talos/talos/tests/perf-reftest/bloom-basic-ref.html b/testing/talos/talos/tests/perf-reftest/bloom-basic-ref.html index 67a6a8aa2d7c..65796bd58e54 100644 --- a/testing/talos/talos/tests/perf-reftest/bloom-basic-ref.html +++ b/testing/talos/talos/tests/perf-reftest/bloom-basic-ref.html @@ -3,6 +3,7 @@ diff --git a/testing/talos/talos/tests/webgl/benchmarks/terrain/perftest.html b/testing/talos/talos/tests/webgl/benchmarks/terrain/perftest.html index fbf588fd5919..7a90a12960c2 100644 --- a/testing/talos/talos/tests/webgl/benchmarks/terrain/perftest.html +++ b/testing/talos/talos/tests/webgl/benchmarks/terrain/perftest.html @@ -1,404 +1,404 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/testing/talos/talos/tests/webgl/benchmarks/video/video_upload.html b/testing/talos/talos/tests/webgl/benchmarks/video/video_upload.html index 937125db0799..bf4a88b72cdb 100644 --- a/testing/talos/talos/tests/webgl/benchmarks/video/video_upload.html +++ b/testing/talos/talos/tests/webgl/benchmarks/video/video_upload.html @@ -57,6 +57,7 @@ function reportResult(totalTime, totalTicks) { // Local run in a plain browser, display the formatted report alert("[talos glvideo result] " + text); + return undefined; }