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

Unified Diff: third_party/WebKit/LayoutTests/css3/filters/filter-property-parsing.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.html
diff --git a/third_party/WebKit/LayoutTests/css3/filters/filter-property-parsing.html b/third_party/WebKit/LayoutTests/css3/filters/filter-property-parsing.html
index ffb1de0ca88b4eae2a24f2ac1530e1d4f94dd7b5..a9c9178fcfc4dbfdcb35a715947ade7734c2f504 100644
--- a/third_party/WebKit/LayoutTests/css3/filters/filter-property-parsing.html
+++ b/third_party/WebKit/LayoutTests/css3/filters/filter-property-parsing.html
@@ -1,11 +1,97 @@
-<!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.js"></script>
-</body>
-</html>
+<!DOCTYPE html>
+<title>Parsing of the -webkit-filter property; valid 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_valid_value("webkitFilter", "url('#a')", 'url("#a")'); // Basic reference
+assert_valid_value("webkitFilter", "url(#a)", 'url("#a")'); // Bare unquoted reference converting to quoted form
+assert_valid_value("webkitFilter", "url('#a') url('#b')", 'url("#a") url("#b")'); // Multiple references
+
+assert_valid_value("webkitFilter", "grayscale(1) url('#a')", 'grayscale(1) url("#a")'); // Reference as 2nd value
+assert_valid_value("webkitFilter", "grayscale(1)"); // Integer value
+assert_valid_value("webkitFilter", "grayscale(50%)"); // Percentage value
+assert_valid_value("webkitFilter", "grayscale(1.0)", "grayscale(1)"); // Float value converts to integer
+assert_valid_value("webkitFilter", "grayscale(0)"); // Zero value
+assert_valid_value("webkitFilter", "grayscale()"); // No arguments
+assert_valid_value("webkitFilter", "grayscale(0.5) grayscale(0.25)"); // Multiple values
+
+assert_valid_value("webkitFilter", "sepia(1)"); // Integer value
+assert_valid_value("webkitFilter", "sepia(50%)"); // Percentage value
+assert_valid_value("webkitFilter", "sepia(1.0)", "sepia(1)"); // Float value converts to integer
+assert_valid_value("webkitFilter", "sepia(0)"); // Zero value
+assert_valid_value("webkitFilter", "sepia()"); // No arguments
+assert_valid_value("webkitFilter", "sepia(0.5) sepia(0.25)"); // Multiple values
+
+assert_valid_value("webkitFilter", "saturate(1)"); // Integer value
+assert_valid_value("webkitFilter", "saturate(50%)"); // Percentage value
+assert_valid_value("webkitFilter", "saturate(250%)"); // Percentage value > 1
+assert_valid_value("webkitFilter", "saturate(1.0)", "saturate(1)"); // Float value converts to integer
+assert_valid_value("webkitFilter", "saturate(5.5)"); // Input value > 1
+assert_valid_value("webkitFilter", "saturate(0)"); // Zero value
+assert_valid_value("webkitFilter", "saturate()"); // No arguments
+assert_valid_value("webkitFilter", "saturate(0.5) saturate(0.25)"); // Multiple values
+
+assert_valid_value("webkitFilter", "hue-rotate(10deg)"); // Degrees value as integer
+assert_valid_value("webkitFilter", "hue-rotate(10.0deg)", "hue-rotate(10deg)"); // Degrees float value converts to integer
+assert_valid_value("webkitFilter", "hue-rotate(10rad)"); // Radians value
+assert_valid_value("webkitFilter", "hue-rotate(10grad)"); // Gradians value
+assert_valid_value("webkitFilter", "hue-rotate(0.5turn)"); // Turns value
+assert_valid_value("webkitFilter", "hue-rotate(0)", "hue-rotate(0deg)"); // Zero value
+assert_valid_value("webkitFilter", "hue-rotate()"); // No arguments
+
+assert_valid_value("webkitFilter", "invert(1)") // Integer value
+assert_valid_value("webkitFilter", "invert(50%)"); // Percentage value
+assert_valid_value("webkitFilter", "invert(1.0)", "invert(1)"); // Float value converts to integer
+assert_valid_value("webkitFilter", "invert(0)"); // Zero value
+assert_valid_value("webkitFilter", "invert()"); // No arguments
+assert_valid_value("webkitFilter", "invert(0.5) invert(0.25)"); // Multiple values
+
+assert_valid_value("webkitFilter", "opacity(1)"); // Integer value
+assert_valid_value("webkitFilter", "opacity(50%)"); // Percentage value
+assert_valid_value("webkitFilter", "opacity(1.0)", "opacity(1)"); // Float value converts to integer
+assert_valid_value("webkitFilter", "opacity(0)"); // Zero value
+assert_valid_value("webkitFilter", "opacity()"); // No arguments
+assert_valid_value("webkitFilter", "opacity(0.5) opacity(0.25)"); // Multiple values
+
+assert_valid_value("webkitFilter", "brightness(1)"); // Integer value
+assert_valid_value("webkitFilter", "brightness(50%)"); // Percentage value
+assert_valid_value("webkitFilter", "brightness(1.0)", "brightness(1)"); // Float value converts to integer
+assert_valid_value("webkitFilter", "brightness(0)"); // Zero value
+assert_valid_value("webkitFilter", "brightness()"); // No arguments
+assert_valid_value("webkitFilter", "brightness(0.5) brightness(0.25)"); // Multiple values
+assert_valid_value("webkitFilter", "brightness(-1.1)"); // Parameter less than -100%
+assert_valid_value("webkitFilter", "brightness(101%)"); // Parameter more than 100%
+
+assert_valid_value("webkitFilter", "contrast(1)"); // Integer value
+assert_valid_value("webkitFilter", "contrast(50%)"); // Percentage value
+assert_valid_value("webkitFilter", "contrast(250%)"); // Percentage value > 1
+assert_valid_value("webkitFilter", "contrast(1.0)", "contrast(1)"); // Float value converts to integer
+assert_valid_value("webkitFilter", "contrast(0)"); // Zero value
+assert_valid_value("webkitFilter", "contrast()"); // No arguments
+assert_valid_value("webkitFilter", "contrast(2)"); // Value greater than one
+assert_valid_value("webkitFilter", "contrast(0.5) contrast(0.25)"); // Multiple values
+
+assert_valid_value("webkitFilter", "blur(0)", "blur(0px)"); // One zero to px
+assert_valid_value("webkitFilter", "blur(10px)"); // One length
+assert_valid_value("webkitFilter", "blur()"); // No arguments
+
+assert_valid_value("webkitFilter", "drop-shadow(red 1px 2px 3px)"); // Color then three values
+assert_valid_value("webkitFilter", "drop-shadow(1px 2px 3px red)", "drop-shadow(red 1px 2px 3px)"); // Three values then color
+assert_valid_value("webkitFilter", "drop-shadow(#abc 0 0 0)", "drop-shadow(rgb(170, 187, 204) 0px 0px 0px)"); // Color then three values with zero length
+assert_valid_value("webkitFilter", "drop-shadow(0 0 0)", "drop-shadow(0px 0px 0px)"); // Three values with zero length
+assert_valid_value("webkitFilter", "drop-shadow(1px 2px)"); // Two values no color
+
+// Combinations
+assert_valid_value("webkitFilter", "sepia(0.5) grayscale(0.25)");
+assert_valid_value("webkitFilter", "saturate(0.5) grayscale(0.25)");
+assert_valid_value("webkitFilter", "hue-rotate(10deg) grayscale(0.25)");
+assert_valid_value("webkitFilter", "invert(0.5) grayscale(0.25)");
+assert_valid_value("webkitFilter", "opacity(0.5) grayscale(0.25)");
+assert_valid_value("webkitFilter", "brightness(0.5) grayscale(0.25)");
+assert_valid_value("webkitFilter", "grayscale(0.25) brightness(0.5)");
+assert_valid_value("webkitFilter", "contrast(0.5) grayscale(0.25)");
+assert_valid_value("webkitFilter", "grayscale(0.25) contrast(0.5)");
+assert_valid_value("webkitFilter",
+ "grayscale(0.5) sepia(0.25) saturate(0.75) hue-rotate(35deg) invert(0.2) opacity(0.9) blur(5px) drop-shadow(green 1px 2px 3px)");
+</script>

Powered by Google App Engine
This is Rietveld 408576698