chromium/third_party/blink/web_tests/http/tests/priorities/resources/xhr.html

<script src="common.js"></script>
<script>
  const url = new URL('../../resources/dummy.html?xhr', location);
  observeAndReportResourceLoadPriority(url);

  const xhr = new XMLHttpRequest();
  xhr.open('GET', url);
  xhr.send();

  xhr.onload = reportLoaded;
  xhr.onerror = reportFailure;
</script>