summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/browsing-topics/xhr-without-topics-attribute.tentative.https.html
blob: 47bc1049e4c26839ead80c6379eff60726a123e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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>