Chromium Code Reviews| 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..8ac61d2a2b5b9dcb599e417fc440c9ee506a6833 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,10 +108,34 @@ test(() => { |
| }, "DOMMatrixReadOnly toJSON() - 3D matrix"); |
| test(() => { |
| - assert_throws(new TypeError(), () => { new DOMMatrixReadOnly(1, 2, 3, 4, 5, 6); }, |
| - "DOMMatrixReadOnly constructor only accepts 1 argument"); |
| - assert_throws(new TypeError(), () => { new DOMMatrixReadOnly("myString"); }, |
| - "DOMMatrixReadOnly constructor only accepts 1 number sequence"); |
| + assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly(1, 2, 3, 4, 5, 6); }, |
| + "DOMMatrixReadOnly(transformList) can't parse unknown keyword - DOMMatrixReadOnly(1, 2, 3, 4, 5, 6) is same with DOMMatrixReadOnly('1')"); |
| + assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("myString"); }, |
| + "DOMMatrixReadOnly(transformList) can't parse unknown keyword."); |
| + assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("initial");}, |
| + "CSS-wide keywords are disallowed."); |
| + assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("notExistFunction()"); }, |
| + "can't parse not exist function."); |
| + assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateY(50%)"); }, |
| + "Must have an absolute unit."); |
|
dominicc (has gone to gerrit)
2016/12/06 08:44:24
Let's make these descriptive about what's being te
Hwanseung Lee
2016/12/07 13:56:59
i checked test harness errors message. your though
|
| + assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateX(1.2em)"); }, |
| + "Must have an absolute unit."); |
| + assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateX(10ex)"); }, |
| + "Must have an absolute unit."); |
| + assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateX(10ch)"); }, |
| + "Must have an absolute unit."); |
| + assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateX(10rem)"); }, |
| + "Must have an absolute unit."); |
| + assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateX(10vw)"); }, |
| + "Must have an absolute unit."); |
| + assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateX(10vh)"); }, |
| + "Must have an absolute unit."); |
| + assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateX(10vmin)"); }, |
| + "Must have an absolute unit."); |
| + assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateX(10vmax)"); }, |
| + "Must have an absolute unit."); |
| + assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateX(calc(10px + 1em))"); }, |
| + "Must have an absolute unit."); |
| assert_throws(new TypeError(), () => { new DOMMatrixReadOnly([1, 2, 3]); }, |
| "DOMMatrixReadOnly constructor only accepts 1 number sequence with 6 or 16 elements."); |
| }, "DOMMatrixReadOnly constructor - invalid arguments"); |