<html>
<head>
<script type="text/javascript">
function debug(str) {
    var c = document.getElementById('console')
    c.appendChild(document.createTextNode(str + '\n'));
}

function runTests() {
    debug("This tests that we don't crash when passing inf as a parameter to arc");
    var canvas = document.getElementById("test");
    var context = canvas.getContext("2d");
    context.fillStyle = '#f00';
    context.fillRect(0, 0, canvas.width, canvas.height);
    try {
        context.arc(10, 10, 20, 20, 1.0/0.0, true);
        context.arc(10, 10, 20, 20, 1.0/0.0, true);
        context.arc(10, 10, 1.0/0.0, 20, 20, true);
        context.arc(10, 10, 20, 1.0/0.0, 20, true);
        context.arc(10, 1.0/0.0, 10, 20, 20, true);
        context.arc(1.0/0.0, 10, 10, 20, 20, true);
        context.arc(10, 10, 20, 20, 1.0/0.0, false);
        context.arc(10, 10, 1.0/0.0, 20, 20, false);
        context.arc(10, 10, 20, 1.0/0.0, 20, false);
        context.arc(10, 1.0/0.0, 10, 20, 20, false);
        context.arc(1.0/0.0, 10, 10, 20, 20, false);
    } catch (e) {
    }
    context.fillStyle = '#0f0';
    context.fillRect(0, 0, canvas.width, canvas.height);
    debug("Test passed.");
    if (window.testRunner)
        testRunner.dumpAsText();
}
</script>
<title>borkedness</title>
</head>
<body>
   <canvas id="test" width="100" height="100"></canvas><br />
   <pre id="console"></pre>
   <script>
   runTests();
   </script>
</body>
</html>
