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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/parser/whitespace-angle-1.html

Issue 2454413002: Break svg/parser/whitespace tests apart some more. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <title>Whitespace in <angle> attribute values</title> 2 <title>Whitespace in <angle> attribute values</title>
3 <script src=../../resources/testharness.js></script> 3 <script src=../../resources/testharness.js></script>
4 <script src=../../resources/testharnessreport.js></script> 4 <script src=../../resources/testharnessreport.js></script>
5 <script src=resources/whitespace-helper.js></script> 5 <script src=resources/whitespace-helper.js></script>
6 <svg id="testcontainer"> 6 <svg id="testcontainer">
7 <defs> 7 <defs>
8 <marker/> 8 <marker/>
9 </defs> 9 </defs>
10 </svg> 10 </svg>
11 <div id=log></div> 11 <div id=log></div>
12 <script> 12 <script>
13 var svg = document.querySelector("svg");
14 13
15 // test length values 14 // test length values
16 var EPSILON = Math.pow(2, -24); // float epsilon 15 var EPSILON = Math.pow(2, -24); // float epsilon
17 var whitespace = [ "", " ", " ", "\r\n\t ", "\f" ]; 16 var whitespace = [ "", " ", " ", "\r\n\t ", "\f" ];
18 var garbage = [ "a", "e", "foo", ")90" ]; 17 var garbage = [ "a", "e", "foo", ")90" ];
19 18
20 // Identical to whitespace-angle-2 apart from valid entries. Split to 19 // Identical to whitespace-angle-2 apart from valid entries. Split to
21 // reduce test timeouts on Linux Debug. 20 // reduce test timeouts on Linux Debug.
22 testType("<angle>", 21 testType("<angle>",
23 document.querySelector("marker"), 22 document.querySelector("marker"),
24 "orient", 23 "orient",
25 0, // expected default value 24 0, // expected default value
26 whitespace, 25 whitespace,
27 [ "-47", ".1", "0.35", "1e-10" ], // valid 26 [ "-47", ".1", "0.35", "1e-10" ], // valid
28 [ Number.NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINIT Y, "fnord", "E", "e", "e+", "E-", "-", "+", "-.", ".-", ".", "+.", ".E0", "e1" ] , // invalid
29 [ "", "deg", "rad", "grad" ], // valid units 27 [ "", "deg", "rad", "grad" ], // valid units
30 garbage, 28 garbage,
31 function(elm, value) { assert_approx_equals(elm.orientAngle.bas eVal.valueInSpecifiedUnits, parseFloat(value), EPSILON); }, 29 function(elm, value) { assert_approx_equals(elm.orientAngle.bas eVal.valueInSpecifiedUnits, parseFloat(value), EPSILON); },
32 function(elm, expected) { assert_approx_equals(elm.orientAngle. baseVal.value, expected, EPSILON); } ); 30 function(elm, expected) { assert_approx_equals(elm.orientAngle. baseVal.value, expected, EPSILON); } );
33 31
34
35 </script> 32 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698