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

Unified Diff: third_party/WebKit/LayoutTests/svg/parser/whitespace-angle-invalid.html

Issue 2454413002: Break svg/parser/whitespace tests apart some more. (Closed)
Patch Set: Created 4 years, 2 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/svg/parser/whitespace-angle-invalid.html
diff --git a/third_party/WebKit/LayoutTests/svg/parser/whitespace-angle-invalid.html b/third_party/WebKit/LayoutTests/svg/parser/whitespace-angle-invalid.html
new file mode 100644
index 0000000000000000000000000000000000000000..e8fe662a79367d706a1366d55db6e2bb0b32a230
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/parser/whitespace-angle-invalid.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<title>Whitespace in <angle> attribute values</title>
+<script src=../../resources/testharness.js></script>
+<script src=../../resources/testharnessreport.js></script>
+<script src=resources/whitespace-helper.js></script>
+<svg id="testcontainer">
+ <defs>
+ <marker/>
+ </defs>
+</svg>
+<div id=log></div>
+<script>
+
+// test length values
+var EPSILON = Math.pow(2, -24); // float epsilon
+var whitespace = [ "", " ", " ", "\r\n\t ", "\f" ];
+
+testInvalidType("<angle>",
+ document.querySelector("marker"),
+ "orient",
+ 0, // expected default value
+ whitespace,
+ [ Number.NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, "fnord", "E", "e", "e+", "E-", "-", "+", "-.", ".-", ".", "+.", ".E0", "e1" ], // invalid
+ [ "", "deg", "rad", "grad" ], // valid units
+ function(elm, value) { assert_approx_equals(elm.orientAngle.baseVal.valueInSpecifiedUnits, parseFloat(value), EPSILON); },
+ function(elm, expected) { assert_approx_equals(elm.orientAngle.baseVal.value, expected, EPSILON); } );
+
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698