Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /browsing-topics/fetch-topics-insecure-context.tentative.http.html - WPT Dashboard Interop Dashboard
<!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>