Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / autocomplete-general.html
blob5113ef2da0c4b8a6615fa3f93f1076bb1f96956f
1 <html>
2 <head>
3 <script src="../sources/debugger/resources/edit-me.js"></script>
4 <script src="../editor/editor-test.js"></script>
5 <script src="../../http/tests/inspector/inspector-test.js"></script>
6 <script src="../../http/tests/inspector/debugger-test.js"></script>
7 <script>
8 function codeSnippet() {
9 return document.getElementById("codeSnippet").textContent;
12 function test()
14 InspectorTest.showScriptSource("edit-me.js", onSourceFrame);
16 var textEditor;
17 function onSourceFrame(sourceFrame)
19 textEditor = sourceFrame.textEditor;
20 textEditor.element.focus();
21 InspectorTest.runTestSuite(testSuite);
24 var testSuite = [
25 // This test has to be the first. It validates that autocompletion controller
26 // will initialize as a key will be pressed.
27 function testCompletionsShowUpOnKeyPress(next)
29 textEditor.setText("name1 name2 name3 name4\nna");
30 textEditor.setSelection(WebInspector.TextRange.createFromLocation(1, 2));
31 InspectorTest.addSniffer(WebInspector.TextEditorAutocompleteController.prototype, "_onSuggestionsShownForTest", onAutocompletionSuggestBox);
32 InspectorTest.typeIn(textEditor, "m");
33 function onAutocompletionSuggestBox()
35 document.activeElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
36 dumpDictionary(next);
40 function testSetInitialText(next)
42 textEditor.setText("one two three3_\nfour five\na_b\nsix\n123foo\n132\nseven");
43 dumpDictionary(next);
46 function testAlphaNumericWords(next)
48 textEditor.setText("2 2foo foo2 2foo4 foo3bar");
49 dumpDictionary(next);
52 function testSetText(next)
54 textEditor.setText("dog cat 'mouse';dog bird");
55 dumpDictionary(next);
58 function testSimpleEdit(next)
60 textEditor.setSelection(WebInspector.TextRange.createFromLocation(0, 3));
61 InspectorTest.typeIn(textEditor, "\b", dumpDictionary.bind(null, next));
64 function testDeleteOneDogAndOneCat(next)
66 textEditor.setSelection(WebInspector.TextRange.createFromLocation(0, 6));
67 InspectorTest.typeIn(textEditor, "\b\b\b\b\b\b", dumpDictionary.bind(null, next));
71 function dumpDictionary(next) {
72 var wordsInDictionary = textEditor._autocompleteController._delegate._dictionary.wordsWithPrefix("");
73 InspectorTest.addResult("========= Text in editor =========");
74 InspectorTest.dumpTextWithSelection(textEditor);
75 InspectorTest.addResult("======= Words in dictionary =======");
76 InspectorTest.addResult("[" + wordsInDictionary.sort().join(", ") + "]");
77 InspectorTest.addResult("=============");
78 next();
82 </script>
83 </head>
85 <body onload="runTest();">
86 <p>
87 This test checks how text editor updates autocompletion dictionary in a response
88 to user input.
89 </p>
90 </body>
91 </html>