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 test(() => { | 7 test(() => { |
8 var matrix = new DOMMatrixReadOnly(); | 8 var matrix = new DOMMatrixReadOnly(); |
9 assert_identity_2d_matrix(matrix); | 9 assert_identity_2d_matrix(matrix); |
10 }, "DOMMatrixReadOnly constructor"); | 10 }, "DOMMatrixReadOnly constructor"); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new
Float32Array([1])); }, | 170 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new
Float32Array([1])); }, |
171 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
"); | 171 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
"); |
172 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new
Float64Array([1])); }, | 172 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new
Float64Array([1])); }, |
173 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
"); | 173 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
"); |
174 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new
Float32Array(65536)); }, | 174 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new
Float32Array(65536)); }, |
175 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
"); | 175 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
"); |
176 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new
Float64Array(65536)); }, | 176 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new
Float64Array(65536)); }, |
177 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
"); | 177 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
"); |
178 }, "DOMMatrixReadOnly fromFloat*Array - invalid array size"); | 178 }, "DOMMatrixReadOnly fromFloat*Array - invalid array size"); |
179 | 179 |
180 if (window.SharedArrayBuffer) { | |
181 test(() => { | |
182 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(ne
w Float32Array(new SharedArrayBuffer(24))); }, | |
183 ""); | |
184 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(ne
w Float64Array(new SharedArrayBuffer(32))); }, | |
185 ""); | |
186 }, "DOMMatrixReadOnly fromFloat*Array - can't use SharedArrayBuffer view"); | |
187 } | |
188 | |
189 test(() => { | 180 test(() => { |
190 var matrix = DOMMatrixReadOnly.fromMatrix(); | 181 var matrix = DOMMatrixReadOnly.fromMatrix(); |
191 assert_identity_2d_matrix(matrix); | 182 assert_identity_2d_matrix(matrix); |
192 }, "DOMMatrixReadOnly.fromMatrix() with no parameter"); | 183 }, "DOMMatrixReadOnly.fromMatrix() with no parameter"); |
193 | 184 |
194 test(() => { | 185 test(() => { |
195 var matrix = DOMMatrixReadOnly.fromMatrix(null); | 186 var matrix = DOMMatrixReadOnly.fromMatrix(null); |
196 assert_identity_2d_matrix(matrix); | 187 assert_identity_2d_matrix(matrix); |
197 }, "DOMMatrixReadOnly.fromMatrix() with null"); | 188 }, "DOMMatrixReadOnly.fromMatrix() with null"); |
198 | 189 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 test(() => { | 226 test(() => { |
236 assert_throws(new TypeError(), () => { | 227 assert_throws(new TypeError(), () => { |
237 DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, m33: 3, m44: 4, is2D: true}); | 228 DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, m33: 3, m44: 4, is2D: true}); |
238 }, "The 'is2D' property is set to true but the input matrix is 3d matrix"); | 229 }, "The 'is2D' property is set to true but the input matrix is 3d matrix"); |
239 assert_throws(new TypeError(), () => { | 230 assert_throws(new TypeError(), () => { |
240 DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, m11: 3}); | 231 DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, m11: 3}); |
241 }, "The 'a' property should equal the 'm11' property"); | 232 }, "The 'a' property should equal the 'm11' property"); |
242 }, "DOMMatrixReadOnly.fromMatrix(): Exception test"); | 233 }, "DOMMatrixReadOnly.fromMatrix(): Exception test"); |
243 | 234 |
244 </script> | 235 </script> |
OLD | NEW |