core(driver): extract waitFor methods#11685
Merged
Merged
Conversation
130c60f to
f72b2aa
Compare
patrickhulce
commented
Nov 19, 2020
| * Returns a promise that resolve when a frame has been navigated. | ||
| * Used for detecting that our about:blank reset has been completed. | ||
| * @param {LH.Gatherer.FRProtocolSession} session | ||
| * @return {CancellableWait} |
Collaborator
Author
There was a problem hiding this comment.
this is the only return type change, being more consistent felt like it belonged here even if we don't use cancel yet
| * @param {number} networkQuietThresholdMs | ||
| * @return {CancellableWait} | ||
| */ | ||
| function waitForNetworkIdle(session, networkMonitor, networkQuietThresholdMs) { |
Collaborator
Author
There was a problem hiding this comment.
extracting session and networkMonitor to parameters are the only substantive changes in this PR
|
|
||
| const checkForQuietExpression = `(${pageFunctions.checkTimeSinceLastLongTaskString})()`; | ||
| /** | ||
| * @param {ExecutionContext} executionContext |
Collaborator
Author
There was a problem hiding this comment.
directly using executionContext is an FR-compat change and functionally equivalent to using driver when isolation is disabled
| async function waitForFullyLoaded(session, networkMonitor, options) { | ||
| const {pauseAfterFcpMs, pauseAfterLoadMs, networkQuietThresholdMs, | ||
| cpuQuietThresholdMs, maxWaitForLoadedMs, maxWaitForFcpMs} = options; | ||
| const {waitForFcp, waitForLoadEvent, waitForNetworkIdle, waitForCPUIdle} = |
Collaborator
Author
There was a problem hiding this comment.
the last remaining change that exposes the underlying waits for easier testing
connorjclark
approved these changes
Nov 19, 2020
Co-authored-by: Connor Clark <cjamcl@google.com>
This was referenced Dec 1, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Paves the way for adding the extra waitFor methods needed for #11180 in a way that still helps out with fraggle rock and makes future testing easier.
This is a move and slight restructuring to convert
thisreferences to parameters only. No functionality changes, and no substantive test additions (though the gaps are much more obvious and should be much easier to test now).Related Issues/PRs
ref #11313 , #11180 , #10810