From b3137951611bf1c102e0da8a2e4e14ec13543adb Mon Sep 17 00:00:00 2001 From: Surma Date: Thu, 28 Jul 2016 17:36:03 +0100 Subject: [PATCH] Revert gatherer changes --- lighthouse-core/driver/gatherers/screenshots.js | 7 +++---- lighthouse-core/driver/gatherers/speedline.js | 16 ++++++++-------- .../test/driver/gatherers/screenshots.js | 4 +--- .../test/driver/gatherers/speedline.js | 4 +--- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/lighthouse-core/driver/gatherers/screenshots.js b/lighthouse-core/driver/gatherers/screenshots.js index b8e630a5b74d..30a3f73a6f36 100644 --- a/lighthouse-core/driver/gatherers/screenshots.js +++ b/lighthouse-core/driver/gatherers/screenshots.js @@ -46,10 +46,9 @@ class ScreenshotFilmstrip extends Gather { } afterPass(options, tracingData) { - return this.getScreenshots(tracingData.traceContents) - .then(screenshots => { - this.artifact = screenshots; - }); + return this.getScreenshots(tracingData.traceContents).then(screenshots => { + this.artifact = screenshots; + }); } } diff --git a/lighthouse-core/driver/gatherers/speedline.js b/lighthouse-core/driver/gatherers/speedline.js index 5885f26ca756..7b7b233215a0 100644 --- a/lighthouse-core/driver/gatherers/speedline.js +++ b/lighthouse-core/driver/gatherers/speedline.js @@ -20,15 +20,15 @@ const Gather = require('./gather'); const speedline = require('speedline'); class Speedline extends Gather { + afterPass(options, tracingData) { - return speedline(tracingData.traceContents) - .then(results => { - this.artifact = results; - }).catch(err => { - this.artifact = { - debugString: err.message - }; - }); + return speedline(tracingData.traceContents).then(results => { + this.artifact = results; + }).catch(err => { + this.artifact = { + debugString: err.message + }; + }); } } diff --git a/lighthouse-core/test/driver/gatherers/screenshots.js b/lighthouse-core/test/driver/gatherers/screenshots.js index f879619679ce..39e2f4a69434 100644 --- a/lighthouse-core/test/driver/gatherers/screenshots.js +++ b/lighthouse-core/test/driver/gatherers/screenshots.js @@ -27,9 +27,7 @@ describe('Screenshot gatherer', () => { // Currently this test must rely on knowing the phase hook for the gatherer. // A little unfortunate, but we need a "run scheduler with this gatherer, this mocked driver, // and this trace" test class to do that right - return screenshotsGather.afterPass(undefined, { - traceContents: traceData - }).then(_ => { + return screenshotsGather.afterPass(undefined, {traceContents: traceData}).then(_ => { assert.ok(Array.isArray(screenshotsGather.artifact)); assert.equal(screenshotsGather.artifact.length, 7); diff --git a/lighthouse-core/test/driver/gatherers/speedline.js b/lighthouse-core/test/driver/gatherers/speedline.js index 984db30ddf58..d3b6bfccbda5 100644 --- a/lighthouse-core/test/driver/gatherers/speedline.js +++ b/lighthouse-core/test/driver/gatherers/speedline.js @@ -24,9 +24,7 @@ describe('Speedline gatherer', () => { it('returns an error debugString on faulty trace data', done => { const speedlineGather = new SpeedlineGather(); - speedlineGather.afterPass({}, { - traceContents: {boo: 'ya'} - }).then(_ => { + speedlineGather.afterPass({}, {traceContents: {boo: 'ya'}}).then(_ => { assert.ok(speedlineGather.artifact.debugString); assert.ok(speedlineGather.artifact.debugString.length); done();