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 values = [ | 6 var values = [ |
7 {input: new CSSMatrixComponent(new DOMMatrixReadOnly([0, 0, 0, 0, 0, 0])), | 7 {input: new CSSMatrixComponent(new DOMMatrixReadOnly([0, 0, 0, 0, 0, 0])), |
8 a: 0, b: 0, c: 0, d: 0, e: 0, f: 0, | 8 a: 0, b: 0, c: 0, d: 0, e: 0, f: 0, |
9 is2D: true, cssText: "matrix(0, 0, 0, 0, 0, 0)"}, | 9 is2D: true, cssText: "matrix(0, 0, 0, 0, 0, 0)"}, |
10 {input: new CSSMatrixComponent(new DOMMatrixReadOnly([2, 4, 6, 8, 10, 12])), | 10 {input: new CSSMatrixComponent(new DOMMatrixReadOnly([2, 4, 6, 8, 10, 12])), |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 }, "Test that the is2D values for CSSMatrixComponent are correct."); | 51 }, "Test that the is2D values for CSSMatrixComponent are correct."); |
52 | 52 |
53 test(function() { | 53 test(function() { |
54 for (var i = 0; i < values.length; ++i) { | 54 for (var i = 0; i < values.length; ++i) { |
55 assert_equals(values[i].input.toString(), values[i].cssText); | 55 assert_equals(values[i].input.toString(), values[i].cssText); |
56 } | 56 } |
57 }, "Test that the toString for CSSMatrixComponent is correct."); | 57 }, "Test that the toString for CSSMatrixComponent is correct."); |
58 | 58 |
59 test(function() { | 59 test(function() { |
60 assert_throws(null, function() { new CSSMatrixComponent() }); | 60 assert_throws(new TypeError(), function() { new CSSMatrixComponent() }); |
61 assert_throws(null, function() { new CSSMatrixComponent(0) }); | 61 assert_throws(new TypeError(), function() { new CSSMatrixComponent(0) }); |
62 assert_throws(null, function() { new CSSMatrixComponent("string") }); | 62 assert_throws(new TypeError(), function() { new CSSMatrixComponent("string") }
); |
63 assert_throws(null, function() { new CSSMatrixComponent(None) }); | 63 assert_throws(new TypeError(), function() { new CSSMatrixComponent(null) }); |
64 assert_throws(null, function() { new CSSMatrixComponent(undefined) }); | 64 assert_throws(new TypeError(), function() { new CSSMatrixComponent(undefined)
}); |
65 }, "Test that invalid number of arguments for CSSMatrixComponent throws an excep
tion."); | 65 }, "Test that invalid number of arguments for CSSMatrixComponent throws an excep
tion."); |
66 | 66 |
67 test(function() { | 67 test(function() { |
68 var attributeValues = attributeValues2D.concat(attributeValues3D); | 68 var attributeValues = attributeValues2D.concat(attributeValues3D); |
69 for (var i = 0; i < values.length; ++i) { | 69 for (var i = 0; i < values.length; ++i) { |
70 var inputAsMatrix = values[i].input.asMatrix(); | 70 var inputAsMatrix = values[i].input.asMatrix(); |
71 for (var j = 0; j < attributeValues.length; ++j) { | 71 for (var j = 0; j < attributeValues.length; ++j) { |
72 var attribute = attributeValues[j]; | 72 var attribute = attributeValues[j]; |
73 assert_equals(inputAsMatrix[attribute], values[i].input[attribute]); | 73 assert_equals(inputAsMatrix[attribute], values[i].input[attribute]); |
74 } | 74 } |
75 assert_equals(inputAsMatrix.is2D(), values[i].input.is2D()); | 75 assert_equals(inputAsMatrix.is2D(), values[i].input.is2D()); |
76 assert_equals(inputAsMatrix.toString(), values[i].input.toString()); | 76 assert_equals(inputAsMatrix.toString(), values[i].input.toString()); |
77 } | 77 } |
78 }, "Test that asMatrix has all the same properties as the original CSSMatrixComp
onent."); | 78 }, "Test that asMatrix has all the same properties as the original CSSMatrixComp
onent."); |
79 | 79 |
80 </script> | 80 </script> |
OLD | NEW |