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 }, | |
45 { string: "#ABCDEF", format: cf.HEX }, | 44 { string: "#ABCDEF", format: cf.HEX }, |
46 { string: "#ABCDEFAA", format: cf.HEXA }, | |
47 { string: "rgb(1, 2, 3)", format: cf.RGB }, | 45 { string: "rgb(1, 2, 3)", format: cf.RGB }, |
48 { string: "rgba(1, 2, 3, 0.2)", format: cf.RGB }, | 46 { string: "rgba(1, 2, 3, 0.2)", format: cf.RGB }, |
49 { string: "hsl(1, 100%, 50%)", format: cf.HSL }, | 47 { string: "hsl(1, 100%, 50%)", format: cf.HSL }, |
50 { string: "hsla(1, 100%, 50%, 0.2)", format: cf.HSLA }]; | 48 { string: "hsla(1, 100%, 50%, 0.2)", format: cf.HSLA }]; |
51 | 49 |
52 InspectorTest.addResult("--- Testing colorString()"); | 50 InspectorTest.addResult("--- Testing colorString()"); |
53 for (var color of inputColors) | 51 for (var color of inputColors) |
54 checkColorString(color.string, color.format); | 52 checkColorString(color.string, color.format); |
55 | 53 |
56 InspectorTest.addResult("--- Testing alpha changes"); | 54 InspectorTest.addResult("--- Testing alpha changes"); |
57 for (var color of inputColors) | 55 for (var color of inputColors) |
58 checkAlphaChange(color.string, color.format); | 56 checkAlphaChange(color.string, color.format); |
59 | 57 |
60 InspectorTest.addResult("--- Testing _formatViewSwitch()"); | 58 InspectorTest.addResult("--- Testing _formatViewSwitch()"); |
61 for (var color of inputColors) | 59 for (var color of inputColors) |
62 checkNextFormat(color.string, color.format); | 60 checkNextFormat(color.string, color.format); |
63 | 61 |
64 InspectorTest.completeTest(); | 62 InspectorTest.completeTest(); |
65 } | 63 } |
66 | 64 |
67 </script> | 65 </script> |
68 </head> | 66 </head> |
69 <body onload="runTest()"> | 67 <body onload="runTest()"> |
70 <p>Tests WebInspector.Spectrum</p> | 68 <p>Tests WebInspector.Spectrum</p> |
71 </body> | 69 </body> |
72 </html> | 70 </html> |
OLD | NEW |