prefetch-ignores-prefetch-src.sub.html (853B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script src='/common/utils.js'></script> 7 <script src='/content-security-policy/support/testharness-helper.js'></script> 8 <script src="/content-security-policy/support/prefetch-helper.js"></script> 9 <meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self' 'unsafe-inline'; prefetch-src http://{{domains[www2]}}:{{ports[http][0]}}"/> 10 11 <script> 12 promise_test(async (t) => { 13 assert_false(await 14 try_to_prefetch('http://{{domains[www2]}}:{{ports[http][0]}}/common/dummy.xml', 15 t)); 16 }, "Prefetch should fail when restricted by default-src and allowed by " + 17 "unsupported prefetch-src directive (prefetch-src should be ignored)"); 18 </script> 19 </head> 20 <body></body> 21 </html>