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 |
| 7 test(() => { |
| 8 var matrix = new DOMMatrixReadOnly(); |
| 9 assert_identity_2d_matrix(matrix); |
| 10 }, "DOMMatrixReadOnly constructor"); |
| 11 |
6 test(() => { | 12 test(() => { |
7 var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]); | 13 var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]); |
8 assert_2d_matrix_equals(matrix2d, [1, 2, 3, 3.1, 2, 1]); | 14 assert_2d_matrix_equals(matrix2d, [1, 2, 3, 3.1, 2, 1]); |
9 }, "DOMMatrixReadOnly constructor - 2D matrix"); | 15 }, "DOMMatrixReadOnly constructor - 2D matrix"); |
10 | 16 |
11 test(() => { | 17 test(() => { |
12 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12,
13, 14, 15, 16.6]); | 18 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12,
13, 14, 15, 16.6]); |
13 assert_3d_matrix_equals(matrix3d, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12, 13
, 14, 15, 16.6]); | 19 assert_3d_matrix_equals(matrix3d, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12, 13
, 14, 15, 16.6]); |
14 }, "DOMMatrixReadOnly constructor - 3D matrix"); | 20 }, "DOMMatrixReadOnly constructor - 3D matrix"); |
15 | 21 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 test(() => { | 188 test(() => { |
183 assert_throws(new TypeError(), () => { | 189 assert_throws(new TypeError(), () => { |
184 DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, m33: 3, m44: 4, is2D: true}); | 190 DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, m33: 3, m44: 4, is2D: true}); |
185 }, "The 'is2D' property is set to true but the input matrix is 3d matrix."); | 191 }, "The 'is2D' property is set to true but the input matrix is 3d matrix."); |
186 assert_throws(new TypeError(), () => { | 192 assert_throws(new TypeError(), () => { |
187 DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, m11: 3}); | 193 DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, m11: 3}); |
188 }, "The 'a' property should equal the 'm11' property."); | 194 }, "The 'a' property should equal the 'm11' property."); |
189 }, "DOMMatrixReadOnly.fromMatrix(): Exception test."); | 195 }, "DOMMatrixReadOnly.fromMatrix(): Exception test."); |
190 | 196 |
191 </script> | 197 </script> |
OLD | NEW |