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