summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/browsing-topics/fetch-topics-insecure-context.tentative.http.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/browsing-topics/fetch-topics-insecure-context.tentative.http.html')
-rw-r--r--testing/web-platform/tests/browsing-topics/fetch-topics-insecure-context.tentative.http.html17
1 files changed, 17 insertions, 0 deletions
diff --git a/testing/web-platform/tests/browsing-topics/fetch-topics-insecure-context.tentative.http.html b/testing/web-platform/tests/browsing-topics/fetch-topics-insecure-context.tentative.http.html
new file mode 100644
index 0000000000..d4cdd9ae95
--- /dev/null
+++ b/testing/web-platform/tests/browsing-topics/fetch-topics-insecure-context.tentative.http.html
@@ -0,0 +1,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>