| 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> | 5 <script> |
| 6 | 6 |
| 7 function test() | 7 function test() |
| 8 { | 8 { |
| 9 var namePrompt = new WebInspector.StylesSidebarPane.CSSPropertyPrompt(WebIns
pector.cssMetadata().allProperties(), null, true); | 9 var namePrompt = new WebInspector.StylesSidebarPane.CSSPropertyPrompt(WebIns
pector.cssMetadata().allProperties(), null, true); |
| 10 var valuePrompt = valuePromptFor("color"); | 10 var valuePrompt = valuePromptFor("color"); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 function testEmptyNameForce(next) | 23 function testEmptyNameForce(next) |
| 24 { | 24 { |
| 25 testAgainstGolden(namePrompt, "", true, ["width"], [], next); | 25 testAgainstGolden(namePrompt, "", true, ["width"], [], next); |
| 26 }, | 26 }, |
| 27 | 27 |
| 28 function testSingleCharName(next) | 28 function testSingleCharName(next) |
| 29 { | 29 { |
| 30 testAgainstGolden(namePrompt, "w", false, ["width"], [], next); | 30 testAgainstGolden(namePrompt, "w", false, ["width"], [], next); |
| 31 }, | 31 }, |
| 32 | 32 |
| 33 function testSubstringName(next) |
| 34 { |
| 35 testAgainstGolden(namePrompt, "size", false, ["font-size", "backgrou
nd-size", "resize"], ["font-align"], next); |
| 36 }, |
| 37 |
| 33 function testEmptyValue(next) | 38 function testEmptyValue(next) |
| 34 { | 39 { |
| 35 testAgainstGolden(valuePrompt, "", false, ["aliceblue", "red", "inhe
rit"], [], next); | 40 testAgainstGolden(valuePrompt, "", false, ["aliceblue", "red", "inhe
rit"], [], next); |
| 36 }, | 41 }, |
| 37 | 42 |
| 38 function testImportantDeclarationDoNotToggleOnExclamationMark(next) | 43 function testImportantDeclarationDoNotToggleOnExclamationMark(next) |
| 39 { | 44 { |
| 40 testAgainstGolden(valuePrompt, "red !", false, [], ["!important"], n
ext); | 45 testAgainstGolden(valuePrompt, "red !", false, [], ["!important"], n
ext); |
| 41 }, | 46 }, |
| 42 | 47 |
| 43 function testImportantDeclaration(next) | 48 function testImportantDeclaration(next) |
| 44 { | 49 { |
| 45 testAgainstGolden(valuePrompt, "red !i", false, ["!important"], [],
next); | 50 testAgainstGolden(valuePrompt, "red !i", false, ["!important"], [],
next); |
| 46 }, | 51 }, |
| 47 | 52 |
| 48 function testValueR(next) | 53 function testValueR(next) |
| 49 { | 54 { |
| 50 testAgainstGolden(valuePrompt, "R", false, ["RED", "ROSYBROWN"], ["a
liceblue", "inherit"], next); | 55 testAgainstGolden(valuePrompt, "R", false, ["RED", "ROSYBROWN"], ["a
liceblue", "inherit"], next); |
| 51 }, | 56 }, |
| 52 | 57 |
| 53 function testValueWithParenthesis(next) | 58 function testValueWithParenthesis(next) |
| 54 { | 59 { |
| 55 testAgainstGolden(valuePrompt, "saturate(0%)", false, [], ["inherit"
], next); | 60 testAgainstGolden(valuePrompt, "saturate(0%)", false, [], ["inherit"
], next); |
| 56 }, | 61 }, |
| 57 | 62 |
| 58 function testValuePrefixed(next) | 63 function testValuePrefixed(next) |
| 59 { | 64 { |
| 60 testAgainstGolden(valuePromptFor("-webkit-transform"), "t", false, [
"translate", "translateY", "translate3d"], ["initial", "inherit"], next); | 65 testAgainstGolden(valuePromptFor("-webkit-transform"), "tr", false,
["translate", "translateY", "translate3d"], ["initial", "inherit"], next); |
| 61 }, | 66 }, |
| 62 | 67 |
| 63 function testValueUnprefixed(next) | 68 function testValueUnprefixed(next) |
| 64 { | 69 { |
| 65 testAgainstGolden(valuePromptFor("transform"), "t", false, ["transla
te", "translateY", "translate3d"], ["initial", "inherit"], next); | 70 testAgainstGolden(valuePromptFor("transform"), "tr", false, ["transl
ate", "translateY", "translate3d"], ["initial", "inherit"], next); |
| 71 }, |
| 72 |
| 73 function testValueSubstring(next) |
| 74 { |
| 75 testAgainstGolden(valuePromptFor("color"), "blue", false, ["blue", "
darkblue", "lightblue"], ["darkred", "yellow", "initial", "inherit"], next); |
| 66 } | 76 } |
| 67 ]); | 77 ]); |
| 68 | 78 |
| 69 function testAgainstGolden(prompt, inputText, force, golden, antiGolden, cal
lback) | 79 function testAgainstGolden(prompt, inputText, force, golden, antiGolden, cal
lback) |
| 70 { | 80 { |
| 71 var proxyElement = document.createElement("div"); | 81 var proxyElement = document.createElement("div"); |
| 72 document.body.appendChild(proxyElement); | 82 document.body.appendChild(proxyElement); |
| 73 proxyElement.style = "webkit-user-select: text; -webkit-user-modify: rea
d-write-plaintext-only"; | 83 proxyElement.style = "webkit-user-select: text; -webkit-user-modify: rea
d-write-plaintext-only"; |
| 74 proxyElement.textContent = inputText; | 84 proxyElement.textContent = inputText; |
| 75 var selectionRange = document.createRange(); | 85 var selectionRange = document.createRange(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 101 } | 111 } |
| 102 </script> | 112 </script> |
| 103 </head> | 113 </head> |
| 104 | 114 |
| 105 <body onload="runTest()"> | 115 <body onload="runTest()"> |
| 106 <p> | 116 <p> |
| 107 Tests that autocompletions are computed correctly when editing the Styles pane. | 117 Tests that autocompletions are computed correctly when editing the Styles pane. |
| 108 </p> | 118 </p> |
| 109 </body> | 119 </body> |
| 110 </html> | 120 </html> |
| OLD | NEW |