chromium/third_party/blink/web_tests/http/tests/images/resources/image-decode-local.html

<!doctype HTML>

<div id="container"></div>

<script>
var img = new Image();
img.src = '/resources/square100.png';
img.decode().then(function() {
  document.getElementById("container").appendChild(img);
  window.parent.postMessage("pass", "*");
}, function() {
  window.parent.postMessage("fail", "*");
});
</script>