invalid-rules.https.html (1135B)
1 <!DOCTYPE html> 2 <meta name="timeout" content="long"> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="/common/utils.js"></script> 6 <script src="/common/dispatcher/dispatcher.js"></script> 7 <script src="/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js"></script> 8 <script src="resources/utils.js"></script> 9 10 <meta name="variant" content="?prefetch"> 11 <meta name="variant" content="?prerender"> 12 13 <script> 14 setup(() => assertSpeculationRulesIsSupported()); 15 16 const preloadingType = location.search.substring(1); 17 18 promise_test(async t => { 19 const rcHelper = new PreloadingRemoteContextHelper(); 20 const referrerRC = await rcHelper.addWindow(); 21 22 const destinationRC = await referrerRC.addPreload(preloadingType, { 23 extrasInSpeculationRule: { invalid_key: "value" } 24 }); 25 26 await referrerRC.navigateTo(destinationRC.url); 27 28 const headers = await destinationRC.getRequestHeaders(); 29 assert_false(headers.has("Sec-Purpose")); 30 }, `an unrecognized key in a ${preloadingType} rule should prevent it from being preloaded`); 31 </script>