| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <base href="/inspector-debug/"></base> | 3 <base href="/inspector-debug/"></base> |
| 4 <script src="/inspector-debug/Runtime.js"></script> | 4 <script src="/inspector-debug/Runtime.js"></script> |
| 5 <script src="/inspector-unit/inspector-unit-test.js"></script> | 5 <script src="/inspector-unit/inspector-unit-test.js"></script> |
| 6 <script type="text/javascript"> | 6 <script type="text/javascript"> |
| 7 | 7 |
| 8 function test() | 8 function test() |
| 9 { | 9 { |
| 10 var suggestions = ["testTextPrompt"]; | 10 var suggestions = ["testTextPrompt"]; |
| 11 var waitingForAutocomplete = null; | 11 var waitingForAutocomplete = null; |
| 12 var completionsDone = function () { | 12 var completionsDone = function () { |
| 13 console.error("completionsDone called too early!"); | 13 console.error("completionsDone called too early!"); |
| 14 UnitTest.completeTest(); | 14 UnitTest.completeTest(); |
| 15 } | 15 } |
| 16 var prompt = new WebInspector.TextPrompt(); | 16 var prompt = new UI.TextPrompt(); |
| 17 prompt.initialize(completions); | 17 prompt.initialize(completions); |
| 18 var element = createElement("div"); | 18 var element = createElement("div"); |
| 19 WebInspector.inspectorView.element.appendChild(element); | 19 UI.inspectorView.element.appendChild(element); |
| 20 var proxy = prompt.attachAndStartEditing(element); | 20 var proxy = prompt.attachAndStartEditing(element); |
| 21 prompt.setText("testT"); | 21 prompt.setText("testT"); |
| 22 prompt.complete(); | 22 prompt.complete(); |
| 23 dumpTextPrompt(); | 23 dumpTextPrompt(); |
| 24 completionsDone(); | 24 completionsDone(); |
| 25 dumpTextPrompt(); | 25 dumpTextPrompt(); |
| 26 | 26 |
| 27 typeCharacter("e"); | 27 typeCharacter("e"); |
| 28 dumpTextPrompt(); | 28 dumpTextPrompt(); |
| 29 | 29 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 selection.removeAllRanges(); | 106 selection.removeAllRanges(); |
| 107 selection.addRange(range); | 107 selection.addRange(range); |
| 108 element.dispatchEvent(new Event("input", {bubbles: true, cancelable: fal
se})); | 108 element.dispatchEvent(new Event("input", {bubbles: true, cancelable: fal
se})); |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 | 111 |
| 112 | 112 |
| 113 </script> | 113 </script> |
| 114 </head> | 114 </head> |
| 115 <body> | 115 <body> |
| 116 <p>Tests that the hint displays properly on a WebInspector.TextPrompt with autoc
omplete.</p> | 116 <p>Tests that the hint displays properly on a UI.TextPrompt with autocomplete.</
p> |
| 117 </body> | 117 </body> |
| 118 </html> | 118 </html> |
| OLD | NEW |