From 3fb9aa8f1e1564c2f73f4d35d46ba5a8953c4dd3 Mon Sep 17 00:00:00 2001 From: Hiroshige Hayashizaki Date: Mon, 17 Apr 2023 00:23:37 -0700 Subject: [PATCH] [WPT] Use sourceDocument for prefetch record lookup WPT updates for https://github.com/WICG/nav-speculation/pull/267: - Updated the expected behavior for an existing test: `prerender/prefetch.https.html`. - Added other prefetch test cases. Except for "" subtest, `sourceDocument` is different from `navigable's active document`. Chromium's status: - "" subtest - already passing - Others -- failing. Some of them will pass after [1], and remaining failures after [1] are tracked by https://crbug.com/1432886. [1] https://chromium-review.googlesource.com/c/chromium/src/+/4372403 Bug: 1432886, 1422815, https://github.com/WICG/nav-speculation/pull/267 Change-Id: I4098347c42f45188811700fcc8d7925bcc3c4162 --- .../initiators-a-element.sub.https.html | 78 +++++++++++++++++++ ...iators-iframe-location-href.sub.https.html | 47 +++++++++++ .../initiators-window-open.sub.https.html | 67 ++++++++++++++++ .../prerender/prefetch.https.html | 4 +- 4 files changed, 194 insertions(+), 2 deletions(-) create mode 100644 speculation-rules/prefetch/initiators-a-element.sub.https.html create mode 100644 speculation-rules/prefetch/initiators-iframe-location-href.sub.https.html create mode 100644 speculation-rules/prefetch/initiators-window-open.sub.https.html diff --git a/speculation-rules/prefetch/initiators-a-element.sub.https.html b/speculation-rules/prefetch/initiators-a-element.sub.https.html new file mode 100644 index 00000000000000..8080faf9dd846a --- /dev/null +++ b/speculation-rules/prefetch/initiators-a-element.sub.https.html @@ -0,0 +1,78 @@ + + + + + + + + + diff --git a/speculation-rules/prefetch/initiators-iframe-location-href.sub.https.html b/speculation-rules/prefetch/initiators-iframe-location-href.sub.https.html new file mode 100644 index 00000000000000..25270b8f7dcbe7 --- /dev/null +++ b/speculation-rules/prefetch/initiators-iframe-location-href.sub.https.html @@ -0,0 +1,47 @@ + + + + + + + + + diff --git a/speculation-rules/prefetch/initiators-window-open.sub.https.html b/speculation-rules/prefetch/initiators-window-open.sub.https.html new file mode 100644 index 00000000000000..c2e52adf2bd1f0 --- /dev/null +++ b/speculation-rules/prefetch/initiators-window-open.sub.https.html @@ -0,0 +1,67 @@ + + + + + + + + + diff --git a/speculation-rules/prerender/prefetch.https.html b/speculation-rules/prerender/prefetch.https.html index 48de5adca13e0a..2a1553b3d94bb7 100644 --- a/speculation-rules/prerender/prefetch.https.html +++ b/speculation-rules/prerender/prefetch.https.html @@ -15,7 +15,7 @@ await create_prerendered_page(t, {}, {prefetch: true}, {}); assert_equals(await tryToActivate(), 'activated'); - assert_equals(await getNetworkRequestCount(), '2', 'Network request count'); -}, "Prerender navigation requests don't use prefetched results (for now)"); + assert_equals(await getNetworkRequestCount(), '1', 'Network request count'); +}, "Prerender navigation requests should use prefetched results");