Skip to content

Commit

Permalink
rename gatherer base class to gatherer
Browse files Browse the repository at this point in the history
  • Loading branch information
brendankenny authored and paulirish committed Jul 28, 2016
1 parent 35d0360 commit 0c7bef7
Show file tree
Hide file tree
Showing 20 changed files with 45 additions and 42 deletions.
4 changes: 2 additions & 2 deletions lighthouse-core/gather/gatherers/accessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/* global document, __returnResults */

const Gather = require('./gather');
const Gatherer = require('./gatherer');
const fs = require('fs');
const axe = fs.readFileSync(
require.resolve('axe-core/axe.min.js')
Expand All @@ -33,7 +33,7 @@ function runA11yChecks() {
});
}

class Accessibility extends Gather {
class Accessibility extends Gatherer {
static _errorAccessibility(errorString) {
return {
raw: undefined,
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/gather/gatherers/cache-contents.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/* global __returnResults, caches */

const Gather = require('./gather');
const Gatherer = require('./gatherer');

// This is run in the page, not Lighthouse itself.
/* istanbul ignore next */
Expand Down Expand Up @@ -47,7 +47,7 @@ function getCacheContents() {
});
}

class CacheContents extends Gather {
class CacheContents extends Gatherer {
static _error(errorString) {
return {
raw: undefined,
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/gather/gatherers/content-width.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
'use strict';

const Gather = require('./gather');
const Gatherer = require('./gatherer');

/* global window, __returnResults */

Expand All @@ -30,7 +30,7 @@ function getContentWidth() {
});
}

class ContentWidth extends Gather {
class ContentWidth extends Gatherer {

afterPass(options) {
const driver = options.driver;
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/gather/gatherers/critical-request-chains.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

'use strict';

const Gather = require('./gather');
const Gatherer = require('./gatherer');
const WebInspector = require('../../lib/web-inspector');

const includes = (arr, elm) => arr.indexOf(elm) > -1;

class CriticalRequestChains extends Gather {
class CriticalRequestChains extends Gatherer {

/**
* For now, we use network priorities as a proxy for "render-blocking"/critical-ness.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
*/
'use strict';

class Gather {
/**
* Base class for all gatherers; defines pass lifecycle methods.
*/
class Gatherer {

constructor() {
this.artifact = {};
Expand Down Expand Up @@ -45,4 +48,4 @@ class Gather {

}

module.exports = Gather;
module.exports = Gatherer;
4 changes: 2 additions & 2 deletions lighthouse-core/gather/gatherers/geolocation-on-start.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
'use strict';

const Gather = require('./gather');
const Gatherer = require('./gatherer');

/**
* @fileoverview Tests whether the page attempts to request geolocation on page load. This often
Expand All @@ -42,7 +42,7 @@ function collectGeoState() {
__returnResults(window.__didNotCallGeo);
}

class GeolocationOnStart extends Gather {
class GeolocationOnStart extends Gatherer {

beforePass(options) {
return options.driver.evaluateScriptOnLoad(`(${overrideGeo.toString()}())`);
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/gather/gatherers/html-without-javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/* Note that this returns the innerText of the <body> element, not the HTML. */

const HTML = require('./html');
const Gatherer = require('./gatherer');

/* global document, __returnResults */

Expand All @@ -30,7 +30,7 @@ function getBodyText() {
__returnResults(body ? body.innerText : '');
}

class HTMLWithoutJavaScript extends HTML {
class HTMLWithoutJavaScript extends Gatherer {

beforePass(options) {
options.disableJavaScript = true;
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/gather/gatherers/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/
'use strict';

const Gather = require('./gather');
const Gatherer = require('./gatherer');

class HTML extends Gather {
class HTML extends Gatherer {

afterPass(options) {
const driver = options.driver;
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/gather/gatherers/http-redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/
'use strict';

const Gather = require('./gather');
const Gatherer = require('./gatherer');

class HTTPRedirect extends Gather {
class HTTPRedirect extends Gatherer {

constructor() {
super();
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/gather/gatherers/https.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/
'use strict';

const Gather = require('./gather');
const Gatherer = require('./gatherer');

class HTTPS extends Gather {
class HTTPS extends Gatherer {

constructor() {
super();
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/gather/gatherers/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
'use strict';

const Gather = require('./gather');
const Gatherer = require('./gatherer');
const manifestParser = require('../../lib/manifest-parser');

/* global document, XMLHttpRequest, __returnResults */
Expand Down Expand Up @@ -53,7 +53,7 @@ function getManifestContent() {
req.send();
}

class Manifest extends Gather {
class Manifest extends Gatherer {

static _errorManifest(errorString) {
return {
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/gather/gatherers/offline.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

'use strict';

const Gather = require('./gather');
const Gatherer = require('./gatherer');

// *WARNING* do not use fetch.. due to it requiring window focus to fire.
// Request the current page by issuing a XMLHttpRequest request to ''
Expand All @@ -36,7 +36,7 @@ const requestPage = function() {
oReq.send();
};

class Offline extends Gather {
class Offline extends Gatherer {

static config(opts) {
return {
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/gather/gatherers/screenshots.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

'use strict';

const Gather = require('./gather');
const Gatherer = require('./gatherer');
const DevtoolsTimelineModel = require('../../lib/traces/devtools-timeline-model');

class ScreenshotFilmstrip extends Gather {
class ScreenshotFilmstrip extends Gatherer {

fetchScreenshot(frame) {
return frame
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/gather/gatherers/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/
'use strict';

const Gather = require('./gather');
const Gatherer = require('./gatherer');

class ServiceWorker extends Gather {
class ServiceWorker extends Gatherer {

/**
* @param {string} url
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/gather/gatherers/speedline.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
*/
'use strict';

const Gather = require('./gather');
const Gatherer = require('./gatherer');
const speedline = require('speedline');

class Speedline extends Gather {
class Speedline extends Gatherer {

afterPass(options, tracingData) {
return speedline(tracingData.traceContents).then(results => {
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/gather/gatherers/theme-color.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/
'use strict';

const Gather = require('./gather');
const Gatherer = require('./gatherer');

class ThemeColor extends Gather {
class ThemeColor extends Gatherer {

afterPass(options) {
const driver = options.driver;
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/gather/gatherers/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/
'use strict';

const Gather = require('./gather');
const Gatherer = require('./gatherer');

class URL extends Gather {
class URL extends Gatherer {

beforePass(options) {
this.artifact = options.url || options.driver.url;
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/gather/gatherers/viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/
'use strict';

const Gather = require('./gather');
const Gatherer = require('./gatherer');

class Viewport extends Gather {
class Viewport extends Gatherer {

/**
* @param {!{driver: !Object}} options Run options
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/test/gather/gather-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

/* eslint-env mocha */

const Gather = require('../../gather/gatherers/gather');
const Gatherer = require('../../gather/gatherers/gatherer');
const GatherRunner = require('../../gather/gather-runner');
const Audit = require('../../audits/audit');
const assert = require('assert');

class TestGatherer extends Gather {
class TestGatherer extends Gatherer {
constructor() {
super();
this.called = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

/* eslint-env mocha */

const Gather = require('../../../gather/gatherers/gather');
const Gatherer = require('../../../gather/gatherers/gatherer');
const assert = require('assert');

describe('Gather', () => {
describe('Gatherer', () => {
it('returns its name', () => {
const g = new Gather();
return assert.equal(g.name, 'Gather');
const g = new Gatherer();
return assert.equal(g.name, 'Gatherer');
});
});

0 comments on commit 0c7bef7

Please sign in to comment.