<!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>
