| 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> | 4 <script> |
| 5 | 5 |
| 6 function test() | 6 function test() |
| 7 { | 7 { |
| 8 InspectorTest.addResult("-----CSSLengths-----"); | 8 InspectorTest.addResult("-----CSSLengths-----"); |
| 9 dumpCSSLength("10px"); | 9 dumpCSSLength("10px"); |
| 10 dumpCSSLength("10PX"); | 10 dumpCSSLength("10PX"); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 dumpBoxShadow("hello 1px 2px"); | 81 dumpBoxShadow("hello 1px 2px"); |
| 82 dumpBoxShadow("1px 2px black 0 0 #ffffff"); | 82 dumpBoxShadow("1px 2px black 0 0 #ffffff"); |
| 83 dumpBoxShadow("1px2px"); | 83 dumpBoxShadow("1px2px"); |
| 84 dumpBoxShadow("1px 2pxrgb(0, 0, 0)"); | 84 dumpBoxShadow("1px 2pxrgb(0, 0, 0)"); |
| 85 dumpBoxShadow("1px 2px black,, 0 0 #ffffff"); | 85 dumpBoxShadow("1px 2px black,, 0 0 #ffffff"); |
| 86 | 86 |
| 87 InspectorTest.completeTest(); | 87 InspectorTest.completeTest(); |
| 88 | 88 |
| 89 function dumpCSSLength(lengthText) | 89 function dumpCSSLength(lengthText) |
| 90 { | 90 { |
| 91 var length = WebInspector.CSSLength.parse(lengthText); | 91 var length = Common.CSSLength.parse(lengthText); |
| 92 var statusText = length !== null ? "Succeeded: " + length.asCSSText() :
"Failed"; | 92 var statusText = length !== null ? "Succeeded: " + length.asCSSText() :
"Failed"; |
| 93 InspectorTest.addResult("\"" + lengthText + "\", Parsing " + statusText
); | 93 InspectorTest.addResult("\"" + lengthText + "\", Parsing " + statusText
); |
| 94 } | 94 } |
| 95 | 95 |
| 96 function dumpTextShadow(shadowText) | 96 function dumpTextShadow(shadowText) |
| 97 { | 97 { |
| 98 dumpShadow(shadowText, false); | 98 dumpShadow(shadowText, false); |
| 99 } | 99 } |
| 100 | 100 |
| 101 function dumpBoxShadow(shadowText) | 101 function dumpBoxShadow(shadowText) |
| 102 { | 102 { |
| 103 dumpShadow(shadowText, true); | 103 dumpShadow(shadowText, true); |
| 104 } | 104 } |
| 105 | 105 |
| 106 function dumpShadow(shadowText, isBoxShadow) | 106 function dumpShadow(shadowText, isBoxShadow) |
| 107 { | 107 { |
| 108 var shadows = isBoxShadow ? WebInspector.CSSShadowModel.parseBoxShadow(s
hadowText) : WebInspector.CSSShadowModel.parseTextShadow(shadowText); | 108 var shadows = isBoxShadow ? Common.CSSShadowModel.parseBoxShadow(shadowT
ext) : Common.CSSShadowModel.parseTextShadow(shadowText); |
| 109 var output = []; | 109 var output = []; |
| 110 for (var i = 0; i < shadows.length; i++) | 110 for (var i = 0; i < shadows.length; i++) |
| 111 output.push(shadows[i].asCSSText()); | 111 output.push(shadows[i].asCSSText()); |
| 112 var statusText = shadows.length !== 0 ? "Succeeded: " + output.join(", "
) : "Failed"; | 112 var statusText = shadows.length !== 0 ? "Succeeded: " + output.join(", "
) : "Failed"; |
| 113 InspectorTest.addResult("\"" + shadowText + "\", Parsing " + statusText
); | 113 InspectorTest.addResult("\"" + shadowText + "\", Parsing " + statusText
); |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 | 116 |
| 117 </script> | 117 </script> |
| 118 </head> | 118 </head> |
| 119 | 119 |
| 120 <body onload="runTest()"> | 120 <body onload="runTest()"> |
| 121 <p>Tests CSSLength.parse, CSSShadowModel.parseTextShadow, and CSSShadowModel.par
seBoxShadow.</p> | 121 <p>Tests CSSLength.parse, CSSShadowModel.parseTextShadow, and CSSShadowModel.par
seBoxShadow.</p> |
| 122 </body> | 122 </body> |
| 123 </html> | 123 </html> |
| OLD | NEW |