blob: 9371f46e92c34053af9a0bc91f6e03a0fd191937 [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 currentY",
test() {
let context = document.createElement("canvas").getContext("2d");
InspectorTest.expectEqual(context.currentY, 0, "Should match at start.");
context.moveTo(1, 2);
InspectorTest.expectEqual(context.currentY, 2, "Should match after moveTo.");
context.lineTo(3, 4);
InspectorTest.expectEqual(context.currentY, 4, "Should match after lineTo.");
context.quadraticCurveTo(5, 6, 7, 8);
InspectorTest.expectEqual(context.currentY, 8, "Should match after quadraticCurveTo.");
context.bezierCurveTo(9, 10, 11, 12, 13, 14);
InspectorTest.expectEqual(context.currentY, 14, "Should match after bezierCurveTo.");
context.arcTo(15, 16, 17, 18, 19);
InspectorTest.expectEqual(context.currentY, 16, "Should match after arcTo.");
context.closePath();
InspectorTest.expectEqual(context.currentY, 2, "Should match after closePath.");
context.rect(20, 21, 1, 1);
InspectorTest.expectEqual(context.currentY, 21, "Should match after rect.");
context.arc(22, 23, 1, 0, 2 * Math.PI);
InspectorTest.expectEqual(context.currentY, 23, "Should match after arc.");
context.ellipse(24, 25, 1, 1, 0, 0, 2 * Math.PI);
InspectorTest.expectEqual(context.currentY, 25, "Should match after ellipse.");
context.beginPath();
InspectorTest.expectEqual(context.currentY, 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>