Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / autocomplete-test.js
blob8daf79f6b4b07d2b7dbcd8829efc142192722235
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) {
9             lineNumber = i;
10             break;
11         }
12     }
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));
17     var suggestions = [];
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(", ") + "]");