summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/shared-storage/shared-storage-writable-insecure-context.tentative.http.sub.html
blob: debb6cf9c56fb4cda8e72293e0de4b533648c845 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!doctype html>
<body>
  <script src=/resources/testharness.js></script>
  <script src=/resources/testharnessreport.js></script>
  <script>
    'use strict';

    promise_test(async t => {
      try {
        new Request('./resources/simple-module.js',
                    {sharedStorageWritable: true});
      } catch (e) {
        assert_equals(e.name, 'TypeError');
        assert_equals(e.message, `Failed to construct 'Request': `
                      + `sharedStorageWritable: sharedStorage operations `
                      + `are only available in secure contexts.`);
        return;
      }
      assert_unreached("did not reject");
    }, 'sharedStorageWritable not allowed in insecure context.');
  </script>
</body>