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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/resources/geometry-interfaces-test-helpers.js

Issue 2370623003: [GeometryInterface] Clean-up layout tests for geometry interfaces. (Closed)
Patch Set: clean up. Created 4 years, 3 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-translate.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/dom/resources/geometry-interfaces-test-helpers.js
diff --git a/third_party/WebKit/LayoutTests/fast/dom/resources/geometry-interfaces-test-helpers.js b/third_party/WebKit/LayoutTests/fast/dom/resources/geometry-interfaces-test-helpers.js
index afb040eaa861c5fde7f7537a188fbbc5788f98e2..2415c009bf67a997b04f622d77edbc776c84f09f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/resources/geometry-interfaces-test-helpers.js
+++ b/third_party/WebKit/LayoutTests/fast/dom/resources/geometry-interfaces-test-helpers.js
@@ -59,29 +59,42 @@ function assert_3d_matrix_equals(actual, expected, description){
}
}
+function assert_equals_do_not_care_native_zero(actual, expected, description) {
+
+ if (actual === -0) {
+ actual = 0;
+ }
+
+ if (expected === -0) {
+ expected = 0;
+ }
+
+ assert_equals(actual, expected, description);
+}
+
function assert_matrix_equals(actual, expected, description) {
zino 2016/09/27 16:31:18 Do we still need description?
- assert_equals(actual.isIdentity, expected.isIdentity, description);
- assert_equals(actual.is2D, expected.is2D, description);
- assert_equals(actual.m11, expected.m11, description);
- assert_equals(actual.m12, expected.m12, description);
- assert_equals(actual.m13, expected.m13, description);
- assert_equals(actual.m14, expected.m14, description);
- assert_equals(actual.m21, expected.m21, description);
- assert_equals(actual.m22, expected.m22, description);
- assert_equals(actual.m23, expected.m23, description);
- assert_equals(actual.m24, expected.m24, description);
- assert_equals(actual.m31, expected.m31, description);
- assert_equals(actual.m32, expected.m32, description);
- assert_equals(actual.m33, expected.m33, description);
- assert_equals(actual.m34, expected.m34, description);
- assert_equals(actual.m41, expected.m41, description);
- assert_equals(actual.m42, expected.m42, description);
- assert_equals(actual.m43, expected.m43, description);
- assert_equals(actual.m44, expected.m44, description);
- assert_equals(actual.m11, actual.a, description);
- assert_equals(actual.m12, actual.b, description);
- assert_equals(actual.m21, actual.c, description);
- assert_equals(actual.m22, actual.d, description);
- assert_equals(actual.m41, actual.e, description);
- assert_equals(actual.m42, actual.f, description);
+ assert_equals(actual.isIdentity, expected.isIdentity, "isIdentity");
+ assert_equals(actual.is2D, expected.is2D, "is2d");
+ assert_equals_do_not_care_native_zero(actual.m11, expected.m11, "m11");
+ assert_equals_do_not_care_native_zero(actual.m12, expected.m12, "m12");
+ assert_equals_do_not_care_native_zero(actual.m13, expected.m13, "m13");
+ assert_equals_do_not_care_native_zero(actual.m14, expected.m14, "m14");
+ assert_equals_do_not_care_native_zero(actual.m21, expected.m21, "m21");
+ assert_equals_do_not_care_native_zero(actual.m22, expected.m22, "m22");
+ assert_equals_do_not_care_native_zero(actual.m23, expected.m23, "m23");
+ assert_equals_do_not_care_native_zero(actual.m24, expected.m24, "m24");
+ assert_equals_do_not_care_native_zero(actual.m31, expected.m31, "m31");
+ assert_equals_do_not_care_native_zero(actual.m32, expected.m32, "m32");
+ assert_equals_do_not_care_native_zero(actual.m33, expected.m33, "m33");
+ assert_equals_do_not_care_native_zero(actual.m34, expected.m34, "m34");
+ assert_equals_do_not_care_native_zero(actual.m41, expected.m41, "m41");
+ assert_equals_do_not_care_native_zero(actual.m42, expected.m42, "m42");
+ assert_equals_do_not_care_native_zero(actual.m43, expected.m43, "m43");
+ assert_equals_do_not_care_native_zero(actual.m44, expected.m44, "m44");
+ assert_equals(actual.m11, actual.a, "a");
+ assert_equals(actual.m12, actual.b, "b");
+ assert_equals(actual.m21, actual.c, "c");
+ assert_equals(actual.m22, actual.d, "d");
+ assert_equals(actual.m41, actual.e, "e");
+ assert_equals(actual.m42, actual.f, "f");
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-translate.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698