gecko-dev/content/canvas/test/test_mozDashOffset.html
Nicholas Cameron b3a448668a Bug 800556; test for mozDashOffset errors; r=Ms2ger
--HG--
extra : rebase_source : 834c2d1c426a8f33b66ee60e3fef912d652d5f59
2012-11-13 21:39:37 -08:00

40 lines
1021 B
HTML

<!DOCTYPE HTML>
<html>
<head>
<title>Test for mozDashOffset</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<p id="display">
<canvas id="c" width="100" height="100"><p class="fallback">FAIL (fallback content)</p></canvas>
</p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script>
try {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.mozDash = [1, 1];
ctx.mozDashOffset = 1;
ctx.mozDashOffset = Infinity;
ok(ctx.mozDashOffset === 1, "ctx.mozDashOffset === 1");
ctx.mozDashOffset = 1;
ctx.mozDashOffset = -Infinity;
ok(ctx.mozDashOffset === 1, "ctx.mozDashOffset === 1");
ctx.mozDashOffset = 1;
ctx.mozDashOffset = NaN;
ok(ctx.mozDashOffset === 1, "ctx.mozDashOffset === 1");
} catch(e) {
ok(false, "unexpected exception thrown in: test_mozDashOffset.html");
}
</script>
</pre>
</body>
</html>