blob: 09b5e8e9b41e411e5ef468361deb19b48a4401a2 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../../http/tests/inspector/resources/inspector-test.js"></script>
<script>
function test() {
let suite = InspectorTest.createSyncSuite("IDLExtensions.CanvasRenderingContext2D");
suite.addTestCase({
name: "IDLExtensions.CanvasRenderingContext2D.get currentX",
test() {
let context = document.createElement("canvas").getContext("2d");
InspectorTest.expectEqual(context.currentX, 0, "Should match at start.");
context.moveTo(1, 2);
InspectorTest.expectEqual(context.currentX, 1, "Should match after moveTo.");
context.lineTo(3, 4);
InspectorTest.expectEqual(context.currentX, 3, "Should match after lineTo.");
context.quadraticCurveTo(5, 6, 7, 8);
InspectorTest.expectEqual(context.currentX, 7, "Should match after quadraticCurveTo.");
context.bezierCurveTo(9, 10, 11, 12, 13, 14);
InspectorTest.expectEqual(context.currentX, 13, "Should match after bezierCurveTo.");
context.arcTo(15, 16, 17, 18, 19);
InspectorTest.expectEqual(context.currentX, 15, "Should match after arcTo.");
context.closePath();
InspectorTest.expectEqual(context.currentX, 1, "Should match after closePath.");
context.rect(20, 21, 1, 1);
InspectorTest.expectEqual(context.currentX, 20, "Should match after rect.");
context.arc(22, 23, 1, 0, 2 * Math.PI);
InspectorTest.expectEqual(context.currentX, 23, "Should match after arc.");
context.ellipse(24, 25, 1, 1, 0, 0, 2 * Math.PI);
InspectorTest.expectEqual(context.currentX, 25, "Should match after ellipse.");
context.beginPath();
InspectorTest.expectEqual(context.currentX, 0, "Should match after beginPath.");
},
});
suite.runTestCasesAndFinish();
}
</script>
</head>
<body onload="runTest()">
<p>Test that the IDL extensions for CanvasRenderingContext2D work correctly.</p>
</body>
</html>