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 f6d2d28c73b09e7a120532f91aa22fb62626f8ce..afb040eaa861c5fde7f7537a188fbbc5788f98e2 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 |
@@ -19,19 +19,44 @@ function assert_identity_3d_matrix(actual, description) { |
} |
function assert_2d_matrix_equals(actual, expected, description) { |
- var full_expected = { |
- m11: expected.m11, m12: expected.m12, m13: 0, m14: 0, |
- m21: expected.m21, m22: expected.m22, m23: 0, m24: 0, |
- m31: 0, m32: 0, m33: 1, m34: 0, |
- m41: expected.m41, m42: expected.m42, m43: 0, m44: 1, |
- is2D: true, isIdentity: expected.isIdentity |
- }; |
- assert_matrix_equals(actual, full_expected, description); |
+ if (Array.isArray(expected)) { |
+ assert_equals(6, expected.length); |
+ var full_expected = { |
+ m11: expected[0], m12: expected[1], m13: 0, m14: 0, |
+ m21: expected[2], m22: expected[3], m23: 0, m24: 0, |
+ m31: 0, m32: 0, m33: 1, m34: 0, |
+ m41: expected[4], m42: expected[5], m43: 0, m44: 1, |
+ is2D: true, isIdentity: false |
+ }; |
+ assert_matrix_equals(actual, full_expected, description); |
+ } else { |
+ var full_expected = { |
+ m11: expected.m11, m12: expected.m12, m13: 0, m14: 0, |
+ m21: expected.m21, m22: expected.m22, m23: 0, m24: 0, |
+ m31: 0, m32: 0, m33: 1, m34: 0, |
+ m41: expected.m41, m42: expected.m42, m43: 0, m44: 1, |
+ is2D: true, isIdentity: false |
+ }; |
+ assert_matrix_equals(actual, full_expected, description); |
+ } |
} |
function assert_3d_matrix_equals(actual, expected, description){ |
- expected['is2D'] = false; |
- assert_matrix_equals(actual, expected, description); |
+ if (Array.isArray(expected)) { |
+ assert_equals(16, expected.length); |
+ var full_expected = { |
+ m11: expected[0], m12: expected[1], m13: expected[2], m14: expected[3], |
+ m21: expected[4], m22: expected[5], m23: expected[6], m24: expected[7], |
+ m31: expected[8], m32: expected[9], m33: expected[10], m34: expected[11], |
+ m41: expected[12], m42: expected[13], m43: expected[14], m44: expected[15], |
+ is2D: false, isIdentity: false |
+ }; |
+ assert_matrix_equals(actual, full_expected, description); |
+ } else { |
+ expected['is2D'] = false; |
+ expected['isIdentity'] = false; |
+ assert_matrix_equals(actual, expected, description); |
+ } |
} |
function assert_matrix_equals(actual, expected, description) { |