csp-script-src-unsafe-inline.https.html (1100B)
1 <!DOCTYPE html> 2 <meta name="variant" content="?target_hint=_self"> 3 <meta name="variant" content="?target_hint=_blank"> 4 <meta name="timeout" content="long"> 5 <script src="/common/utils.js"></script> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <script src="../resources/utils.js"></script> 9 <script src="resources/utils.js"></script> 10 11 <body> 12 <script> 13 setup(() => assertSpeculationRulesIsSupported()); 14 15 promise_test(async t => { 16 // The key used for storing a test result in the server. 17 const key = token(); 18 19 // Open the test runner in a popup - it will prerender itself, record the 20 // test results, and send them back to this harness. 21 const url = 22 `resources/csp-script-src-unsafe-inline.html?key=${key}&target_hint=${getTargetHint()}`; 23 window.open(url, '_blank', 'noopener'); 24 25 // Wait until the test sends us the results. 26 const result = await nextValueFromServer(key); 27 28 assert_equals(result, "true", "initial document.prerendering"); 29 }, 'Test if CSP script-src unsafe-inline permits inline speculationrules.'); 30 </script>