blob: 4023f85cf55a8a2e1690cc99394a72bd1c94c37e [file] [log] [blame]
Tests that incomplete (not fully loaded/decoded) images cannot be used to create a CanvasPattern.<br/><br/>
<script>
if (window.testRunner)
testRunner.dumpAsText();
var canvas = document.createElement("canvas");
var ctx = canvas.getContext('2d');
ctx.fillRect(0,0,150,150);
var img = new Image();
img.src = 'resources/image-slow.pl';
var ptrn
try {
ptrn = ctx.createPattern(img, 'repeat');
if (!img.complete)
document.write("PASS - image is not complete");
else
document.write("FAIL - image is complete");
document.write("<br/>");
if (!ptrn)
document.write("PASS - createPattern() failed for incomplete image");
else
document.write("FAIL - createPattern() succeeded for incomplete image");
} catch (e) {
document.write("FAIL - caught exception: " + e);
}
</script>