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

Unified Diff: third_party/WebKit/LayoutTests/css3/filters/filter-property-parsing-invalid.html

Issue 2055733002: Clean up script-tests in css3/filters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix expectations for un-duped test Created 4 years, 6 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/css3/filters/filter-property-parsing-invalid.html
diff --git a/third_party/WebKit/LayoutTests/css3/filters/filter-property-parsing-invalid.html b/third_party/WebKit/LayoutTests/css3/filters/filter-property-parsing-invalid.html
index 7b066fb34e6eb47f81728237caeac422f4572d21..22747852601bd51544b108eed358482345095566 100644
--- a/third_party/WebKit/LayoutTests/css3/filters/filter-property-parsing-invalid.html
+++ b/third_party/WebKit/LayoutTests/css3/filters/filter-property-parsing-invalid.html
@@ -1,11 +1,82 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script src="script-tests/filter-property-parsing-invalid.js"></script>
-</body>
-</html>
+<!DOCTYPE html>
+<title>Parsing of the -webkit-filter property; invalid values</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../../css-parser/resources/property-parsing-test.js"></script>
+<script>
+assert_invalid_value("webkitFilter", "url(#a #b)"); // Too many parameters
+
+assert_invalid_value("webkitFilter", "grayscale(10px)"); // Length instead of number
+assert_invalid_value("webkitFilter", "grayscale(0.5 0.5)"); // Too many parameters
+assert_invalid_value("webkitFilter", "grayscale(0.5, 0.5)"); // Too many parameters and commas
+assert_invalid_value("webkitFilter", "grayscale(0.5,)"); // Trailing comma
+assert_invalid_value("webkitFilter", "grayscale(-0.5)"); // Negative parameter
+assert_invalid_value("webkitFilter", "grayscale(-10%)"); // Negative percent
+assert_invalid_value("webkitFilter", "grayscale(1.5)"); // Parameter out of bounds
+
+assert_invalid_value("webkitFilter", "sepia(0.5 0.5 3.0)"); // Too many parameters
+assert_invalid_value("webkitFilter", "sepia(0.1, 0.1)"); // Too many parameters and commas
+assert_invalid_value("webkitFilter", "sepia(0.5,)"); // Trailing comma
+assert_invalid_value("webkitFilter", "sepia(-0.01)"); // Negative parameter
+assert_invalid_value("webkitFilter", "sepia(-10%)"); // Negative percent
+assert_invalid_value("webkitFilter", "sepia(10000)"); // Parameter out of bounds
+
+assert_invalid_value("webkitFilter", "saturate(10px)"); // Length instead of number
+assert_invalid_value("webkitFilter", "saturate(0.5 0.5)"); // Too many parameters
+assert_invalid_value("webkitFilter", "saturate(0.5, 0.5)"); // Too many parameters and commas
+assert_invalid_value("webkitFilter", "saturate(0.5,)"); // Trailing comma
+assert_invalid_value("webkitFilter", "saturate(-0.5)"); // Negative parameter
+assert_invalid_value("webkitFilter", "saturate(-10%)"); // Negative percent
+
+assert_invalid_value("webkitFilter", "hue-rotate(10)"); // Bare number
+assert_invalid_value("webkitFilter", "hue-rotate(10px)"); // Length
+assert_invalid_value("webkitFilter", "hue-rotate(10deg 4)"); // Too many parameters
+assert_invalid_value("webkitFilter", "hue-rotate(10deg, 5deg)"); // Too many parameters and commas
+assert_invalid_value("webkitFilter", "hue-rotate(10deg,)"); // Trailing comma
+
+assert_invalid_value("webkitFilter", "invert(10px)"); // Length instead of number
+assert_invalid_value("webkitFilter", "invert(0.5 0.5)"); // Too many parameters
+assert_invalid_value("webkitFilter", "invert(0.5, 0.5)"); // Too many parameters and commas
+assert_invalid_value("webkitFilter", "invert(0.5,)"); // Trailing comma
+assert_invalid_value("webkitFilter", "invert(-0.5)"); // Negative parameter
+assert_invalid_value("webkitFilter", "invert(1.5)"); // Parameter out of bounds
+
+assert_invalid_value("webkitFilter", "opacity(10px)"); // Length instead of number
+assert_invalid_value("webkitFilter", "opacity(0.5 0.5)"); // Too many parameters
+assert_invalid_value("webkitFilter", "opacity(0.5, 0.5)"); // Too many parameters and commas
+assert_invalid_value("webkitFilter", "opacity(0.5,)"); // Trailing comma
+assert_invalid_value("webkitFilter", "opacity(-0.5)"); // Negative parameter
+assert_invalid_value("webkitFilter", "opacity(-10%)"); // Negative percent
+assert_invalid_value("webkitFilter", "opacity(1.5)"); // Parameter out of bounds
+
+assert_invalid_value("webkitFilter", "brightness(10px)"); // Length instead of number
+assert_invalid_value("webkitFilter", "brightness(0.5 0.5)"); // Too many parameters
+assert_invalid_value("webkitFilter", "brightness(0.5, 0.5)"); // Too many parameters and commas
+assert_invalid_value("webkitFilter", "brightness(0.5,)"); // Trailing comma
+
+assert_invalid_value("webkitFilter", "contrast(10px)"); // Length instead of number
+assert_invalid_value("webkitFilter", "contrast(0.5 0.5)"); // Too many parameters
+assert_invalid_value("webkitFilter", "contrast(0.5, 0.5)"); // Too many parameters and commas
+assert_invalid_value("webkitFilter", "contrast(0.5,)"); // Trailing comma
+assert_invalid_value("webkitFilter", "contrast(-0.5)"); // Negative parameter
+assert_invalid_value("webkitFilter", "contrast(-10%)"); // Negative percent
+
+assert_invalid_value("webkitFilter", "blur(1)"); // Bare number
+assert_invalid_value("webkitFilter", "blur(-1px)"); // Negative number
+assert_invalid_value("webkitFilter", "blur(10%)"); // Percentage
+assert_invalid_value("webkitFilter", "blur(1px 1px)"); // Too many parameters
+assert_invalid_value("webkitFilter", "blur(1em, 1em)"); // Too many parameters and commas
+assert_invalid_value("webkitFilter", "blur(10px, 10px)"); // Commas
+assert_invalid_value("webkitFilter", "blur(1em,)"); // Trailing comma
+
+assert_invalid_value("webkitFilter", "drop-shadow()"); // No values
+assert_invalid_value("webkitFilter", "drop-shadow(red)"); // Missing lengths
+assert_invalid_value("webkitFilter", "drop-shadow(red 1px)"); // Not enough lengths
+assert_invalid_value("webkitFilter", "drop-shadow(red 1 2 3)"); // Missing units
+assert_invalid_value("webkitFilter", "drop-shadow(red 1px 2px 3px inset)"); // Inset
+assert_invalid_value("webkitFilter", "drop-shadow(red 1px 2px 3px 4px)"); // Too many parameters
+assert_invalid_value("webkitFilter", "drop-shadow(red, 1px, 2px, 3px)"); // Commas
+assert_invalid_value("webkitFilter", "drop-shadow(10px 10px -1px red)"); // Negative radius
+
+assert_invalid_value("webkitFilter", "fancify(150%)"); // Unknown function
+</script>

Powered by Google App Engine
This is Rietveld 408576698