| 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/console-test.js"></script> | 4 <script src="../../http/tests/inspector/console-test.js"></script> |
| 5 <script src="../editor/editor-test.js"></script> | 5 <script src="../editor/editor-test.js"></script> |
| 6 <script> | 6 <script> |
| 7 window.foobar = "foobar"; | 7 window.foobar = "foobar"; |
| 8 window.foobaz = "foobaz"; | 8 window.foobaz = "foobaz"; |
| 9 | 9 |
| 10 function test() | 10 function test() |
| 11 { | 11 { |
| 12 InspectorTest.waitUntilConsoleEditorLoaded().then(onConsoleEditorLoaded); | 12 InspectorTest.waitUntilConsoleEditorLoaded().then(onConsoleEditorLoaded); |
| 13 | 13 |
| 14 var consoleEditor; | 14 var consoleEditor; |
| 15 function onConsoleEditorLoaded(editor) | 15 function onConsoleEditorLoaded(editor) |
| 16 { | 16 { |
| 17 consoleEditor = editor; | 17 consoleEditor = editor; |
| 18 InspectorTest.runTestSuite(testSuite); | 18 InspectorTest.runTestSuite(testSuite); |
| 19 } | 19 } |
| 20 | 20 |
| 21 var testSuite = [ | 21 var testSuite = [ |
| 22 function testSummonSuggestBox(next) | 22 function testSummonSuggestBox(next) |
| 23 { | 23 { |
| 24 InspectorTest.addSniffer(WebInspector.TextEditorAutocompleteControll
er.prototype, "_onSuggestionsShownForTest", onSuggestionsShown); | 24 InspectorTest.addSniffer(TextEditor.TextEditorAutocompleteController
.prototype, "_onSuggestionsShownForTest", onSuggestionsShown); |
| 25 InspectorTest.typeIn(consoleEditor, "f"); | 25 InspectorTest.typeIn(consoleEditor, "f"); |
| 26 | 26 |
| 27 function onSuggestionsShown() | 27 function onSuggestionsShown() |
| 28 { | 28 { |
| 29 InspectorTest.addResult("Suggestions shown."); | 29 InspectorTest.addResult("Suggestions shown."); |
| 30 next(); | 30 next(); |
| 31 } | 31 } |
| 32 }, | 32 }, |
| 33 | 33 |
| 34 function testTypeText(next) | 34 function testTypeText(next) |
| 35 { | 35 { |
| 36 InspectorTest.addSniffer(WebInspector.TextEditorAutocompleteControll
er.prototype, "_onSuggestionsHiddenForTest", onSuggestionsHidden); | 36 InspectorTest.addSniffer(TextEditor.TextEditorAutocompleteController
.prototype, "_onSuggestionsHiddenForTest", onSuggestionsHidden); |
| 37 InspectorTest.addSniffer(WebInspector.TextEditorAutocompleteControll
er.prototype, "_onCursorActivityHandledForTest", onCursorActivityHandled); | 37 InspectorTest.addSniffer(TextEditor.TextEditorAutocompleteController
.prototype, "_onCursorActivityHandledForTest", onCursorActivityHandled); |
| 38 InspectorTest.typeIn(consoleEditor, "o"); | 38 InspectorTest.typeIn(consoleEditor, "o"); |
| 39 | 39 |
| 40 function onSuggestionsHidden() | 40 function onSuggestionsHidden() |
| 41 { | 41 { |
| 42 InspectorTest.addResult("FAIL: suggestbox is hidden during typin
g."); | 42 InspectorTest.addResult("FAIL: suggestbox is hidden during typin
g."); |
| 43 InspectorTest.completeTest(); | 43 InspectorTest.completeTest(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 function onCursorActivityHandled() | 46 function onCursorActivityHandled() |
| 47 { | 47 { |
| 48 InspectorTest.addResult("SUCCESS: suggestbox is not hidden durin
g typing."); | 48 InspectorTest.addResult("SUCCESS: suggestbox is not hidden durin
g typing."); |
| 49 next(); | 49 next(); |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 ]; | 52 ]; |
| 53 } | 53 } |
| 54 </script> | 54 </script> |
| 55 </head> | 55 </head> |
| 56 <body onload="runTest()"> | 56 <body onload="runTest()"> |
| 57 <p>Verify that console does not hide autocomplete during typing.</p> | 57 <p>Verify that console does not hide autocomplete during typing.</p> |
| 58 </body> | 58 </body> |
| 59 </html> | 59 </html> |
| OLD | NEW |