blob: 9295847e931f56ab0af7231d9d56385f00cd63f6 [file] [log] [blame]
<!DOCTYPE html>
<title>Canvas test: 2d.coordinatespace</title>
<script src="../tests.js"></script>
<link rel="stylesheet" href="../tests.css">
<body>
<p id="passtext">Pass</p>
<p id="failtext">Fail</p>
<p class="output">These images should be identical:</p>
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<p class="output expectedtext">Expected output:<p><img src="2d.coordinatespace.png" class="output expected" id="expected" alt="">
<ul id="d"></ul>
<script>
_addTest(function(canvas, ctx) {
ctx.fillStyle = '#00f';
ctx.fillRect(0, 0, 100, 50);
ctx.fillStyle = '#0ff';
ctx.fillRect(0, 0, 50, 25);
_assertPixel(canvas, 25,12, 0,255,255,255, "25,12", "0,255,255,255");
_assertPixel(canvas, 75,12, 0,0,255,255, "75,12", "0,0,255,255");
_assertPixel(canvas, 25,37, 0,0,255,255, "25,37", "0,0,255,255");
_assertPixel(canvas, 75,37, 0,0,255,255, "75,37", "0,0,255,255");
_requireManualCheck(); // because we can't tell that getPixelData isn't using the wrong coordinate space too
});
</script>