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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-readonly.html

Issue 2516973002: [GeometryInferface] add Constructor(DOMString transformList). (Closed)
Patch Set: [GeometryInferface] add Constructor(DOMString transformList). Created 4 years, 1 month 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: third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-readonly.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-readonly.html b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-readonly.html
index 49f861b47afe345396103c7c160ee9bb66abb561..753dc043bc2290454d504b8682c9a8a7e80dc786 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-readonly.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-readonly.html
@@ -46,6 +46,20 @@ test(() => {
}, "DOMMatrixReadOnly fromFloat64Array - 3D matrix");
test(() => {
+ var matrix = new DOMMatrixReadOnly("");
+ assert_identity_2d_matrix(matrix);
+}, "DOMMatrixReadOnly(transformList) - emptyString");
+
+test(() => {
+ var matrix = new DOMMatrixReadOnly("matrix(1.0, 2.0, 3.0, 4.0, 5.0, 6.0) translate(44px, 55px) skewX(30deg)");
+ var expectedMatrix = new DOMMatrixReadOnly();
+ expectedMatrix = expectedMatrix.multiply(new DOMMatrixReadOnly([1.0, 2.0, 3.0, 4.0, 5.0, 6.0]))
+ expectedMatrix = expectedMatrix.translate(44, 55)
+ expectedMatrix = expectedMatrix.skewX(30);
+ assert_matrix_almost_equals(matrix, expectedMatrix);
+}, "DOMMatrixReadOnly(transformList) - transformList");
+
+test(() => {
var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]);
assert_true(matrix2d.is2D);
assert_equals(matrix2d.toString(), "matrix(1, 2, 3, 3.1, 2, 1)");
@@ -94,9 +108,9 @@ test(() => {
}, "DOMMatrixReadOnly toJSON() - 3D matrix");
test(() => {
- assert_throws(new TypeError(), () => { new DOMMatrixReadOnly(1, 2, 3, 4, 5, 6); },
+ assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly(1, 2, 3, 4, 5, 6); },
"DOMMatrixReadOnly constructor only accepts 1 argument");
- assert_throws(new TypeError(), () => { new DOMMatrixReadOnly("myString"); },
+ assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("myString"); },
"DOMMatrixReadOnly constructor only accepts 1 number sequence");
assert_throws(new TypeError(), () => { new DOMMatrixReadOnly([1, 2, 3]); },
"DOMMatrixReadOnly constructor only accepts 1 number sequence with 6 or 16 elements.");

Powered by Google App Engine
This is Rietveld 408576698