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

Unified Diff: LayoutTests/resources/js-test.js

Issue 112003003: [SVG] SVGLength{,List} migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: revert aggressive svgAttributeChanged, add NeedsRebaseline Created 6 years, 11 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: LayoutTests/resources/js-test.js
diff --git a/LayoutTests/resources/js-test.js b/LayoutTests/resources/js-test.js
index 016c67f8ae3a08edfc76dfa59dd2afb4b86d87e9..c94f5740c3e55cc54818177f2f847cf71885b207 100644
--- a/LayoutTests/resources/js-test.js
+++ b/LayoutTests/resources/js-test.js
@@ -158,12 +158,20 @@ function isMinusZero(n)
return n === 0 && 1/n < 0;
}
+function isNewSVGTearOffType(v)
+{
+ return ['[object SVGLength]', '[object SVGLengthList]'].indexOf(""+v) != -1;
+}
+
function isResultCorrect(actual, expected)
{
if (expected === 0)
return actual === expected && (1/actual) === (1/expected);
if (actual === expected)
return true;
+ // http://crbug.com/308818 : The new implementation of SVGListProperties do not necessary return the same wrapper object, so === operator would not work. We compare for their string representation instead.
+ if (isNewSVGTearOffType(expected) && typeof(expected) == typeof(actual) && actual.valueAsString == expected.valueAsString)
+ return true;
if (typeof(expected) == "number" && isNaN(expected))
return typeof(actual) == "number" && isNaN(actual);
if (expected && (Object.prototype.toString.call(expected) == Object.prototype.toString.call([])))
@@ -173,6 +181,8 @@ function isResultCorrect(actual, expected)
function stringify(v)
{
+ if (isNewSVGTearOffType(v))
+ return v.valueAsString;
if (v === 0 && 1/v < 0)
return "-0";
else return "" + v;

Powered by Google App Engine
This is Rietveld 408576698