Prerender: Clean up arguments of create_prerendered_page() used in WPTs #46370
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.
This CL cleans up create_prerendered_page() helper used in WPTs to
trigger prerendering. This is a preparation for adding No-Vary-Search
(NVS) header WPTs with speculation rules prerendering.
This CL merges
opt
andinit_opt
arguments oncreate_prerendered_page() into one
params
Object argument. This objectcontains
initiator
,prerendering
, andactivating
keys, and theirvalues are URLSearchParams. These search params are attached to
initiator navigation, prerendering navigation, and activating navigation
respectively. In this CL,
activating
is actually not used, but thiswill be necessary for NVS header WPTs to be added by follow-up CLs so
that the tests can specify varied search params.
This CL also repurposes
opt
argument for controlling behavior of thehelper. Before this CL, the helper checked
init_opt.prefetch
to decideif prefetch should be triggered before prerendering. This was confusing
as
init_opt
was also used for specifying search params of theinitiator page. After this CL,
opt
is specialized for controlling suchbehavior and
prefetch
is specified there. This should be lessconfusing.
Change-Id: I158724c6bf996cfcc03a353133267809ea1e4999
Bug: 340928303
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5550431
Reviewed-by: Domenic Denicola <domenic@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1303551}