From 35d03601b25fe518cfd7c5b5cd8bbc7b61fce5b4 Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Wed, 27 Jul 2016 17:40:49 -0700 Subject: [PATCH] move driver/ to gather/ rename gather/index.js to gather/gather-runner.js rename DriverBase class to Driver --- lighthouse-core/config/index.js | 9 +++--- .../{driver => gather}/drivers/cri.js | 0 .../{driver => gather}/drivers/driver.js | 6 ++-- .../{driver => gather}/drivers/extension.js | 0 .../index.js => gather/gather-runner.js} | 6 ++-- .../gatherers/accessibility.js | 0 .../gatherers/cache-contents.js | 0 .../gatherers/content-width.js | 0 .../gatherers/critical-request-chains.js | 0 .../{driver => gather}/gatherers/gather.js | 0 .../gatherers/geolocation-on-start.js | 0 .../gatherers/html-without-javascript.js | 0 .../{driver => gather}/gatherers/html.js | 0 .../gatherers/http-redirect.js | 0 .../{driver => gather}/gatherers/https.js | 0 .../{driver => gather}/gatherers/manifest.js | 0 .../{driver => gather}/gatherers/offline.js | 0 .../gatherers/screenshots.js | 0 .../gatherers/service-worker.js | 0 .../{driver => gather}/gatherers/speedline.js | 0 .../gatherers/theme-color.js | 0 .../{driver => gather}/gatherers/url.js | 0 .../{driver => gather}/gatherers/viewport.js | 0 lighthouse-core/index.js | 4 +-- lighthouse-core/runner.js | 6 ++-- .../test/audits/time-to-interactive.js | 2 +- .../test/{driver => gather}/fake-driver.js | 0 .../index.js => gather/gather-runner.js} | 32 +++++++++---------- .../gatherers/accessibility.js | 2 +- .../gatherers/cache-contents.js | 2 +- .../gatherers/content-width.js | 2 +- .../gatherers/critical-request-chains.js | 2 +- .../{driver => gather}/gatherers/gather.js | 2 +- .../gatherers/geolocation-on-start.js | 2 +- .../gatherers/html-without-javascript.js | 2 +- .../test/{driver => gather}/gatherers/html.js | 2 +- .../gatherers/http-redirect.js | 2 +- .../{driver => gather}/gatherers/https.js | 2 +- .../{driver => gather}/gatherers/manifest.js | 2 +- .../{driver => gather}/gatherers/offline.js | 2 +- .../gatherers/screenshots.js | 2 +- .../gatherers/service-worker.js | 2 +- .../{driver => gather}/gatherers/speedline.js | 2 +- .../gatherers/theme-color.js | 2 +- .../test/{driver => gather}/gatherers/url.js | 2 +- .../{driver => gather}/gatherers/viewport.js | 2 +- lighthouse-core/test/lib/drivers/driver.js | 2 +- lighthouse-core/test/runner.js | 2 +- .../app/src/lighthouse-background.js | 2 +- lighthouse-extension/gulpfile.js | 6 ++-- 50 files changed, 57 insertions(+), 56 deletions(-) rename lighthouse-core/{driver => gather}/drivers/cri.js (100%) rename lighthouse-core/{driver => gather}/drivers/driver.js (99%) rename lighthouse-core/{driver => gather}/drivers/extension.js (100%) rename lighthouse-core/{driver/index.js => gather/gather-runner.js} (98%) rename lighthouse-core/{driver => gather}/gatherers/accessibility.js (100%) rename lighthouse-core/{driver => gather}/gatherers/cache-contents.js (100%) rename lighthouse-core/{driver => gather}/gatherers/content-width.js (100%) rename lighthouse-core/{driver => gather}/gatherers/critical-request-chains.js (100%) rename lighthouse-core/{driver => gather}/gatherers/gather.js (100%) rename lighthouse-core/{driver => gather}/gatherers/geolocation-on-start.js (100%) rename lighthouse-core/{driver => gather}/gatherers/html-without-javascript.js (100%) rename lighthouse-core/{driver => gather}/gatherers/html.js (100%) rename lighthouse-core/{driver => gather}/gatherers/http-redirect.js (100%) rename lighthouse-core/{driver => gather}/gatherers/https.js (100%) rename lighthouse-core/{driver => gather}/gatherers/manifest.js (100%) rename lighthouse-core/{driver => gather}/gatherers/offline.js (100%) rename lighthouse-core/{driver => gather}/gatherers/screenshots.js (100%) rename lighthouse-core/{driver => gather}/gatherers/service-worker.js (100%) rename lighthouse-core/{driver => gather}/gatherers/speedline.js (100%) rename lighthouse-core/{driver => gather}/gatherers/theme-color.js (100%) rename lighthouse-core/{driver => gather}/gatherers/url.js (100%) rename lighthouse-core/{driver => gather}/gatherers/viewport.js (100%) rename lighthouse-core/test/{driver => gather}/fake-driver.js (100%) rename lighthouse-core/test/{driver/index.js => gather/gather-runner.js} (83%) rename lighthouse-core/test/{driver => gather}/gatherers/accessibility.js (97%) rename lighthouse-core/test/{driver => gather}/gatherers/cache-contents.js (97%) rename lighthouse-core/test/{driver => gather}/gatherers/content-width.js (96%) rename lighthouse-core/test/{driver => gather}/gatherers/critical-request-chains.js (99%) rename lighthouse-core/test/{driver => gather}/gatherers/gather.js (93%) rename lighthouse-core/test/{driver => gather}/gatherers/geolocation-on-start.js (96%) rename lighthouse-core/test/{driver => gather}/gatherers/html-without-javascript.js (97%) rename lighthouse-core/test/{driver => gather}/gatherers/html.js (97%) rename lighthouse-core/test/{driver => gather}/gatherers/http-redirect.js (97%) rename lighthouse-core/test/{driver => gather}/gatherers/https.js (96%) rename lighthouse-core/test/{driver => gather}/gatherers/manifest.js (97%) rename lighthouse-core/test/{driver => gather}/gatherers/offline.js (96%) rename lighthouse-core/test/{driver => gather}/gatherers/screenshots.js (96%) rename lighthouse-core/test/{driver => gather}/gatherers/service-worker.js (97%) rename lighthouse-core/test/{driver => gather}/gatherers/speedline.js (96%) rename lighthouse-core/test/{driver => gather}/gatherers/theme-color.js (96%) rename lighthouse-core/test/{driver => gather}/gatherers/url.js (96%) rename lighthouse-core/test/{driver => gather}/gatherers/viewport.js (96%) diff --git a/lighthouse-core/config/index.js b/lighthouse-core/config/index.js index 027d29c0085b..bd2a1a30fb43 100644 --- a/lighthouse-core/config/index.js +++ b/lighthouse-core/config/index.js @@ -18,9 +18,10 @@ const defaultConfig = require('./default.json'); const recordsFromLogs = require('../lib/network-recorder').recordsFromLogs; -const CriticalRequestChainsGatherer = require('../driver/gatherers/critical-request-chains'); -const SpeedlineGatherer = require('../driver/gatherers/speedline'); -const Driver = require('../driver'); +const CriticalRequestChainsGatherer = require('../gather/gatherers/critical-request-chains'); +const SpeedlineGatherer = require('../gather/gatherers/speedline'); + +const GatherRunner = require('../gather/gather-runner'); const log = require('../lib/log'); // cleanTrace is run to remove duplicate TracingStartedInPage events, @@ -115,7 +116,7 @@ function filterPasses(passes, audits) { freshPass.gatherers = freshPass.gatherers.filter(gatherer => { try { - const GathererClass = Driver.getGathererClass(gatherer); + const GathererClass = GatherRunner.getGathererClass(gatherer); return requiredGatherers.has(GathererClass.name); } catch (requireError) { throw new Error(`Unable to locate gatherer: ${gatherer}`); diff --git a/lighthouse-core/driver/drivers/cri.js b/lighthouse-core/gather/drivers/cri.js similarity index 100% rename from lighthouse-core/driver/drivers/cri.js rename to lighthouse-core/gather/drivers/cri.js diff --git a/lighthouse-core/driver/drivers/driver.js b/lighthouse-core/gather/drivers/driver.js similarity index 99% rename from lighthouse-core/driver/drivers/driver.js rename to lighthouse-core/gather/drivers/driver.js index 4ecfd60fc3f1..1ef21d7fd3c8 100644 --- a/lighthouse-core/driver/drivers/driver.js +++ b/lighthouse-core/gather/drivers/driver.js @@ -20,14 +20,14 @@ const NetworkRecorder = require('../../lib/network-recorder'); const emulation = require('../../lib/emulation'); const Element = require('../../lib/element'); -class DriverBase { +class Driver { constructor() { this._url = null; this.PAUSE_AFTER_LOAD = 500; this._chrome = null; this._traceEvents = []; - this._traceCategories = DriverBase.traceCategories; + this._traceCategories = Driver.traceCategories; } get url() { @@ -363,5 +363,5 @@ class DriverBase { } } -module.exports = DriverBase; +module.exports = Driver; diff --git a/lighthouse-core/driver/drivers/extension.js b/lighthouse-core/gather/drivers/extension.js similarity index 100% rename from lighthouse-core/driver/drivers/extension.js rename to lighthouse-core/gather/drivers/extension.js diff --git a/lighthouse-core/driver/index.js b/lighthouse-core/gather/gather-runner.js similarity index 98% rename from lighthouse-core/driver/index.js rename to lighthouse-core/gather/gather-runner.js index 1639d2f16e3b..a3a6113d5afd 100644 --- a/lighthouse-core/driver/index.js +++ b/lighthouse-core/gather/gather-runner.js @@ -19,7 +19,7 @@ const log = require('../lib/log.js'); const Audit = require('../audits/audit'); -class Driver { +class GatherRunner { static loadPage(driver, options) { // Since a Page.reload command does not let a service worker take over, we // navigate away and then come back to reload. We do not `waitForLoad` on @@ -238,7 +238,7 @@ class Driver { return gatherer; } - const GathererClass = Driver.getGathererClass(gatherer); + const GathererClass = GatherRunner.getGathererClass(gatherer); return new GathererClass(); }); @@ -247,4 +247,4 @@ class Driver { } } -module.exports = Driver; +module.exports = GatherRunner; diff --git a/lighthouse-core/driver/gatherers/accessibility.js b/lighthouse-core/gather/gatherers/accessibility.js similarity index 100% rename from lighthouse-core/driver/gatherers/accessibility.js rename to lighthouse-core/gather/gatherers/accessibility.js diff --git a/lighthouse-core/driver/gatherers/cache-contents.js b/lighthouse-core/gather/gatherers/cache-contents.js similarity index 100% rename from lighthouse-core/driver/gatherers/cache-contents.js rename to lighthouse-core/gather/gatherers/cache-contents.js diff --git a/lighthouse-core/driver/gatherers/content-width.js b/lighthouse-core/gather/gatherers/content-width.js similarity index 100% rename from lighthouse-core/driver/gatherers/content-width.js rename to lighthouse-core/gather/gatherers/content-width.js diff --git a/lighthouse-core/driver/gatherers/critical-request-chains.js b/lighthouse-core/gather/gatherers/critical-request-chains.js similarity index 100% rename from lighthouse-core/driver/gatherers/critical-request-chains.js rename to lighthouse-core/gather/gatherers/critical-request-chains.js diff --git a/lighthouse-core/driver/gatherers/gather.js b/lighthouse-core/gather/gatherers/gather.js similarity index 100% rename from lighthouse-core/driver/gatherers/gather.js rename to lighthouse-core/gather/gatherers/gather.js diff --git a/lighthouse-core/driver/gatherers/geolocation-on-start.js b/lighthouse-core/gather/gatherers/geolocation-on-start.js similarity index 100% rename from lighthouse-core/driver/gatherers/geolocation-on-start.js rename to lighthouse-core/gather/gatherers/geolocation-on-start.js diff --git a/lighthouse-core/driver/gatherers/html-without-javascript.js b/lighthouse-core/gather/gatherers/html-without-javascript.js similarity index 100% rename from lighthouse-core/driver/gatherers/html-without-javascript.js rename to lighthouse-core/gather/gatherers/html-without-javascript.js diff --git a/lighthouse-core/driver/gatherers/html.js b/lighthouse-core/gather/gatherers/html.js similarity index 100% rename from lighthouse-core/driver/gatherers/html.js rename to lighthouse-core/gather/gatherers/html.js diff --git a/lighthouse-core/driver/gatherers/http-redirect.js b/lighthouse-core/gather/gatherers/http-redirect.js similarity index 100% rename from lighthouse-core/driver/gatherers/http-redirect.js rename to lighthouse-core/gather/gatherers/http-redirect.js diff --git a/lighthouse-core/driver/gatherers/https.js b/lighthouse-core/gather/gatherers/https.js similarity index 100% rename from lighthouse-core/driver/gatherers/https.js rename to lighthouse-core/gather/gatherers/https.js diff --git a/lighthouse-core/driver/gatherers/manifest.js b/lighthouse-core/gather/gatherers/manifest.js similarity index 100% rename from lighthouse-core/driver/gatherers/manifest.js rename to lighthouse-core/gather/gatherers/manifest.js diff --git a/lighthouse-core/driver/gatherers/offline.js b/lighthouse-core/gather/gatherers/offline.js similarity index 100% rename from lighthouse-core/driver/gatherers/offline.js rename to lighthouse-core/gather/gatherers/offline.js diff --git a/lighthouse-core/driver/gatherers/screenshots.js b/lighthouse-core/gather/gatherers/screenshots.js similarity index 100% rename from lighthouse-core/driver/gatherers/screenshots.js rename to lighthouse-core/gather/gatherers/screenshots.js diff --git a/lighthouse-core/driver/gatherers/service-worker.js b/lighthouse-core/gather/gatherers/service-worker.js similarity index 100% rename from lighthouse-core/driver/gatherers/service-worker.js rename to lighthouse-core/gather/gatherers/service-worker.js diff --git a/lighthouse-core/driver/gatherers/speedline.js b/lighthouse-core/gather/gatherers/speedline.js similarity index 100% rename from lighthouse-core/driver/gatherers/speedline.js rename to lighthouse-core/gather/gatherers/speedline.js diff --git a/lighthouse-core/driver/gatherers/theme-color.js b/lighthouse-core/gather/gatherers/theme-color.js similarity index 100% rename from lighthouse-core/driver/gatherers/theme-color.js rename to lighthouse-core/gather/gatherers/theme-color.js diff --git a/lighthouse-core/driver/gatherers/url.js b/lighthouse-core/gather/gatherers/url.js similarity index 100% rename from lighthouse-core/driver/gatherers/url.js rename to lighthouse-core/gather/gatherers/url.js diff --git a/lighthouse-core/driver/gatherers/viewport.js b/lighthouse-core/gather/gatherers/viewport.js similarity index 100% rename from lighthouse-core/driver/gatherers/viewport.js rename to lighthouse-core/gather/gatherers/viewport.js diff --git a/lighthouse-core/index.js b/lighthouse-core/index.js index 05e9e826a2c7..3435c9c1825d 100644 --- a/lighthouse-core/index.js +++ b/lighthouse-core/index.js @@ -20,7 +20,7 @@ const semver = require('semver'); const Runner = require('./runner'); const log = require('./lib/log.js'); -const ChromeProtocol = require('./driver/drivers/cri.js'); +const ChromeProtocol = require('./gather/drivers/cri.js'); const Config = require('./config'); /** @@ -72,4 +72,4 @@ module.exports = function(url, flags, configJSON) { }; module.exports.getAuditList = Runner.getAuditList; -module.exports.traceCategories = require('./driver/drivers/driver').traceCategories; +module.exports.traceCategories = require('./gather/drivers/driver').traceCategories; diff --git a/lighthouse-core/runner.js b/lighthouse-core/runner.js index fa710a32d2a7..9882e128a39f 100644 --- a/lighthouse-core/runner.js +++ b/lighthouse-core/runner.js @@ -16,7 +16,7 @@ */ 'use strict'; -const Driver = require('./driver'); +const GatherRunner = require('./gather/gather-runner'); const Aggregator = require('./aggregator'); const assetSaver = require('./lib/asset-saver'); const log = require('./lib/log'); @@ -36,12 +36,12 @@ class Runner { // Make a run, which can be .then()'d with whatever needs to run (based on the config). let run = Promise.resolve(); - // If there are passes run the Driver and gather the artifacts. If not, we will need + // If there are passes run the GatherRunner and gather the artifacts. If not, we will need // to check that there are artifacts specified in the config, and throw if not. if (validPassesAndAudits || validArtifactsAndAudits) { if (validPassesAndAudits) { // Finally set up the driver to gather. - run = run.then(_ => Driver.run(config.passes, Object.assign({}, opts, {driver}))); + run = run.then(_ => GatherRunner.run(config.passes, Object.assign({}, opts, {driver}))); } else if (validArtifactsAndAudits) { run = run.then(_ => config.artifacts); } diff --git a/lighthouse-core/test/audits/time-to-interactive.js b/lighthouse-core/test/audits/time-to-interactive.js index cee533d71d5d..f6f8a70911d3 100644 --- a/lighthouse-core/test/audits/time-to-interactive.js +++ b/lighthouse-core/test/audits/time-to-interactive.js @@ -16,7 +16,7 @@ 'use strict'; const Audit = require('../../audits/time-to-interactive.js'); -const SpeedlineGather = require('../../driver/gatherers/speedline'); +const SpeedlineGather = require('../../gather/gatherers/speedline'); const assert = require('assert'); const traceContents = require('../fixtures/traces/progressive-app.json'); diff --git a/lighthouse-core/test/driver/fake-driver.js b/lighthouse-core/test/gather/fake-driver.js similarity index 100% rename from lighthouse-core/test/driver/fake-driver.js rename to lighthouse-core/test/gather/fake-driver.js diff --git a/lighthouse-core/test/driver/index.js b/lighthouse-core/test/gather/gather-runner.js similarity index 83% rename from lighthouse-core/test/driver/index.js rename to lighthouse-core/test/gather/gather-runner.js index 7fa7f712ffdc..cf522fd9b56a 100644 --- a/lighthouse-core/test/driver/index.js +++ b/lighthouse-core/test/gather/gather-runner.js @@ -18,8 +18,8 @@ /* eslint-env mocha */ -const Gather = require('../../driver/gatherers/gather'); -const Driver = require('../../driver'); +const Gather = require('../../gather/gatherers/gather'); +const GatherRunner = require('../../gather/gather-runner'); const Audit = require('../../audits/audit'); const assert = require('assert'); @@ -40,7 +40,7 @@ class TestGatherer extends Gather { const fakeDriver = require('./fake-driver'); -describe('Driver', function() { +describe('GatherRunner', function() { it('loads a page', () => { const driver = { gotoURL() { @@ -48,7 +48,7 @@ describe('Driver', function() { } }; - return Driver.loadPage(driver, {}, { + return GatherRunner.loadPage(driver, {}, { flags: { loadPage: true } @@ -62,7 +62,7 @@ describe('Driver', function() { const driver = fakeDriver; const options = {url, driver}; - return Driver.run([], options).then(_ => { + return GatherRunner.run([], options).then(_ => { assert.equal(typeof options.flags, 'object'); }); }); @@ -79,7 +79,7 @@ describe('Driver', function() { } }; - return Driver.loadPage(driver, {url: 'https://example.com'}) + return GatherRunner.loadPage(driver, {url: 'https://example.com'}) .then(res => { assert.equal(res, true); }); @@ -95,7 +95,7 @@ describe('Driver', function() { forceUpdateServiceWorkers() {} }; - return Driver.setupDriver(driver, {}, { + return GatherRunner.setupDriver(driver, {}, { flags: { mobile: true } @@ -114,7 +114,7 @@ describe('Driver', function() { forceUpdateServiceWorkers() {} }; - return Driver.setupDriver(driver, {}, { + return GatherRunner.setupDriver(driver, {}, { flags: {} }).then(_ => { assert.equal(calledEmulation, false); @@ -137,7 +137,7 @@ describe('Driver', function() { }] }; - return Driver.setup({driver, config}).then(_ => { + return GatherRunner.setup({driver, config}).then(_ => { assert.equal(calledTrace, true); }); }); @@ -158,7 +158,7 @@ describe('Driver', function() { }] }; - return Driver.afterPass({driver, config}).then(vals => { + return GatherRunner.afterPass({driver, config}).then(vals => { assert.equal(calledTrace, true); assert.deepEqual(vals.traces[Audit.DEFAULT_TRACE].traceContents, {x: 1}); }); @@ -179,7 +179,7 @@ describe('Driver', function() { }] }; - return Driver.afterPass({driver, config}).then(vals => { + return GatherRunner.afterPass({driver, config}).then(vals => { assert.deepEqual(vals.traces.notTheDefaultPass.traceContents, {x: 1}); }); }); @@ -200,7 +200,7 @@ describe('Driver', function() { }] }; - return Driver.setup({driver, config}).then(_ => { + return GatherRunner.setup({driver, config}).then(_ => { assert.equal(calledNetworkCollect, true); }); }); @@ -221,18 +221,18 @@ describe('Driver', function() { }] }; - return Driver.afterPass({driver, config}).then(vals => { + return GatherRunner.afterPass({driver, config}).then(vals => { assert.equal(calledNetworkCollect, true); assert.deepEqual(vals.networkRecords, {x: 1}); }); }); it('rejects when not given a URL', () => { - return Driver.run({}, {}).then(_ => assert.ok(false), _ => assert.ok(true)); + return GatherRunner.run({}, {}).then(_ => assert.ok(false), _ => assert.ok(true)); }); it('rejects when given a URL of zero length', () => { - return Driver.run({}, {url: ''}).then(_ => assert.ok(false), _ => assert.ok(true)); + return GatherRunner.run({}, {url: ''}).then(_ => assert.ok(false), _ => assert.ok(true)); }); it('does as many passes as are required', () => { @@ -255,7 +255,7 @@ describe('Driver', function() { ] }]; - return Driver.run(passes, {driver: fakeDriver, url: 'https://example.com', flags: {}}) + return GatherRunner.run(passes, {driver: fakeDriver, url: 'https://example.com', flags: {}}) .then(_ => { assert.ok(t1.called); assert.ok(t2.called); diff --git a/lighthouse-core/test/driver/gatherers/accessibility.js b/lighthouse-core/test/gather/gatherers/accessibility.js similarity index 97% rename from lighthouse-core/test/driver/gatherers/accessibility.js rename to lighthouse-core/test/gather/gatherers/accessibility.js index 41f5f877e86f..e17c75ff7094 100644 --- a/lighthouse-core/test/driver/gatherers/accessibility.js +++ b/lighthouse-core/test/gather/gatherers/accessibility.js @@ -17,7 +17,7 @@ /* eslint-env mocha */ -const AccessibilityGather = require('../../../driver/gatherers/accessibility'); +const AccessibilityGather = require('../../../gather/gatherers/accessibility'); const assert = require('assert'); let accessibilityGather; diff --git a/lighthouse-core/test/driver/gatherers/cache-contents.js b/lighthouse-core/test/gather/gatherers/cache-contents.js similarity index 97% rename from lighthouse-core/test/driver/gatherers/cache-contents.js rename to lighthouse-core/test/gather/gatherers/cache-contents.js index 4d4061c82955..d865f3dd3f0c 100644 --- a/lighthouse-core/test/driver/gatherers/cache-contents.js +++ b/lighthouse-core/test/gather/gatherers/cache-contents.js @@ -17,7 +17,7 @@ /* eslint-env mocha */ -const CacheContentGather = require('../../../driver/gatherers/cache-contents'); +const CacheContentGather = require('../../../gather/gatherers/cache-contents'); const assert = require('assert'); let cacheContentGather; diff --git a/lighthouse-core/test/driver/gatherers/content-width.js b/lighthouse-core/test/gather/gatherers/content-width.js similarity index 96% rename from lighthouse-core/test/driver/gatherers/content-width.js rename to lighthouse-core/test/gather/gatherers/content-width.js index 8afa398adfab..4bfbf55b5cd6 100644 --- a/lighthouse-core/test/driver/gatherers/content-width.js +++ b/lighthouse-core/test/gather/gatherers/content-width.js @@ -17,7 +17,7 @@ /* eslint-env mocha */ -const ContentWidthGatherer = require('../../../driver/gatherers/content-width'); +const ContentWidthGatherer = require('../../../gather/gatherers/content-width'); const assert = require('assert'); let contentWidthGatherer; diff --git a/lighthouse-core/test/driver/gatherers/critical-request-chains.js b/lighthouse-core/test/gather/gatherers/critical-request-chains.js similarity index 99% rename from lighthouse-core/test/driver/gatherers/critical-request-chains.js rename to lighthouse-core/test/gather/gatherers/critical-request-chains.js index 1503e70d7574..a3f72dbff61c 100644 --- a/lighthouse-core/test/driver/gatherers/critical-request-chains.js +++ b/lighthouse-core/test/gather/gatherers/critical-request-chains.js @@ -17,7 +17,7 @@ /* eslint-env mocha */ -const GathererClass = require('../../../driver/gatherers/critical-request-chains'); +const GathererClass = require('../../../gather/gatherers/critical-request-chains'); const assert = require('assert'); const Gatherer = new GathererClass(); diff --git a/lighthouse-core/test/driver/gatherers/gather.js b/lighthouse-core/test/gather/gatherers/gather.js similarity index 93% rename from lighthouse-core/test/driver/gatherers/gather.js rename to lighthouse-core/test/gather/gatherers/gather.js index aef4f4937fa0..297562c556d4 100644 --- a/lighthouse-core/test/driver/gatherers/gather.js +++ b/lighthouse-core/test/gather/gatherers/gather.js @@ -17,7 +17,7 @@ /* eslint-env mocha */ -const Gather = require('../../../driver/gatherers/gather'); +const Gather = require('../../../gather/gatherers/gather'); const assert = require('assert'); describe('Gather', () => { diff --git a/lighthouse-core/test/driver/gatherers/geolocation-on-start.js b/lighthouse-core/test/gather/gatherers/geolocation-on-start.js similarity index 96% rename from lighthouse-core/test/driver/gatherers/geolocation-on-start.js rename to lighthouse-core/test/gather/gatherers/geolocation-on-start.js index a6c16cfcbd9c..5eac2f52cd57 100644 --- a/lighthouse-core/test/driver/gatherers/geolocation-on-start.js +++ b/lighthouse-core/test/gather/gatherers/geolocation-on-start.js @@ -17,7 +17,7 @@ /* eslint-env mocha */ -const GeolocationGatherer = require('../../../driver/gatherers/geolocation-on-start'); +const GeolocationGatherer = require('../../../gather/gatherers/geolocation-on-start'); const assert = require('assert'); let geolocationGatherer; diff --git a/lighthouse-core/test/driver/gatherers/html-without-javascript.js b/lighthouse-core/test/gather/gatherers/html-without-javascript.js similarity index 97% rename from lighthouse-core/test/driver/gatherers/html-without-javascript.js rename to lighthouse-core/test/gather/gatherers/html-without-javascript.js index 3e3d237a2b74..1643740ec346 100644 --- a/lighthouse-core/test/driver/gatherers/html-without-javascript.js +++ b/lighthouse-core/test/gather/gatherers/html-without-javascript.js @@ -17,7 +17,7 @@ /* eslint-env mocha */ -const HTMLWithoutJavaScriptGather = require('../../../driver/gatherers/html-without-javascript'); +const HTMLWithoutJavaScriptGather = require('../../../gather/gatherers/html-without-javascript'); const assert = require('assert'); let htmlWithoutJavaScriptGather; diff --git a/lighthouse-core/test/driver/gatherers/html.js b/lighthouse-core/test/gather/gatherers/html.js similarity index 97% rename from lighthouse-core/test/driver/gatherers/html.js rename to lighthouse-core/test/gather/gatherers/html.js index d43dc1559859..6927a72ba829 100644 --- a/lighthouse-core/test/driver/gatherers/html.js +++ b/lighthouse-core/test/gather/gatherers/html.js @@ -17,7 +17,7 @@ /* eslint-env mocha */ -const HTMLGather = require('../../../driver/gatherers/html'); +const HTMLGather = require('../../../gather/gatherers/html'); const assert = require('assert'); let htmlGather; diff --git a/lighthouse-core/test/driver/gatherers/http-redirect.js b/lighthouse-core/test/gather/gatherers/http-redirect.js similarity index 97% rename from lighthouse-core/test/driver/gatherers/http-redirect.js rename to lighthouse-core/test/gather/gatherers/http-redirect.js index d8d02086d0e7..da5fab1056c4 100644 --- a/lighthouse-core/test/driver/gatherers/http-redirect.js +++ b/lighthouse-core/test/gather/gatherers/http-redirect.js @@ -17,7 +17,7 @@ /* eslint-env mocha */ -const HTTPRedirectGather = require('../../../driver/gatherers/http-redirect'); +const HTTPRedirectGather = require('../../../gather/gatherers/http-redirect'); const assert = require('assert'); let httpRedirectGather; diff --git a/lighthouse-core/test/driver/gatherers/https.js b/lighthouse-core/test/gather/gatherers/https.js similarity index 96% rename from lighthouse-core/test/driver/gatherers/https.js rename to lighthouse-core/test/gather/gatherers/https.js index fd915e1b0411..5668a4d58bcc 100644 --- a/lighthouse-core/test/driver/gatherers/https.js +++ b/lighthouse-core/test/gather/gatherers/https.js @@ -17,7 +17,7 @@ /* eslint-env mocha */ -const HTTPSGather = require('../../../driver/gatherers/https'); +const HTTPSGather = require('../../../gather/gatherers/https'); const assert = require('assert'); let httpsGather; diff --git a/lighthouse-core/test/driver/gatherers/manifest.js b/lighthouse-core/test/gather/gatherers/manifest.js similarity index 97% rename from lighthouse-core/test/driver/gatherers/manifest.js rename to lighthouse-core/test/gather/gatherers/manifest.js index 840c63fe482a..279633690e69 100644 --- a/lighthouse-core/test/driver/gatherers/manifest.js +++ b/lighthouse-core/test/gather/gatherers/manifest.js @@ -17,7 +17,7 @@ /* eslint-env mocha */ -const ManifestGather = require('../../../driver/gatherers/manifest'); +const ManifestGather = require('../../../gather/gatherers/manifest'); const assert = require('assert'); let manifestGather; diff --git a/lighthouse-core/test/driver/gatherers/offline.js b/lighthouse-core/test/gather/gatherers/offline.js similarity index 96% rename from lighthouse-core/test/driver/gatherers/offline.js rename to lighthouse-core/test/gather/gatherers/offline.js index 8b12c8410c06..aed67e2fb63a 100644 --- a/lighthouse-core/test/driver/gatherers/offline.js +++ b/lighthouse-core/test/gather/gatherers/offline.js @@ -17,7 +17,7 @@ /* eslint-env mocha */ -const OfflineGather = require('../../../driver/gatherers/offline'); +const OfflineGather = require('../../../gather/gatherers/offline'); const assert = require('assert'); let offlineGather; diff --git a/lighthouse-core/test/driver/gatherers/screenshots.js b/lighthouse-core/test/gather/gatherers/screenshots.js similarity index 96% rename from lighthouse-core/test/driver/gatherers/screenshots.js rename to lighthouse-core/test/gather/gatherers/screenshots.js index 39e2f4a69434..e59d6899e244 100644 --- a/lighthouse-core/test/driver/gatherers/screenshots.js +++ b/lighthouse-core/test/gather/gatherers/screenshots.js @@ -17,7 +17,7 @@ /* eslint-env mocha */ -const ScreenshotsGather = require('../../../driver/gatherers/screenshots'); +const ScreenshotsGather = require('../../../gather/gatherers/screenshots'); const assert = require('assert'); let screenshotsGather = new ScreenshotsGather(); diff --git a/lighthouse-core/test/driver/gatherers/service-worker.js b/lighthouse-core/test/gather/gatherers/service-worker.js similarity index 97% rename from lighthouse-core/test/driver/gatherers/service-worker.js rename to lighthouse-core/test/gather/gatherers/service-worker.js index 3076e8a2b0b7..b9214a4fc48b 100644 --- a/lighthouse-core/test/driver/gatherers/service-worker.js +++ b/lighthouse-core/test/gather/gatherers/service-worker.js @@ -17,7 +17,7 @@ /* eslint-env mocha */ -const ServiceWorkerGather = require('../../../driver/gatherers/service-worker'); +const ServiceWorkerGather = require('../../../gather/gatherers/service-worker'); const assert = require('assert'); let serviceWorkerGatherer; diff --git a/lighthouse-core/test/driver/gatherers/speedline.js b/lighthouse-core/test/gather/gatherers/speedline.js similarity index 96% rename from lighthouse-core/test/driver/gatherers/speedline.js rename to lighthouse-core/test/gather/gatherers/speedline.js index d3b6bfccbda5..c674d7ea8ad5 100644 --- a/lighthouse-core/test/driver/gatherers/speedline.js +++ b/lighthouse-core/test/gather/gatherers/speedline.js @@ -17,7 +17,7 @@ /* eslint-env mocha */ -const SpeedlineGather = require('../../../driver/gatherers/speedline.js'); +const SpeedlineGather = require('../../../gather/gatherers/speedline.js'); const assert = require('assert'); describe('Speedline gatherer', () => { diff --git a/lighthouse-core/test/driver/gatherers/theme-color.js b/lighthouse-core/test/gather/gatherers/theme-color.js similarity index 96% rename from lighthouse-core/test/driver/gatherers/theme-color.js rename to lighthouse-core/test/gather/gatherers/theme-color.js index 532a04237ecb..af50ac1fe89b 100644 --- a/lighthouse-core/test/driver/gatherers/theme-color.js +++ b/lighthouse-core/test/gather/gatherers/theme-color.js @@ -17,7 +17,7 @@ /* eslint-env mocha */ -const ThemeColorGather = require('../../../driver/gatherers/theme-color'); +const ThemeColorGather = require('../../../gather/gatherers/theme-color'); const assert = require('assert'); let themeColorGather; diff --git a/lighthouse-core/test/driver/gatherers/url.js b/lighthouse-core/test/gather/gatherers/url.js similarity index 96% rename from lighthouse-core/test/driver/gatherers/url.js rename to lighthouse-core/test/gather/gatherers/url.js index a93bef49a80d..30ad5a663ec6 100644 --- a/lighthouse-core/test/driver/gatherers/url.js +++ b/lighthouse-core/test/gather/gatherers/url.js @@ -17,7 +17,7 @@ /* eslint-env mocha */ -const URLGather = require('../../../driver/gatherers/url'); +const URLGather = require('../../../gather/gatherers/url'); const assert = require('assert'); let urlGather; diff --git a/lighthouse-core/test/driver/gatherers/viewport.js b/lighthouse-core/test/gather/gatherers/viewport.js similarity index 96% rename from lighthouse-core/test/driver/gatherers/viewport.js rename to lighthouse-core/test/gather/gatherers/viewport.js index 8ea4d871a2c9..2c9abda0a2d3 100644 --- a/lighthouse-core/test/driver/gatherers/viewport.js +++ b/lighthouse-core/test/gather/gatherers/viewport.js @@ -17,7 +17,7 @@ /* eslint-env mocha */ -const ViewportGather = require('../../../driver/gatherers/viewport'); +const ViewportGather = require('../../../gather/gatherers/viewport'); const assert = require('assert'); let viewportGather; diff --git a/lighthouse-core/test/lib/drivers/driver.js b/lighthouse-core/test/lib/drivers/driver.js index b24e9870f7d0..2232d149e101 100644 --- a/lighthouse-core/test/lib/drivers/driver.js +++ b/lighthouse-core/test/lib/drivers/driver.js @@ -17,7 +17,7 @@ 'use strict'; -const Driver = require('../../../driver/drivers/cri.js'); +const Driver = require('../../../gather/drivers/cri.js'); const Element = require('../../../lib/element.js'); const assert = require('assert'); diff --git a/lighthouse-core/test/runner.js b/lighthouse-core/test/runner.js index 315427ef9053..a29e7030cf49 100644 --- a/lighthouse-core/test/runner.js +++ b/lighthouse-core/test/runner.js @@ -14,7 +14,7 @@ * limitations under the License. */ const Runner = require('../runner'); -const fakeDriver = require('./driver/fake-driver'); +const fakeDriver = require('./gather/fake-driver'); const Config = require('../config'); const Audit = require('../audits/audit'); const assert = require('assert'); diff --git a/lighthouse-extension/app/src/lighthouse-background.js b/lighthouse-extension/app/src/lighthouse-background.js index b22bd27d7399..b0df810fadde 100644 --- a/lighthouse-extension/app/src/lighthouse-background.js +++ b/lighthouse-extension/app/src/lighthouse-background.js @@ -17,7 +17,7 @@ 'use strict'; -const ExtensionProtocol = require('../../../lighthouse-core/driver/drivers/extension'); +const ExtensionProtocol = require('../../../lighthouse-core/gather/drivers/extension'); const Runner = require('../../../lighthouse-core/runner'); const Config = require('../../../lighthouse-core/config'); const configJSON = require('../../../lighthouse-core/config/default.json'); diff --git a/lighthouse-extension/gulpfile.js b/lighthouse-extension/gulpfile.js index 9df65f651100..38c9cc421394 100644 --- a/lighthouse-extension/gulpfile.js +++ b/lighthouse-extension/gulpfile.js @@ -20,9 +20,9 @@ const audits = fs.readdirSync(path.join(__dirname, '../', 'lighthouse-core/audit .filter(f => /\.js$/.test(f)) .map(f => `../lighthouse-core/audits/${f.replace(/\.js$/, '')}`); -const gatherers = fs.readdirSync(path.join(__dirname, '../', 'lighthouse-core/driver/gatherers/')) +const gatherers = fs.readdirSync(path.join(__dirname, '../', 'lighthouse-core/gather/gatherers/')) .filter(f => /\.js$/.test(f)) - .map(f => `../lighthouse-core/driver/gatherers/${f.replace(/\.js$/, '')}`); + .map(f => `../lighthouse-core/gather/gatherers/${f.replace(/\.js$/, '')}`); gulp.task('extras', () => { return gulp.src([ @@ -118,7 +118,7 @@ gulp.task('browserify', () => { // Expose the audits and gatherers so they can be dynamically loaded. const corePath = '../lighthouse-core/'; - const driverPath = `${corePath}driver/`; + const driverPath = `${corePath}gather/`; audits.forEach(audit => { bundle = bundle.require(audit, {expose: audit.replace(corePath, '../')}); });