chromium/third_party/blink/web_tests/fast/canvas/canvas-drawImage-incomplete.html

<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<body>
<script>
test(function(t) {
    var canvas = document.createElement("canvas");
    var ctx = canvas.getContext('2d');
    ctx.fillStyle = 'red';
    ctx.fillRect(0,0,150,150);
    
    var img = new Image();
    img.src = '../../http/tests/misc/resources/image-slow.pl';
    
    var video = document.createElement("video");
    
    assert_equals(ctx.drawImage(img, 0, 0), undefined);
    
    var imgdata = ctx.getImageData(0, 0, 1, 1).data;
    assert_equals(imgdata[0], 255);
    assert_equals(imgdata[1], 0);
    assert_equals(imgdata[2], 0);
    assert_equals(imgdata[3], 255);
    
    assert_equals(ctx.drawImage(video, 0, 0), undefined);
    
    imgdata = ctx.getImageData(0, 0, 1, 1).data;
    assert_equals(imgdata[0], 255);
    assert_equals(imgdata[1], 0);
    assert_equals(imgdata[2], 0);
    assert_equals(imgdata[3], 255);
}, "Test that drawImage() does nothing with an incomplete image or video");
</script>
</body>