github web-platform-tests/wpt merge_pr_46370

latest releases: merge_pr_49470, epochs/three_hourly/2024-12-03_06H, epochs/six_hourly/2024-12-03_06H...
7 months ago

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

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}

Don't miss a new wpt release

NewReleases is sending notifications on new releases.