Index: LayoutTests/fast/canvas/ellipse-crash.html |
diff --git a/LayoutTests/fast/canvas/ellipse-crash.html b/LayoutTests/fast/canvas/ellipse-crash.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..71dc1b50a9ee5bbc816de1362918addeaabef043 |
--- /dev/null |
+++ b/LayoutTests/fast/canvas/ellipse-crash.html |
@@ -0,0 +1,50 @@ |
+<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 ellipse"); |
+ var canvas = document.getElementById("test"); |
+ var context = canvas.getContext("2d"); |
+ context.fillStyle = '#f00'; |
+ context.fillRect(0, 0, canvas.width, canvas.height); |
+ try { |
+ context.ellipse(10, 10, 20, 20, 0, 20, 1.0/0.0, true); |
+ context.ellipse(10, 10, 20, 20, 0, 20, 1.0/0.0, true); |
+ context.ellipse(10, 10, 1.0/0.0, 0, 0, 20, 20, true); |
+ context.ellipse(10, 10, 0, 1.0/0.0, 0, 20, 20, true); |
+ context.ellipse(10, 10, 20, 20, 1.0/0.0, 20, 20, true); |
+ context.ellipse(10, 10, 20, 20, 0, 1.0/0.0, 20, true); |
+ context.ellipse(10, 1.0/0.0, 10, 10, 0, 20, 20, true); |
+ context.ellipse(1.0/0.0, 10, 10, 10, 0, 20, 20, true); |
+ context.ellipse(10, 10, 20, 20, 0, 20, 1.0/0.0, false); |
+ context.ellipse(10, 10, 1.0/0.0, 0, 0, 20, 20, false); |
+ context.ellipse(10, 10, 0, 1.0/0.0, 0, 20, 20, false); |
+ context.ellipse(10, 10, 20, 20, 1.0/0.0, 20, 20, false); |
+ context.ellipse(10, 10, 20, 20, 0, 1.0/0.0, 20, false); |
+ context.ellipse(10, 1.0/0.0, 10, 10, 0, 20, 20, false); |
+ context.ellipse(1.0/0.0, 10, 10, 10, 0, 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> |
+ |