Closed Bug 2078116 Opened 1 month ago Closed 1 month ago

[wpt-sync] Sync PR 63265 - Add WPT for prerender-until-script to prerender upgrade

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox160 fixed)

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 63265 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/63265
Details from upstream follow.

Viktoria Zlatinova <vizlatin@microsoft.com> wrote:

Add WPT for prerender-until-script to prerender upgrade

Adds a Web Platform Test for the prerender-until-script host upgrading
to a full prerender host when a matching prerender speculation rule is
added for the same URL. The upgrade unpauses the previously paused
inline JavaScript on the prerendered page, which the test verifies via
document.prerendering.

Flow:

  1. Initiator adds a prerender_until_script rule; the
    prerender-until-script host starts loading with inline JS paused.
  2. The prerendered page's async \<script src> tag fetches the
    "pus-loaded" signal (this fetch fires even with JS paused),
    which releases the initiator's hanging long-poll fetch.
  3. The initiator then adds a regular prerender rule for the same
    URL, triggering the upgrade.
  4. The previously paused inline \<script> finally runs, captures
    document.prerendering, and posts it back via PrerenderChannel.
  5. The initiator activates the prerender and the test asserts the
    captured value was true, proving the script ran during
    prerendering rather than after activation.

Without the upgrade (feature disabled), the inline JS never runs and
the test fails at a 30 s t.step_timeout with a diagnostic pointing
at the missing upgrade rather than a bare harness timeout.

A new prerender-until-script-upgrade virtual test suite enables
PrerenderUntilScriptUpgrade (browser-side, off by default) for
this test; exclusive_tests: "ALL" skips the bare non-virtual run
so the test only executes with the flag on.

The wptserve signal handler's long-poll loop is bounded at 60 s
(returning 504 on timeout). This is intentionally longer than the
test's own 30 s t.step_timeout, so the test's semantic diagnostic
remains the visible failure reason on a regression; the bound exists
to unblock the initiator's fetch so its reportFailure path can
close the popup cleanly rather than leaking a wptserve worker thread.

Bug: 504686720
Change-Id: I29d7dbed53d10b3c6164c398a502adb4f3fe2525
Reviewed-on: https://chromium-review.googlesource.com/7900337
WPT-Export-Revision: 2e111e9007339f650662132e21891decffea65fa

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 2 tests and 1 subtests

Status Summary

Firefox

ERROR: 1[GitHub] 2[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]

Chrome

OK : 1
FAIL : 1

Safari

ERROR: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
You need to log in before you can comment on or make changes to this bug.