chromium/third_party/blink/web_tests/http/tests/security/subresourceIntegrity/revalidation-succeeded-script.html

<!DOCTYPE html>
<html>
<head>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<script>
  var foo;
  var t_script = async_test(
    "SRI with script with successful revalidation shouldn't crash");
  window.onload = () => t_script.step_timeout(revalidate_script, 0);
  function revalidate_script() {
    var script = document.createElement('script');
    script.integrity = "sha256-tbudgBSg+bHWHiHnlteNzN8TUvI80ygS9IULh4rklEw=";
    script.onload = t_script.step_func_done();
    script.onerror = t_script.unreached_func('Second request should pass');
    script.src =
      "../../cache/resources/etag.php?revalidation-failed-script";
    document.head.appendChild(script);
  }
</script>
<script
  src="../../cache/resources/etag.php?revalidation-failed-script"
  type="text/javascript"
  integrity="sha256-tbudgBSg+bHWHiHnlteNzN8TUvI80ygS9IULh4rklEw="
  onerror="t_script.unreached_func('First request should pass')()"
></script>
</html>