From ce9ded3651870f462b67474b5b17f6c45be8e907 Mon Sep 17 00:00:00 2001 From: Hiroshige Hayashizaki Date: Mon, 17 Apr 2023 00:17:15 -0700 Subject: [PATCH] [WPT] Use sourceDocument for non-prerendering navigation In these test cases (except for "" subtest), sourceDocument is different from navigable's active document, and thus the behavior is affected by https://github.com/WICG/nav-speculation/pull/267. Chromium's status: - "" subtest - already passing - "location.href across iframe" subtest - failing, will pass after [1]. - Other tests - failing even after [1] (https://crbug.com/1432886). [1] https://chromium-review.googlesource.com/c/chromium/src/+/4372403 Bug: 1432886, 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 000000000000000..8080faf9dd846ab --- /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 000000000000000..25270b8f7dcbe75 --- /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 000000000000000..c2e52adf2bd1f0a --- /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 48de5adca13e0aa..2a1553b3d94bb7e 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");