blob: aa809935b0565a82897961acecee47e46220501b [file] [log] [blame]
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<body>
<script>
test(function(t) {
var ctx = document.createElement('canvas').getContext('2d');
document.body.appendChild(ctx.canvas);
ctx.strokeStyle = '#f00';
ctx.lineWidth = 20;
ctx.fillStyle = '#0f0';
ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
ctx.beginPath();
ctx.moveTo(10, 10);
ctx.lineTo(100, 100);
ctx.closePath();
ctx.stroke();
var imageData = ctx.getImageData(0, 0, 1, 1);
var imgdata = imageData.data;
assert_equals(imgdata[0], 0);
assert_equals(imgdata[1], 255);
assert_equals(imgdata[2], 0);
assert_equals(imgdata[3], 255);
}, "Test the behavior of closePath on a path with a single point");
</script>
</body>