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

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

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

  if (xhr.status !== 200)
    priorityPromise.then(reportFailure)
  else
    priorityPromise.then(reportLoaded)
</script>