Commit d3d4d93c authored by atotic's avatar atotic Committed by Commit bot

Fix obviously broken SVG parsing test

While running LayoutTests, this test timed out. I was curious, looked into it, and realized that the test was completely broken:

1) there was an extra argument getting passed to testType() resulting in assert function being garbage. This caused 1000s of failures which caused test to run slowly.

2) Some other arguments being passed in were also wrong.

My fix is not perfect, but it results in a saner outcome: it runs in fraction of a second, and triggers fewer failures.

Running LayoutTests on my local machine was impossible, so I have not generated new test expectations.

BUG=697646

Review-Url: https://codereview.chromium.org/2721243004
Cr-Commit-Position: refs/heads/master@{#456127}
parent ea1c1679
<!doctype html> <!doctype html>
<title>Whitespace in attribute values tests</title> <title>Whitespace in attribute values tests</title>
<script src=../../resources/testharness.js></script> <script src=../../resources/testharness.js></script>
<script src=../../resources/testharnessreport.js></script> <script src=../../resources/testharnessreport.js></script>
...@@ -18,7 +18,7 @@ var svg = document.querySelector("svg"); ...@@ -18,7 +18,7 @@ var svg = document.querySelector("svg");
// test length values // test length values
var EPSILON = Math.pow(2, -24); // float epsilon var EPSILON = Math.pow(2, -24); // float epsilon
var whitespace = [ "", " ", " ", "\r\n\t ", "\f" ]; var whitespace = [ "", " ", " " ];
var garbage = [ "a", "e", "foo", ")90" ]; var garbage = [ "a", "e", "foo", ")90" ];
var validunits = [ "", "em", "ex", "px", "in", "cm", "mm", "pt", "pc", "%" ]; var validunits = [ "", "em", "ex", "px", "in", "cm", "mm", "pt", "pc", "%" ];
...@@ -28,8 +28,7 @@ testType("<integer>", ...@@ -28,8 +28,7 @@ testType("<integer>",
0, // expected default value (FIXME: should be 1) 0, // expected default value (FIXME: should be 1)
whitespace, whitespace,
[ "-47", "0", "+32", "1241245" ], [ "-47", "0", "+32", "1241245" ],
[ Number.NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, "fnord", "E", "e", "e+", "E-", "-", "+", "-.", ".-", ".", "+.", ".E0", "e1", "+17E-1", "17e+2", "0.35", "1e-10", ".1" ], validunits,
[""], // valid units
garbage, garbage,
function(elm, value) { assert_equals(elm.numOctaves.baseVal, parseInt(value)); }, function(elm, value) { assert_equals(elm.numOctaves.baseVal, parseInt(value)); },
function(elm, expected) { assert_equals(elm.numOctaves.baseVal, expected); } ); function(elm, expected) { assert_equals(elm.numOctaves.baseVal, expected); } );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment