Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: don't load blank page twice in first pass #6369

Merged
merged 4 commits into from
Oct 25, 2018

Conversation

connorjclark
Copy link
Collaborator

Split from #6366.

Skip loading the blank page a second time on the first pass. It's already been loaded.

// Enable emulation based on settings
// In the devtools/extension case, we can't still be on the site while trying to clear state
// So we first navigate to a blank page, then apply our emulation & setup
await GatherRunner.loadBlank(driver);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

should this use the config for the first pass (for blank page and duration)?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nah, I think @paulirish was even borderline on the way to removing the blankPage and blankDuration params entirely from the passes anyway

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm a bit confused, aren't we still loading blank twice now? Seems like this line should go away and the comments moved into the loadBlank call in run

Copy link
Collaborator

Choose a reason for hiding this comment

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

sorry if I confused you with my "two blank calls" comment I meant for the pass and for before setup driver, not for setup driver + before setup driver :)

await GatherRunner.setupDriver(driver, options);
baseArtifacts.BenchmarkIndex = await options.driver.getBenchmarkIndex();
Copy link
Collaborator

@patrickhulce patrickhulce Oct 23, 2018

Choose a reason for hiding this comment

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

wait I take it back this won't work sorry!! :)

It needs to go before we setup emulation since its purpose is establishing the right multiplier (see #6162)

it doesn't seem like it'd be the end of the world to have the two loadBlank calls in this function, was there another reason I'm forgetting that it's inside setupDriver now?

Copy link
Member

Choose a reason for hiding this comment

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

+1 to restoring the original loadBlank line

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

// Enable emulation based on settings
// In the devtools/extension case, we can't still be on the site while trying to clear state
// So we first navigate to a blank page, then apply our emulation & setup
await GatherRunner.loadBlank(driver);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm a bit confused, aren't we still loading blank twice now? Seems like this line should go away and the comments moved into the loadBlank call in run

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

some last comment changes, but otherwise LGTM!

@@ -26,22 +26,22 @@ const Driver = require('../gather/driver.js'); // eslint-disable-line no-unused-
* Execution sequence when GatherRunner.run() is called:
*
* 1. Setup
* A. navigate to about:blank
* B. driver.connect()
Copy link
Member

Choose a reason for hiding this comment

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

I think this is now

A. driver.connect()
B. navigate to about:blank

* v. register a performance observer
* vi. register dialog dismisser
* vii. clearDataForOrigin
* i. navigate to a blank page
Copy link
Member

Choose a reason for hiding this comment

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

remove line

* i. navigate to about:blank
* ii. Enable network request blocking for specified patterns
* iii. all gatherers' beforePass()
* i. Enable network request blocking for specified patterns
Copy link
Member

Choose a reason for hiding this comment

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

still need i. navigate to about:blank from master (we could maybe add a parenthetical about the first pass? but I don't think it's needed for just the overview up here)

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

looks great!!

@patrickhulce patrickhulce merged commit af7af07 into master Oct 25, 2018
@patrickhulce patrickhulce deleted the avoid-load-blank-page-twice branch October 25, 2018 02:45
@patrickhulce patrickhulce mentioned this pull request Nov 1, 2018
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants