chromium/third_party/blink/web_tests/http/tests/subresource_filter/collapsed-image-style-crash.html

<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<body>
<script type="text/javascript">
// Tests that style resolution of an an out-of-flow image that is disallowed thus collapsed doesn't crash.

if (window.testRunner) {
  // Inject a subresource filter to disallow 'beta.png'.
  testRunner.setDisallowedSubresourcePathSuffixes(["beta.png"], true /* block_subresources */);
}

async_test(t => {
  let i = document.createElement("img");
  i.style.position = 'absolute';
  i.onload = t.unreached_func();
  i.onerror = t.step_func_done(_ => {
    let style = window.getComputedStyle(i);
    assert_equals(style.display, "none", "Images that are disallowed should be set to display:none");
  });
  i.src = "resources/beta.png";
  document.body.append(i);
}, "Style resolution does not crash with disallowed out-of-flow images.");

</script>