summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/browsing-topics/fetch-topics-insecure-context.tentative.http.html
blob: d4cdd9ae95c3550474b0a090c29a598a730aea3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!doctype html>
<body>
  <script src=/resources/testharness.js></script>
  <script src=/resources/testharnessreport.js></script>
  <script>
    promise_test(async t => {
      try {
        let response = await fetch('./resources/check-topics-request-header.py', {browsingTopics: true});
      } catch (e) {
        assert_equals(e.name, 'TypeError');
        assert_equals(e.message, 'Failed to execute \'fetch\' on \'Window\': browsingTopics: Topics operations are only available in secure contexts.');
        return;
      }
      assert_unreached("did not reject");
    }, 'test fetch(<url>, {browsingTopics: true}) in insecure context');
  </script>
</body>