| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../sources/debugger/resources/edit-me.js"></script> | 3 <script src="../sources/debugger/resources/edit-me.js"></script> |
| 4 <script src="../editor/editor-test.js"></script> | 4 <script src="../editor/editor-test.js"></script> |
| 5 <script src="../../http/tests/inspector/inspector-test.js"></script> | 5 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 6 <script src="../../http/tests/inspector/debugger-test.js"></script> | 6 <script src="../../http/tests/inspector/debugger-test.js"></script> |
| 7 <script> | 7 <script> |
| 8 function codeSnippet() { | 8 function codeSnippet() { |
| 9 return document.getElementById("codeSnippet").textContent; | 9 return document.getElementById("codeSnippet").textContent; |
| 10 } | 10 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // This test has to be the first. It validates that autocompletion contr
oller | 25 // This test has to be the first. It validates that autocompletion contr
oller |
| 26 // will initialize as a key will be pressed. | 26 // will initialize as a key will be pressed. |
| 27 function testCompletionsShowUpOnKeyPress(next) | 27 function testCompletionsShowUpOnKeyPress(next) |
| 28 { | 28 { |
| 29 textEditor.setText("name1 name2 name3 name4\nna"); | 29 textEditor.setText("name1 name2 name3 name4\nna"); |
| 30 textEditor.setSelection(WebInspector.TextRange.createFromLocation(1,
2)); | 30 textEditor.setSelection(WebInspector.TextRange.createFromLocation(1,
2)); |
| 31 InspectorTest.addSniffer(WebInspector.TextEditorAutocompleteControll
er.prototype, "_onSuggestionsShownForTest", onAutocompletionSuggestBox); | 31 InspectorTest.addSniffer(WebInspector.TextEditorAutocompleteControll
er.prototype, "_onSuggestionsShownForTest", onAutocompletionSuggestBox); |
| 32 InspectorTest.typeIn(textEditor, "m"); | 32 InspectorTest.typeIn(textEditor, "m"); |
| 33 function onAutocompletionSuggestBox() | 33 function onAutocompletionSuggestBox() |
| 34 { | 34 { |
| 35 document.activeElement.dispatchEvent(InspectorTest.createKeyEven
t("Enter")); | 35 var root = textEditor.element; |
| 36 while (root && root.nodeType !== Node.DOCUMENT_FRAGMENT_NODE) |
| 37 root = root.parentNode; |
| 38 (root || document).activeElement.dispatchEvent(InspectorTest.cre
ateKeyEvent("Enter")); |
| 36 dumpDictionary(next); | 39 dumpDictionary(next); |
| 37 } | 40 } |
| 38 }, | 41 }, |
| 39 | 42 |
| 40 function testSetInitialText(next) | 43 function testSetInitialText(next) |
| 41 { | 44 { |
| 42 textEditor.setText("one two three3_\nfour five\na_b\nsix\n123foo\n13
2\nseven"); | 45 textEditor.setText("one two three3_\nfour five\na_b\nsix\n123foo\n13
2\nseven"); |
| 43 dumpDictionary(next); | 46 dumpDictionary(next); |
| 44 }, | 47 }, |
| 45 | 48 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 </script> | 85 </script> |
| 83 </head> | 86 </head> |
| 84 | 87 |
| 85 <body onload="runTest();"> | 88 <body onload="runTest();"> |
| 86 <p> | 89 <p> |
| 87 This test checks how text editor updates autocompletion dictionary in a response | 90 This test checks how text editor updates autocompletion dictionary in a response |
| 88 to user input. | 91 to user input. |
| 89 </p> | 92 </p> |
| 90 </body> | 93 </body> |
| 91 </html> | 94 </html> |
| OLD | NEW |