Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions lighthouse-cli/test/cli/__snapshots__/index-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,6 @@ Object {
},
"passes": Array [
Object {
"blankDuration": 300,
"blankPage": "about:blank",
"blockedUrlPatterns": Array [],
"cpuQuietThresholdMs": 1000,
Expand Down Expand Up @@ -1123,7 +1122,6 @@ Object {
"useThrottling": true,
},
Object {
"blankDuration": 300,
"blankPage": "about:blank",
"blockedUrlPatterns": Array [],
"cpuQuietThresholdMs": 0,
Expand All @@ -1145,7 +1143,6 @@ Object {
"useThrottling": false,
},
Object {
"blankDuration": 300,
"blankPage": "about:blank",
"blockedUrlPatterns": Array [
"*.css",
Expand Down Expand Up @@ -1290,7 +1287,6 @@ Object {
},
"passes": Array [
Object {
"blankDuration": 300,
"blankPage": "about:blank",
"blockedUrlPatterns": Array [],
"cpuQuietThresholdMs": 1000,
Expand Down
1 change: 0 additions & 1 deletion lighthouse-core/config/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ const defaultPassConfig = {
cpuQuietThresholdMs: 0,
blockedUrlPatterns: [],
blankPage: 'about:blank',
blankDuration: 300,
gatherers: [],
};

Expand Down
4 changes: 4 additions & 0 deletions lighthouse-core/gather/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,10 @@ class Driver {
const passContext = /** @type {Partial<LH.Gatherer.PassContext>} */ (options.passContext || {});
const disableJS = passContext.disableJavaScript || false;

if (waitForNavigated && waitForLoad) {
throw new Error('Cannot use both waitForNavigated and waitForLoad, pick just one');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆

}

await this._beginNetworkStatusMonitoring(url);
await this._clearIsolatedContextId();

Expand Down
5 changes: 1 addition & 4 deletions lighthouse-core/gather/gather-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ class GatherRunner {
* @param {string=} url
* @return {Promise<void>}
*/
static async loadBlank(
driver,
url = constants.defaultPassConfig.blankPage
) {
static async loadBlank(driver, url = constants.defaultPassConfig.blankPage) {
const status = {msg: 'Resetting state with about:blank', id: 'lh:gather:loadBlank'};
log.time(status);
await driver.gotoURL(url, {waitForNavigated: true});
Expand Down
20 changes: 7 additions & 13 deletions lighthouse-core/test/gather/gather-runner-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,14 +560,12 @@ describe('GatherRunner', function() {
const settings = {};

const passes = [{
blankDuration: 0,
recordTrace: true,
passName: 'firstPass',
gatherers: [
{instance: t1},
],
}, {
blankDuration: 0,
passName: 'secondPass',
gatherers: [
{instance: t2},
Expand All @@ -587,12 +585,10 @@ describe('GatherRunner', function() {

it('respects trace names', () => {
const passes = [{
blankDuration: 0,
recordTrace: true,
passName: 'firstPass',
gatherers: [{instance: new TestGatherer()}],
}, {
blankDuration: 0,
recordTrace: true,
passName: 'secondPass',
gatherers: [{instance: new TestGatherer()}],
Expand All @@ -610,12 +606,10 @@ describe('GatherRunner', function() {

it('doesn\'t leave networkRecords as an artifact', () => {
const passes = [{
blankDuration: 0,
recordTrace: true,
passName: 'firstPass',
gatherers: [{instance: new TestGatherer()}],
}, {
blankDuration: 0,
recordTrace: true,
passName: 'secondPass',
gatherers: [{instance: new TestGatherer()}],
Expand Down Expand Up @@ -790,7 +784,7 @@ describe('GatherRunner', function() {
},
];
const passes = [{
blankDuration: 0,

gatherers: gatherers.map(G => ({instance: new G()})),
}];

Expand Down Expand Up @@ -844,7 +838,7 @@ describe('GatherRunner', function() {
].map(instance => ({instance}));
const gathererNames = gatherers.map(gatherer => gatherer.instance.name);
const passes = [{
blankDuration: 0,

gatherers,
}];

Expand Down Expand Up @@ -881,7 +875,7 @@ describe('GatherRunner', function() {
{instance: new class EavesdropGatherer3 extends EavesdropGatherer {}()},
];

const passes = [{blankDuration: 0, gatherers}];
const passes = [{gatherers}];
return GatherRunner.run(passes, {
driver: fakeDriver,
requestedUrl: 'https://example.com',
Expand Down Expand Up @@ -1002,7 +996,7 @@ describe('GatherRunner', function() {
].map(instance => ({instance}));
const gathererNames = gatherers.map(gatherer => gatherer.instance.name);
const passes = [{
blankDuration: 0,

gatherers,
}];

Expand All @@ -1022,7 +1016,7 @@ describe('GatherRunner', function() {

it('rejects if a gatherer does not provide an artifact', () => {
const passes = [{
blankDuration: 0,

recordTrace: true,
passName: 'firstPass',
gatherers: [
Expand All @@ -1040,7 +1034,7 @@ describe('GatherRunner', function() {

it('rejects when domain name can\'t be resolved', () => {
const passes = [{
blankDuration: 0,

recordTrace: true,
passName: 'firstPass',
gatherers: [],
Expand Down Expand Up @@ -1071,7 +1065,7 @@ describe('GatherRunner', function() {

it('resolves when domain name can\'t be resolved but is offline', () => {
const passes = [{
blankDuration: 0,

recordTrace: true,
passName: 'firstPass',
gatherers: [],
Expand Down
1 change: 0 additions & 1 deletion typings/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ declare global {
cpuQuietThresholdMs?: number;
blockedUrlPatterns?: string[];
blankPage?: string;
blankDuration?: number;
gatherers?: GathererJson[];
}

Expand Down