Skip to content

Commit 35d0360

Browse files
brendankennypaulirish
authored andcommitted
move driver/ to gather/
rename gather/index.js to gather/gather-runner.js rename DriverBase class to Driver
1 parent 1c62db3 commit 35d0360

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+57
-56
lines changed

lighthouse-core/config/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818

1919
const defaultConfig = require('./default.json');
2020
const recordsFromLogs = require('../lib/network-recorder').recordsFromLogs;
21-
const CriticalRequestChainsGatherer = require('../driver/gatherers/critical-request-chains');
22-
const SpeedlineGatherer = require('../driver/gatherers/speedline');
23-
const Driver = require('../driver');
21+
const CriticalRequestChainsGatherer = require('../gather/gatherers/critical-request-chains');
22+
const SpeedlineGatherer = require('../gather/gatherers/speedline');
23+
24+
const GatherRunner = require('../gather/gather-runner');
2425
const log = require('../lib/log');
2526

2627
// cleanTrace is run to remove duplicate TracingStartedInPage events,
@@ -115,7 +116,7 @@ function filterPasses(passes, audits) {
115116

116117
freshPass.gatherers = freshPass.gatherers.filter(gatherer => {
117118
try {
118-
const GathererClass = Driver.getGathererClass(gatherer);
119+
const GathererClass = GatherRunner.getGathererClass(gatherer);
119120
return requiredGatherers.has(GathererClass.name);
120121
} catch (requireError) {
121122
throw new Error(`Unable to locate gatherer: ${gatherer}`);
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ const NetworkRecorder = require('../../lib/network-recorder');
2020
const emulation = require('../../lib/emulation');
2121
const Element = require('../../lib/element');
2222

23-
class DriverBase {
23+
class Driver {
2424

2525
constructor() {
2626
this._url = null;
2727
this.PAUSE_AFTER_LOAD = 500;
2828
this._chrome = null;
2929
this._traceEvents = [];
30-
this._traceCategories = DriverBase.traceCategories;
30+
this._traceCategories = Driver.traceCategories;
3131
}
3232

3333
get url() {
@@ -363,5 +363,5 @@ class DriverBase {
363363
}
364364
}
365365

366-
module.exports = DriverBase;
366+
module.exports = Driver;
367367

File renamed without changes.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
const log = require('../lib/log.js');
2020
const Audit = require('../audits/audit');
2121

22-
class Driver {
22+
class GatherRunner {
2323
static loadPage(driver, options) {
2424
// Since a Page.reload command does not let a service worker take over, we
2525
// navigate away and then come back to reload. We do not `waitForLoad` on
@@ -238,7 +238,7 @@ class Driver {
238238
return gatherer;
239239
}
240240

241-
const GathererClass = Driver.getGathererClass(gatherer);
241+
const GathererClass = GatherRunner.getGathererClass(gatherer);
242242
return new GathererClass();
243243
});
244244

@@ -247,4 +247,4 @@ class Driver {
247247
}
248248
}
249249

250-
module.exports = Driver;
250+
module.exports = GatherRunner;
File renamed without changes.
File renamed without changes.
File renamed without changes.

lighthouse-core/driver/gatherers/critical-request-chains.js renamed to lighthouse-core/gather/gatherers/critical-request-chains.js

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)