chromium/third_party/blink/web_tests/fast/canvas-api/drawImage-with-bad-canvas.html

<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>

<script>
test(function(){

    var canvas1 = document.createElement("canvas");
    var ctx1 = canvas1.getContext('2d');
    var canvas2 = document.createElement("canvas");
    // Terapixel canvas should fail to allocate
    canvas2.width = 1000000;
    canvas2.height = 1000000;
    var ctx2 = canvas2.getContext('2d');
    ctx2.drawImage(canvas1, 0, 0);

}, "This test checks behavior of drawImage on a canvas that failed to allocate its backing store. This test passes by not crashing.");
</script>