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 | 4 |
5 <script> | 5 <script> |
6 var testParams = [ | 6 var testParams = [ |
7 { | 7 { |
8 input: new CSSMatrixComponent(new DOMMatrixReadOnly([0, 0, 0, 0, 0, 0])), | 8 input: new CSSMatrixComponent(new DOMMatrixReadOnly([0, 0, 0, 0, 0, 0])), |
9 a: 0, b: 0, c: 0, d: 0, e: 0, f: 0, | 9 a: 0, b: 0, c: 0, d: 0, e: 0, f: 0, |
10 is2D: true, | 10 is2D: true, |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 } | 103 } |
104 | 104 |
105 test(() => { | 105 test(() => { |
106 assert_throws(new TypeError(), () => { new CSSMatrixComponent(); }); | 106 assert_throws(new TypeError(), () => { new CSSMatrixComponent(); }); |
107 assert_throws(new TypeError(), () => { new CSSMatrixComponent(0); }); | 107 assert_throws(new TypeError(), () => { new CSSMatrixComponent(0); }); |
108 assert_throws(new TypeError(), () => { new CSSMatrixComponent("string") }); | 108 assert_throws(new TypeError(), () => { new CSSMatrixComponent("string") }); |
109 assert_throws(new TypeError(), () => { new CSSMatrixComponent(null); }); | 109 assert_throws(new TypeError(), () => { new CSSMatrixComponent(null); }); |
110 assert_throws(new TypeError(), () => { new CSSMatrixComponent(undefined); }); | 110 assert_throws(new TypeError(), () => { new CSSMatrixComponent(undefined); }); |
111 }, "invalid number of arguments to the constructor throws"); | 111 }, "invalid number of arguments to the constructor throws"); |
112 | 112 |
113 for (let params of testParams) { | |
114 test(() => { | |
115 var attributeValues = attributeValues2D.concat(attributeValues3D); | |
116 var inputAsMatrix = params.input.asMatrix(); | |
117 for (var j = 0; j < attributeValues.length; ++j) { | |
118 var attribute = attributeValues[j]; | |
119 assert_equals(inputAsMatrix[attribute], params.input[attribute]); | |
120 } | |
121 assert_equals(inputAsMatrix.is2D(), params.input.is2D()); | |
122 assert_equals(inputAsMatrix.toString(), params.input.toString()); | |
123 }, "asMatrix has all the same properties as the original " + | |
124 "CSSMatrixComponent for " + params.cssText); | |
125 } | |
126 | |
127 </script> | 113 </script> |
OLD | NEW |