Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <script src="../../resources/testharness.js"></script> | 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> | 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script src="./resources/geometry-interfaces-test-helpers.js"></script> | 4 <script src="./resources/geometry-interfaces-test-helpers.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 var matrix2d = [5, 4, 11, 34, 55, 11]; | 7 var matrix2d = [5, 4, 11, 34, 55, 11]; |
| 8 var matrix3d = [5, 11, 55, 77, 44, 33, 55, 75, 88, 99, 12, 43, 65, 36, 85, 25]; | 8 var matrix3d = [5, 11, 55, 77, 44, 33, 55, 75, 88, 99, 12, 43, 65, 36, 85, 25]; |
| 9 | 9 |
| 10 test(() => { | 10 test(() => { |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 208 assert_true(actualMatrix1.is2D); | 208 assert_true(actualMatrix1.is2D); |
| 209 actualMatrix2.setMatrixValue("matrix(1.0, 2.0, 3.0, 4.0, 5.0, 6.0) translate(4 4px, 55px) skewX(30deg)"); | 209 actualMatrix2.setMatrixValue("matrix(1.0, 2.0, 3.0, 4.0, 5.0, 6.0) translate(4 4px, 55px) skewX(30deg)"); |
| 210 assert_true(actualMatrix2.is2D); | 210 assert_true(actualMatrix2.is2D); |
| 211 expectedMatrix.multiplySelf(new DOMMatrix([1.0, 2.0, 3.0, 4.0, 5.0, 6.0])) | 211 expectedMatrix.multiplySelf(new DOMMatrix([1.0, 2.0, 3.0, 4.0, 5.0, 6.0])) |
| 212 expectedMatrix.translateSelf(44, 55) | 212 expectedMatrix.translateSelf(44, 55) |
| 213 expectedMatrix.skewXSelf(30); | 213 expectedMatrix.skewXSelf(30); |
| 214 assert_matrix_almost_equals(actualMatrix1, expectedMatrix); | 214 assert_matrix_almost_equals(actualMatrix1, expectedMatrix); |
| 215 assert_matrix_almost_equals(actualMatrix2, expectedMatrix); | 215 assert_matrix_almost_equals(actualMatrix2, expectedMatrix); |
| 216 }, "DOMMatrix setMatrix(multiple value)"); | 216 }, "DOMMatrix setMatrix(multiple value)"); |
| 217 | 217 |
| 218 // TODO(hs1217.lee) : calc() function take only absolute unit. should be pass th is test. | 218 test(() => { |
| 219 // but calc() function is not supported not yet. | 219 var actualMatrix1 = new DOMMatrix(matrix2d); |
| 220 // refer to hasRelativeLengths() in TransformBuilder.cpp | 220 var actualMatrix2 = new DOMMatrix(matrix3d); |
| 221 // test(() => { | 221 var expectedMatrix = new DOMMatrix(); |
| 222 // var actualMatrix1 = new DOMMatrix(matrix2d); | 222 actualMatrix1.setMatrixValue("translateX(calc(10px + 1px))"); |
| 223 // var actualMatrix2 = new DOMMatrix(matrix3d); | 223 assert_true(actualMatrix1.is2D); |
| 224 // var expectedMatrix = new DOMMatrix(); | 224 actualMatrix2.setMatrixValue("translateX(calc(10px + 1px))"); |
| 225 // actualMatrix1.setMatrixValue("translateX(calc(10px + 1px))"); | 225 assert_true(actualMatrix2.is2D); |
| 226 // assert_true(actualMatrix1.is2D); | 226 expectedMatrix.translateSelf(11, 0) |
| 227 // actualMatrix2.setMatrixValue("translateX(calc(10px + 1px))"); | 227 assert_matrix_almost_equals(actualMatrix1, expectedMatrix); |
| 228 // assert_true(actualMatrix2.is2D); | 228 assert_matrix_almost_equals(actualMatrix2, expectedMatrix); |
| 229 // expectedMatrix.translateSelf(11, 0) | 229 }, "DOMMatrix setMatrix(multiple value)"); |
| 230 // assert_matrix_almost_equals(actualMatrix1, expectedMatrix); | |
| 231 // assert_matrix_almost_equals(actualMatrix2, expectedMatrix); | |
| 232 // }, "DOMMatrix setMatrix(multiple value)"); | |
|
alancutter (OOO until 2018)
2017/03/20 00:56:19
For future reference we should not check in commen
Hwanseung Lee
2017/03/20 14:10:06
actually, failing expectation was existed.
(https:
| |
| 233 | 230 |
| 234 test(() => { | 231 test(() => { |
| 235 | 232 |
| 236 var actualMatrix = new DOMMatrix([1, 2, 3, 4, 5, 6]); | 233 var actualMatrix = new DOMMatrix([1, 2, 3, 4, 5, 6]); |
| 237 var expectedMatrix = new DOMMatrix([1, 2, 3, 4, 5, 6]); | 234 var expectedMatrix = new DOMMatrix([1, 2, 3, 4, 5, 6]); |
| 238 | 235 |
| 239 assert_throws(new SyntaxError(), () => { | 236 assert_throws(new SyntaxError(), () => { |
| 240 actualMatrix.setMatrixValue("initial"); | 237 actualMatrix.setMatrixValue("initial"); |
| 241 }, "CSS-wide keywords are disallowed"); | 238 }, "CSS-wide keywords are disallowed"); |
| 242 | 239 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 284 actualMatrix.setMatrixValue("translateX(calc(10px + 1em))"); | 281 actualMatrix.setMatrixValue("translateX(calc(10px + 1em))"); |
| 285 }, "using relative units should throw a SyntaxError"); | 282 }, "using relative units should throw a SyntaxError"); |
| 286 | 283 |
| 287 //actualMatrix should be not changed. | 284 //actualMatrix should be not changed. |
| 288 assert_true(actualMatrix.is2D); | 285 assert_true(actualMatrix.is2D); |
| 289 assert_matrix_almost_equals(actualMatrix, expectedMatrix); | 286 assert_matrix_almost_equals(actualMatrix, expectedMatrix); |
| 290 | 287 |
| 291 }, "DOMMatrix.setMatrix(): Exception test"); | 288 }, "DOMMatrix.setMatrix(): Exception test"); |
| 292 | 289 |
| 293 </script> | 290 </script> |
| OLD | NEW |