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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/gradient-addColorStop-with-invalid-offset.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/gradient-addColorStop-with-invalid-offset.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/gradient-addColorStop-with-invalid-offset.html b/third_party/WebKit/LayoutTests/fast/canvas/gradient-addColorStop-with-invalid-offset.html
index f340a48bad04209feb7bc7a18176e8e686c066fd..c2640a4a84b86c6d0e89575354554edcbd615866 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/gradient-addColorStop-with-invalid-offset.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/gradient-addColorStop-with-invalid-offset.html
@@ -1,9 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
-<body>
-<script src="script-tests/gradient-addColorStop-with-invalid-offset.js"></script>
-</body>
-</html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+test(function() {
+
+ var gradient = document.createElement('canvas').getContext('2d').createLinearGradient(0, 0, 150, 0);
+
+ assert_throws(null, function(){gradient.addColorStop(-1, '#000');});
+ assert_throws(null, function(){gradient.addColorStop(2, '#000');});
+ assert_throws(null, function(){gradient.addColorStop(Infinity, '#000');});
+ assert_throws(null, function(){gradient.addColorStop(-Infinity, '#000');});
+ assert_throws(null, function(){gradient.addColorStop(NaN, '#000');});
+
+}, 'This test checks invalid offsets on gradients.');
+</script>

Powered by Google App Engine
This is Rietveld 408576698