wpt / speculation-rules / invalid-rules.https.html?prerender

Open test on wpt.live | wpt.fyi

Runs: Chrome 160.0.8195.0 (wpt@1ab8957e4, 2026-12-01) | Firefox 163.0a1 (wpt@1ab8957e4, 2026-12-01) | Safari 257 preview (wpt@1ab8957e4, 2026-12-01) | Ladybird 1.0-84d7c (wpt@d7c0a00b7, 2026-12-02) | Servo Servo 0.8 (wpt@75c11f957, 2026-12-01) | Blitz af350c0af (wpt@705f393a6, 2026-12-02)

ChromeFirefoxSafariLadybirdServoBlitz
Total1/11/11/10/10/1NOT RUN
SubtestChromeFirefoxSafariLadybirdServoBlitz
an unrecognized key in a prerender rule should prevent it from being preloadedPASSPASSPASS———

/speculation-rules/invalid-rules.https.html

<!DOCTYPE html>
<meta name="timeout" content="long">
<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="/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js"></script>
<script src="resources/utils.js"></script>

<meta name="variant" content="?prefetch">
<meta name="variant" content="?prerender">

<script>
setup(() => assertSpeculationRulesIsSupported());

const preloadingType = location.search.substring(1);

promise_test(async t => {
  const rcHelper = new PreloadingRemoteContextHelper();
  const referrerRC = await rcHelper.addWindow();

  const destinationRC = await referrerRC.addPreload(preloadingType, {
    extrasInSpeculationRule: { invalid_key: "value" }
  });

  await referrerRC.navigateTo(destinationRC.url);

  const headers = await destinationRC.getRequestHeaders();
  assert_false(headers.has("Sec-Purpose"));
}, `an unrecognized key in a ${preloadingType} rule should prevent it from being preloaded`);
</script>