From 97787f6eaba0411c48f02f2992a75bff730df7c6 Mon Sep 17 00:00:00 2001 From: Victor Porof Date: Thu, 27 Jun 2019 17:27:33 +0200 Subject: [PATCH] Bug 1561435 - Fix linting errors for testing/, r=standard8 # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D35963 --HG-- extra : source : 7c8fead01ad5b68b81c2dfe3006eb497abb23f44 extra : intermediate-source : c900487402597c47ee28e088af19b4ad786df50f --- testing/specialpowers/content/SpecialPowersAPIParent.jsm | 2 +- testing/talos/talos/pageloader/chrome/lh_fnbpaint.js | 3 ++- testing/talos/talos/pageloader/chrome/lh_hero.js | 3 ++- testing/talos/talos/pageloader/chrome/lh_moz.js | 3 ++- testing/talos/talos/scripts/talos-debug.js | 2 +- .../talos/talos/talos-powers/chrome/talos-powers-content.js | 3 ++- testing/talos/talos/tests/tart/addon/content/framescript.js | 2 +- testing/talos/talos/tests/tresize/addon/content/framescript.js | 2 +- testing/xpcshell/head.js | 2 +- 9 files changed, 13 insertions(+), 9 deletions(-) diff --git a/testing/specialpowers/content/SpecialPowersAPIParent.jsm b/testing/specialpowers/content/SpecialPowersAPIParent.jsm index 667f57fa8955..ec3b03ce7d2c 100644 --- a/testing/specialpowers/content/SpecialPowersAPIParent.jsm +++ b/testing/specialpowers/content/SpecialPowersAPIParent.jsm @@ -452,8 +452,8 @@ class SpecialPowersAPIParent extends JSWindowActorParent { * messageManager callback function * This will get requests from our API in the window and process them in chrome for it **/ + // eslint-disable-next-line complexity receiveMessage(aMessage) { - // eslint-disable-line complexity // We explicitly return values in the below code so that this function // doesn't trigger a flurry of warnings about "does not always return // a value". diff --git a/testing/talos/talos/pageloader/chrome/lh_fnbpaint.js b/testing/talos/talos/pageloader/chrome/lh_fnbpaint.js index 7e17119f8b19..2918fda67238 100644 --- a/testing/talos/talos/pageloader/chrome/lh_fnbpaint.js +++ b/testing/talos/talos/pageloader/chrome/lh_fnbpaint.js @@ -36,6 +36,7 @@ function _contentFNBPaintHandler() { addEventListener( "load", + // eslint-disable-next-line no-undef contentLoadHandlerCallback(_contentFNBPaintHandler), true -); // eslint-disable-line no-undef +); diff --git a/testing/talos/talos/pageloader/chrome/lh_hero.js b/testing/talos/talos/pageloader/chrome/lh_hero.js index 7ec20bed7844..439b7bd9ef0f 100644 --- a/testing/talos/talos/pageloader/chrome/lh_hero.js +++ b/testing/talos/talos/pageloader/chrome/lh_hero.js @@ -41,6 +41,7 @@ function _contentHeroLoadHandler() { addEventListener( "load", + // eslint-disable-next-line no-undef contentLoadHandlerCallback(_contentHeroLoadHandler), true -); // eslint-disable-line no-undef +); diff --git a/testing/talos/talos/pageloader/chrome/lh_moz.js b/testing/talos/talos/pageloader/chrome/lh_moz.js index ad281eebf1c0..5bbdae6ea976 100644 --- a/testing/talos/talos/pageloader/chrome/lh_moz.js +++ b/testing/talos/talos/pageloader/chrome/lh_moz.js @@ -19,6 +19,7 @@ function _contentPaintHandler() { addEventListener( "load", + // eslint-disable-next-line no-undef contentLoadHandlerCallback(_contentPaintHandler), true -); // eslint-disable-line no-undef +); diff --git a/testing/talos/talos/scripts/talos-debug.js b/testing/talos/talos/scripts/talos-debug.js index 3b08026b1782..0d0cccd78daf 100644 --- a/testing/talos/talos/scripts/talos-debug.js +++ b/testing/talos/talos/scripts/talos-debug.js @@ -35,8 +35,8 @@ window.talosDebug = { median(values) { var clone = values.slice(0); - // eslint-disable-next-line no-nested-ternary var sorted = clone.sort(function(a, b) { + // eslint-disable-next-line no-nested-ternary return a > b ? 1 : a < b ? -1 : 0; }); var len = values.length; diff --git a/testing/talos/talos/talos-powers/chrome/talos-powers-content.js b/testing/talos/talos/talos-powers/chrome/talos-powers-content.js index b8ae56afa882..83ade58a3d2d 100644 --- a/testing/talos/talos/talos-powers/chrome/talos-powers-content.js +++ b/testing/talos/talos/talos-powers/chrome/talos-powers-content.js @@ -130,8 +130,9 @@ addEventListener( let uniqueMessageId = "TalosPowers:ParentExec:" + content.document.documentURI + + // eslint-disable-next-line mozilla/avoid-Date-timing Date.now() + - Math.random(); // eslint-disable-line mozilla/avoid-Date-timing + Math.random(); // Listener for the reply from the parent process addMessageListener("TalosPowers:ParentExec:ReplyMsg", function done(reply) { diff --git a/testing/talos/talos/tests/tart/addon/content/framescript.js b/testing/talos/talos/tests/tart/addon/content/framescript.js index 0c28669ca153..2b9630e3a5c9 100644 --- a/testing/talos/talos/tests/tart/addon/content/framescript.js +++ b/testing/talos/talos/tests/tart/addon/content/framescript.js @@ -29,8 +29,8 @@ return; } - // eslint-disable-next-line mozilla/avoid-Date-timing var uniqueMessageId = + // eslint-disable-next-line mozilla/avoid-Date-timing TART_PREFIX + content.document.documentURI + Date.now() + Math.random(); addMessageListener(TART_PREFIX + "chrome-exec-reply", function done( diff --git a/testing/talos/talos/tests/tresize/addon/content/framescript.js b/testing/talos/talos/tests/tresize/addon/content/framescript.js index a4995ae47256..4d81dff5541a 100644 --- a/testing/talos/talos/tests/tresize/addon/content/framescript.js +++ b/testing/talos/talos/tests/tresize/addon/content/framescript.js @@ -4,10 +4,10 @@ addEventListener( TRESIZE_PREFIX + "chrome-run-event", function(e) { - // eslint-disable-next-line mozilla/avoid-Date-timing var uniqueMessageId = TRESIZE_PREFIX + content.document.documentURI + + // eslint-disable-next-line mozilla/avoid-Date-timing Date.now() + Math.random(); diff --git a/testing/xpcshell/head.js b/testing/xpcshell/head.js index 102c3c23b11f..cf74b928082b 100644 --- a/testing/xpcshell/head.js +++ b/testing/xpcshell/head.js @@ -101,8 +101,8 @@ var runningInParent = true; try { // Don't use Services.appinfo here as it disables replacing appinfo with stubs // for test usage. - // eslint-disable-next-line mozilla/use-services runningInParent = + // eslint-disable-next-line mozilla/use-services Cc["@mozilla.org/xre/runtime;1"].getService(Ci.nsIXULRuntime).processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT; } catch (e) {}