chromium/third_party/blink/web_tests/fast/canvas/canvas-createImageBitmap-svg-image.html

<!doctype html>
<style>
svg {
  display: none;
}
canvas {
  border: 1px solid black;
}
</style>

<svg id="s1" width="200px" height="20px">
  <image id="img1" href="resources/pattern.png" x="0" y="0" width="20px" height="20px" />
  <image id="img2" href="resources/pattern.png" x="20" y="0" width="40px" height="40px" />
  <image id="img3" href="resources/pattern.png" x="40" y="0" width="40px" height="40px" />
  <image id="img4" href="invalid" x="60" y="0" width="20px" height="20px" />
  <image id="img5" href="resources/pattern.png" x="80" y="0" width="20px" height="20px" />
</svg>

<canvas id="c1" width="20" height="20"></canvas>
<canvas id="c2" width="20" height="20"></canvas>
<canvas id="c3" width="20" height="20"></canvas>
<canvas id="c4" width="20" height="20"></canvas>
<canvas id="c5" width="20" height="20"></canvas>
<canvas id="c6" width="20" height="20"></canvas>

<script>
function draw(target, img, x, y, opts) {
  return new Promise((resolve)=> {
    createImageBitmap(document.getElementById(img), opts).then((ib) => {
      document.getElementById(target).getContext("2d").drawImage(
        ib, x || 0, y || 0);
      resolve();
    },
      resolve // createImageBitmap rejection forwarded to resolve
    );
  });
}

if (window.testRunner) {
  testRunner.waitUntilDone();
}

window.onload = async () => {
  await Promise.all([
    draw("c1", "img1"),
    draw("c2", "img2", 10, 10),
    draw("c3", "img3"),
    draw("c4", "img4"),
    draw("c6", "img2", 0, 0, {resizeWidth: 10, resizeHeight: 10})
  ]);
  document.getElementById("c5").getContext("2d").drawImage(
    document.getElementById("img5"), 0, 0);

  if (window.testRunner) {
    testRunner.notifyDone();
  }
}
</script>