blob: 1c2e410fb2a9519f0cff2a3f080d2d316eec70fe [file] [log] [blame]
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<body>
<canvas id="canvas" width="200" height="200"></canvas>
<script>
test(function(t) {
var ctx = document.getElementById('canvas').getContext('2d');
ctx.fillStyle = 'rgb(0, 255, 0)';
ctx.fillStyle = 'nonsense';
ctx.fillRect(0, 0, 200, 200);
var imageData = ctx.getImageData(0, 0, 200, 200);
var imgdata = imageData.data;
assert_equals(imgdata[4], 0);
assert_equals(imgdata[5], 255);
assert_equals(imgdata[6], 0);
}, 'Verify correct behaviour of canvas on an invalid fillStyle()');
</script>
</body>