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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/linearGradient-infinite-values.html

Issue 2703803002: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: Addressing comments Created 3 years, 10 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: third_party/WebKit/LayoutTests/fast/canvas/linearGradient-infinite-values.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/linearGradient-infinite-values.html b/third_party/WebKit/LayoutTests/fast/canvas/linearGradient-infinite-values.html
index 3e4694a76912fedfe25f82bda3d79ec56365e5dd..97c6eb9eeb41d7482f44f116f2fd8116cb630cc1 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/linearGradient-infinite-values.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/linearGradient-infinite-values.html
@@ -1,9 +1,30 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
-<body>
-<script src="script-tests/linearGradient-infinite-values.js"></script>
-</body>
-</html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<script>
+// This test checks createLinearGradient with infinite values
+var ctx = document.createElement('canvas').getContext('2d');
+
+function testCreateLinearGradient(params)
+{
+ x0 = params[0]; y0 = params[1]; x1 = params[2]; y1 = params[3];
+ assert_throws(null, function(){ctx.createLinearGradient(x0, y0, x1, y1);});
+}
+
+var testScenarios = [
+ ['Test createLinearGradient(0, 0, 100, NaN)' , [0, 0, 100, NaN]],
+ ['Test createLinearGradient(0, 0, 100, Infinity)' , [0, 0, 100, Infinity]],
+ ['Test createLinearGradient(0, 0, 100, -Infinity)' , [0, 0, 100, -Infinity]],
+ ['Test createLinearGradient(0, 0, NaN, 100)' , [0, 0, NaN, 100]],
+ ['Test createLinearGradient(0, 0, Infinity, 100)' , [0, 0, Infinity, 100]],
+ ['Test createLinearGradient(0, 0, -Infinity, 100)' , [0, 0, -Infinity, 100]],
+ ['Test createLinearGradient(0, NaN, 100, 100)' , [0, NaN, 100, 100]],
+ ['Test createLinearGradient(0, Infinity, 100, 100)' , [0, Infinity, 100, 100]],
+ ['Test createLinearGradient(0, -Infinity, 100, 100)' , [0, -Infinity, 100, 100]],
+ ['Test createLinearGradient(NaN, 0, 100, 100)' , [NaN, 0, 100, 100]],
+ ['Test createLinearGradient(Infinity, 0, 100, 100)' , [Infinity, 0, 100, 100]],
+ ['Test createLinearGradient(-Infinity, 0, 100, 100)' , [-Infinity, 0, 100, 100]],
+];
+
+generate_tests(testCreateLinearGradient, testScenarios);
+</script>

Powered by Google App Engine
This is Rietveld 408576698