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 test(() => { | 6 test(() => { |
7 var matrix = new DOMMatrix(); | 7 var matrix = new DOMMatrix(); |
8 assert_identity_2d_matrix(matrix); | 8 assert_identity_2d_matrix(matrix); |
9 }, "DOMMatrix() constructor"); | 9 }, "DOMMatrix() constructor"); |
10 | 10 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat32Array(new Float32A
rray([1])); }, | 113 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat32Array(new Float32A
rray([1])); }, |
114 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
"); | 114 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
"); |
115 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat64Array(new Float64A
rray([1])); }, | 115 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat64Array(new Float64A
rray([1])); }, |
116 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
"); | 116 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
"); |
117 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat32Array(new Float32A
rray(65536)); }, | 117 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat32Array(new Float32A
rray(65536)); }, |
118 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
"); | 118 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
"); |
119 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat64Array(new Float64A
rray(65536)); }, | 119 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat64Array(new Float64A
rray(65536)); }, |
120 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
"); | 120 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
"); |
121 }, "DOMMatrix fromFloat*Array - invalid array size"); | 121 }, "DOMMatrix fromFloat*Array - invalid array size"); |
122 | 122 |
| 123 if (window.internals && internals.runtimeFlags.sharedArrayBufferEnabled && windo
w.SharedArrayBuffer) { |
| 124 |
| 125 test(() => { |
| 126 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat32Array(new Float3
2Array(new SharedArrayBuffer(16))) }, |
| 127 "fromFloat32Array function should throw when passed a SharedArrayBuffer Fl
oat32Array"); |
| 128 }); |
| 129 |
| 130 test(() => { |
| 131 assert_throws(new TypeError(), () => { DOMMatrix.fromFloat64Array(new Float6
4Array(new SharedArrayBuffer(16))) }, |
| 132 "fromFloat64Array function should throw when passed a SharedArrayBuffer Fl
oat64Array"); |
| 133 }); |
| 134 } |
| 135 |
123 test(() => { | 136 test(() => { |
124 assert_identity_2d_matrix(DOMMatrix.fromMatrix()); | 137 assert_identity_2d_matrix(DOMMatrix.fromMatrix()); |
125 }, "DOMMatrix.fromMatrix() with no parameter"); | 138 }, "DOMMatrix.fromMatrix() with no parameter"); |
126 | 139 |
127 test(() => { | 140 test(() => { |
128 assert_identity_2d_matrix(DOMMatrix.fromMatrix(null)); | 141 assert_identity_2d_matrix(DOMMatrix.fromMatrix(null)); |
129 }, "DOMMatrix.fromMatrix() with null"); | 142 }, "DOMMatrix.fromMatrix() with null"); |
130 | 143 |
131 test(() => { | 144 test(() => { |
132 assert_identity_2d_matrix(DOMMatrix.fromMatrix(undefined)); | 145 assert_identity_2d_matrix(DOMMatrix.fromMatrix(undefined)); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 "using relative units should throw a SyntaxError"); | 242 "using relative units should throw a SyntaxError"); |
230 assert_throws(new TypeError(), () => { | 243 assert_throws(new TypeError(), () => { |
231 var matrix = DOMMatrix.fromMatrix({a: 1, b: 2, m33: 3, m44: 4, is2D: true}); | 244 var matrix = DOMMatrix.fromMatrix({a: 1, b: 2, m33: 3, m44: 4, is2D: true}); |
232 }, "The 'is2D' property is set to true but the input matrix is 3d matrix"); | 245 }, "The 'is2D' property is set to true but the input matrix is 3d matrix"); |
233 assert_throws(new TypeError(), () => { | 246 assert_throws(new TypeError(), () => { |
234 var matrix = DOMMatrix.fromMatrix({a: 1, b: 2, m11: 3}); | 247 var matrix = DOMMatrix.fromMatrix({a: 1, b: 2, m11: 3}); |
235 }, "The 'a' property should equal the 'm11' property"); | 248 }, "The 'a' property should equal the 'm11' property"); |
236 }, "DOMMatrix.fromMatrix(): Exception test"); | 249 }, "DOMMatrix.fromMatrix(): Exception test"); |
237 | 250 |
238 </script> | 251 </script> |
OLD | NEW |