Index: third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix.html |
diff --git a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix.html b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix.html |
index 3d230cbcce9281e274f8fd4b33b7f384477ccef9..c5f5672829f49b9455ff2ea5df138f5f6d180b41 100644 |
--- a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix.html |
+++ b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix.html |
@@ -161,6 +161,42 @@ test(() => { |
}, "DOMMatrix.fromMatrix(): NaN test"); |
test(() => { |
+ var identity_matrix = DOMMatrix.fromMatrix(); |
+ assert_true(identity_matrix.is2D); |
+ assert_object_equals(identity_matrix.toJSON(), |
+ { a : 1, b : 0, c : 0, d : 1, e : 0, f : 0, |
+ is2D : true, isIdentity : true, |
+ m11 : 1, m12 : 0, m13 : 0, m14 : 0, |
+ m21 : 0, m22 : 1, m23 : 0, m24 : 0, |
+ m31 : 0, m32 : 0, m33 : 1, m34 : 0, |
+ m41 : 0, m42 : 0, m43 : 0, m44 : 1}); |
+}, "DOMMatrix toJSON() - identity matrix"); |
+ |
+test(() => { |
+ var matrix2d = new DOMMatrix([1, 2, 3, 3.1, 2, 1]); |
+ assert_true(matrix2d.is2D); |
+ assert_object_equals(matrix2d.toJSON(), |
+ { a : 1, b : 2, c : 3, d : 3.1, e : 2, f : 1, |
+ is2D : true, isIdentity : false, |
+ m11 : 1, m12 : 2, m13 : 0, m14 : 0, |
+ m21 : 3, m22 : 3.1, m23 : 0, m24 : 0, |
+ m31 : 0, m32 : 0, m33 : 1, m34 : 0, |
+ m41 : 2, m42 : 1, m43 : 0, m44 : 1}); |
+}, "DOMMatrix toJSON() - 2D matrix"); |
+ |
+test(() => { |
+ var matrix3d = new DOMMatrix([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12, 13, 14, 15, 16.6]); |
+ assert_false(matrix3d.is2D); |
+ assert_object_equals(matrix3d.toJSON(), |
+ { a : 1, b : 2, c : 5, d : 6, e : 13, f : 14, |
+ is2D : false, isIdentity : false, |
+ m11 : 1, m12 : 2, m13 : 3, m14 : 4, |
+ m21 : 5, m22 : 6, m23 : 7, m24 : 8, |
+ m31 : 9, m32 : 10.1, m33 : 11, m34 : 12, |
+ m41 : 13, m42 : 14, m43 : 15, m44 : 16.6}); |
+}, "DOMMatrix toJSON() - 3D matrix"); |
+ |
+test(() => { |
assert_throws(new TypeError(), () => { |
var matrix = DOMMatrix.fromMatrix({a: 1, b: 2, m33: 3, m44: 4, is2D: true}); |
}, "The 'is2D' property is set to true but the input matrix is 3d matrix."); |