1 function initialize_AutocompleteTest()
4 InspectorTest.dumpSuggestions = function(textEditor, lines) {
5 var lineNumber = -1, columnNumber;
6 for (var i = 0; i < lines.length; ++i) {
7 var columnNumber = lines[i].indexOf("|");
8 if (columnNumber !== -1) {
13 if (lineNumber === -1)
14 throw new Error("Test case is invalid: cursor position is not marked with '|' symbol.");
15 textEditor.setText(lines.join("\n").replace("|", ""));
16 textEditor.setSelection(WebInspector.TextRange.createFromLocation(lineNumber, columnNumber));
18 InspectorTest.addSniffer(WebInspector.TextEditorAutocompleteController.prototype, "_onSuggestionsShownForTest", function (words) { suggestions = words; });
19 textEditor._autocompleteController.autocomplete();
21 InspectorTest.addResult("========= Selection In Editor =========");
22 InspectorTest.dumpTextWithSelection(textEditor);
23 InspectorTest.addResult("======= Autocomplete Suggestions =======");
24 InspectorTest.addResult("[" + suggestions.join(", ") + "]");