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

Prerender: Clean up arguments of create_prerendered_page() used in WPTs #46370

Merged
merged 1 commit into from
May 21, 2024

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented May 20, 2024

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 and init_opt arguments on
create_prerendered_page() into one params Object argument. This object
contains initiator, prerendering, and activating keys, and their
values 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 this
will 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 the
helper. Before this CL, the helper checked init_opt.prefetch to decide
if prefetch should be triggered before prerendering. This was confusing
as init_opt was also used for specifying search params of the
initiator page. After this CL, opt is specialized for controlling such
behavior and prefetch is specified there. This should be less
confusing.

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}

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` and `init_opt` arguments on
create_prerendered_page() into one `params` Object argument. This object
contains `initiator`, `prerendering`, and `activating` keys, and their
values 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 this
will 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 the
helper. Before this CL, the helper checked `init_opt.prefetch` to decide
if prefetch should be triggered before prerendering. This was confusing
as `init_opt` was also used for specifying search params of the
initiator page. After this CL, `opt` is specialized for controlling such
behavior and `prefetch` is specified there. This should be less
confusing.

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}
Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

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

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 495da8a into master May 21, 2024
16 of 19 checks passed
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-5550431 branch May 21, 2024 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants