commit 6e375277a94e5c4c677c7db39069157c037f4e9a
parent 5da109fb9e2fbeb4f23103d2eca431d928a420fa
Author: Yoav Weiss <yoav.weiss@shopify.com>
Date: Thu, 6 Nov 2025 21:35:55 +0000
Bug 1993991 [wpt PR 55386] - Export WebKit inline speculation rules after stylesheet test, a=testonly
Automatic update from web-platform-tests
Export WebKit inline speculation rules after stylesheet test (#55386)
--
wpt-commits: 3fc5c40514e71c2e88fb421a8446377fe1d113dc
wpt-pr: 55386
Diffstat:
1 file changed, 34 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/speculation-rules/prefetch/inline-speculation-rules-after-stylesheet.https.html b/testing/web-platform/tests/speculation-rules/prefetch/inline-speculation-rules-after-stylesheet.https.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/utils.js"></script>
+<script src="/common/dispatcher/dispatcher.js"></script>
+<script src="../resources/utils.js"></script>
+<script src="resources/utils.sub.js"></script>
+<link rel="stylesheet" href="/css/cssom/support/black.css">
+
+<body>
+<script type="speculationrules">
+{
+ "prefetch": [{
+ "where": { "href_matches": "*prefetch.py*" },
+ "eagerness":"immediate"
+ }]
+}
+</script>
+
+<script>
+ setup(() => assertSpeculationRulesIsSupported());
+
+ promise_test(async t => {
+ const url = getPrefetchUrl();
+ addLink(url);
+
+ await new Promise(resolve => t.step_timeout(resolve, 2000));
+
+ assert_equals(await isUrlPrefetched(url), 1, 'URL should be prefetched');
+ }, 'Inline speculation rules script after an external stylesheet should work');
+
+</script>
+</body>
+</html>