<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<body>
<script>
test(function(t) {
var ctx = document.createElement('canvas').getContext('2d');
ctx.beginPath();
var p1 = new Path2D();
p1.rect(0,0,100,100);
ctx.fillStyle = 'yellow';
ctx.fill(p1);
assert_array_equals(ctx.getImageData(1, 0, 1, 1).data, [255, 255, 0, 255]);
ctx.beginPath();
var p2 = new Path2D("M100,0L200,0L200,100L100,100z");
ctx.fillStyle = 'blue';
ctx.fill(p2);
assert_array_equals(ctx.getImageData(101, 0, 1, 1).data, [0, 0, 255, 255]);
ctx.beginPath();
var p3 = new Path2D(p1);
ctx.translate(200,0);
ctx.fillStyle = 'green';
ctx.fill(p3);
ctx.translate(-200,0);
assert_array_equals(ctx.getImageData(201, 0, 1, 1).data, [0, 128, 0, 255]);
}, "Test different constructors of Path.");
</script>
</body>