Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(704)

Unified Diff: LayoutTests/fast/canvas/ellipse-crash.html

Issue 14298022: Add support for new canvas ellipse method. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>
+

Powered by Google App Engine
This is Rietveld 408576698