blob: 57e2937dc05cf5abfa531c982206d021d7cf0496 [file] [log] [blame]
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<p id="description"></p>
<div id="console"></div>
<script>
test(function(t) {
var canvas = document.createElement("canvas");
var ctx = canvas.getContext('2d');
ctx.arc(10, 10, 5, 0, 1, false);
ctx.arc(10, 10, 0, 0, 1, false);
assert_throws(null, function() {ctx.arc(10, 10, -5, 0, 1, false);});
ctx.arcTo(10, 10, 20, 20, 5);
ctx.arcTo(10, 10, 20, 20, 0);
assert_throws(null, function() {ctx.arcTo(10, 10, 20, 20, -5);});
var path = new Path2D();
path.arc(10, 10, 5, 0, 1, false);
path.arc(10, 10, 0, 0, 1, false);
assert_throws(null, function() {path.arc(10, 10, -5, 0, 1, false);});
path.arcTo(10, 10, 20, 20, 5);
path.arcTo(10, 10, 20, 20, 0);
assert_throws(null, function() {path.arcTo(10, 10, 20, 20, -5);});
}, 'Tests CanvasPath arc and arcTo with negative radii.');
</script>