summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/browsing-topics/xhr-without-topics-attribute.tentative.https.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/browsing-topics/xhr-without-topics-attribute.tentative.https.html')
-rw-r--r--testing/web-platform/tests/browsing-topics/xhr-without-topics-attribute.tentative.https.html26
1 files changed, 26 insertions, 0 deletions
diff --git a/testing/web-platform/tests/browsing-topics/xhr-without-topics-attribute.tentative.https.html b/testing/web-platform/tests/browsing-topics/xhr-without-topics-attribute.tentative.https.html
new file mode 100644
index 0000000000..47bc1049e4
--- /dev/null
+++ b/testing/web-platform/tests/browsing-topics/xhr-without-topics-attribute.tentative.https.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<body>
+ <script src=/resources/testharness.js></script>
+ <script src=/resources/testharnessreport.js></script>
+ <script>
+ promise_test(async t => {
+ const xhr = new XMLHttpRequest();
+
+ let xhr_response = new Promise((resolve, reject) => {
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == XMLHttpRequest.DONE) {
+ // The request was not eligible for topics, as the
+ // `deprecatedBrowsingTopics` attribtue was not set.
+ assert_equals(xhr.responseText, "NO_TOPICS_HEADER");
+ resolve();
+ }
+ }
+ });
+
+ xhr.open('GET', './resources/check-topics-request-header.py');
+ xhr.send();
+
+ await xhr_response;
+ }, 'test XHR that does not set the deprecatedBrowsingTopics attribtue');
+ </script>
+</body>