summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/content-security-policy/prefetch-src/prefetch-blocked.html
blob: 890a65f82cf58b045bffc91fd10f6f7aa91ae185 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Security-Policy" content="prefetch-src 'none';">
  <script src='/resources/testharness.js'></script>
  <script src='/resources/testharnessreport.js'></script>
  <script src='/content-security-policy/support/testharness-helper.js'></script>
  <script src='/content-security-policy/support/prefetch-helper.js'></script>
  <script>
    async_test(t => {
      let url = window.origin + '/content-security-policy/support/fail.png';

      let link = document.createElement('link');
      link.rel = 'prefetch';
      link.href = url;

      assert_link_does_not_prefetch(t, link);
    }, "Blocked prefetch generates report.");
  </script>
</head>
<body>
</body>
</html>