OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
4 <script src="../../../http/tests/inspector/elements-test.js"></script> | 4 <script src="../../../http/tests/inspector/elements-test.js"></script> |
5 <script type="text/javascript"> | 5 <script type="text/javascript"> |
6 | 6 |
7 var test = function() | 7 var test = function() |
8 { | 8 { |
9 function setColor(inputColor, format) | 9 function setColor(inputColor, format) |
10 { | 10 { |
(...skipping 23 matching lines...) Expand all Loading... |
34 InspectorTest.addResult(spectrum._colorFormat); | 34 InspectorTest.addResult(spectrum._colorFormat); |
35 spectrum._formatViewSwitch(); | 35 spectrum._formatViewSwitch(); |
36 InspectorTest.addResult(spectrum._colorFormat); | 36 InspectorTest.addResult(spectrum._colorFormat); |
37 } | 37 } |
38 | 38 |
39 var spectrum = new WebInspector.Spectrum(); | 39 var spectrum = new WebInspector.Spectrum(); |
40 var cf = WebInspector.Color.Format; | 40 var cf = WebInspector.Color.Format; |
41 var inputColors = [ | 41 var inputColors = [ |
42 { string: "red", format: cf.Nickname }, | 42 { string: "red", format: cf.Nickname }, |
43 { string: "#ABC", format: cf.ShortHEX }, | 43 { string: "#ABC", format: cf.ShortHEX }, |
| 44 { string: "#1234", format: cf.ShortHEXA }, |
44 { string: "#ABCDEF", format: cf.HEX }, | 45 { string: "#ABCDEF", format: cf.HEX }, |
| 46 { string: "#ABCDEFAA", format: cf.HEXA }, |
45 { string: "rgb(1, 2, 3)", format: cf.RGB }, | 47 { string: "rgb(1, 2, 3)", format: cf.RGB }, |
46 { string: "rgba(1, 2, 3, 0.2)", format: cf.RGB }, | 48 { string: "rgba(1, 2, 3, 0.2)", format: cf.RGB }, |
47 { string: "hsl(1, 100%, 50%)", format: cf.HSL }, | 49 { string: "hsl(1, 100%, 50%)", format: cf.HSL }, |
48 { string: "hsla(1, 100%, 50%, 0.2)", format: cf.HSLA }]; | 50 { string: "hsla(1, 100%, 50%, 0.2)", format: cf.HSLA }]; |
49 | 51 |
50 InspectorTest.addResult("--- Testing colorString()"); | 52 InspectorTest.addResult("--- Testing colorString()"); |
51 for (var color of inputColors) | 53 for (var color of inputColors) |
52 checkColorString(color.string, color.format); | 54 checkColorString(color.string, color.format); |
53 | 55 |
54 InspectorTest.addResult("--- Testing alpha changes"); | 56 InspectorTest.addResult("--- Testing alpha changes"); |
55 for (var color of inputColors) | 57 for (var color of inputColors) |
56 checkAlphaChange(color.string, color.format); | 58 checkAlphaChange(color.string, color.format); |
57 | 59 |
58 InspectorTest.addResult("--- Testing _formatViewSwitch()"); | 60 InspectorTest.addResult("--- Testing _formatViewSwitch()"); |
59 for (var color of inputColors) | 61 for (var color of inputColors) |
60 checkNextFormat(color.string, color.format); | 62 checkNextFormat(color.string, color.format); |
61 | 63 |
62 InspectorTest.completeTest(); | 64 InspectorTest.completeTest(); |
63 } | 65 } |
64 | 66 |
65 </script> | 67 </script> |
66 </head> | 68 </head> |
67 <body onload="runTest()"> | 69 <body onload="runTest()"> |
68 <p>Tests WebInspector.Spectrum</p> | 70 <p>Tests WebInspector.Spectrum</p> |
69 </body> | 71 </body> |
70 </html> | 72 </html> |
OLD | NEW |