| 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> | 5 <script> |
| 6 | 6 |
| 7 var a = {}; | 7 var a = {}; |
| 8 for (var i = 0; i < 1000; ++i) | 8 for (var i = 0; i < 1000; ++i) |
| 9 a[i] = "property" + i; | 9 a[i] = "property" + i; |
| 10 | 10 |
| 11 function test() | 11 function test() |
| 12 { | 12 { |
| 13 var consoleView = WebInspector.ConsoleView.instance(); | 13 var consoleView = WebInspector.ConsoleView.instance(); |
| 14 consoleView._prompt.setText("pro"); | 14 consoleView._prompt.setText("pro"); |
| 15 | 15 |
| 16 InspectorTest.addSniffer(consoleView._prompt._suggestBox, "updateSuggestions
", suggestionsShown); | 16 InspectorTest.addSniffer(consoleView._prompt._suggestBox, "updateSuggestions
", suggestionsShown); |
| 17 consoleView._prompt._element.dispatchEvent(new KeyboardEvent("keydown", { ke
y: "p"})); | 17 consoleView._prompt._element.dispatchEvent(new KeyboardEvent("keydown", { ke
y: "p"})); |
| 18 consoleView._prompt._element.dispatchEvent(new InputEvent("input", {})); | 18 consoleView._prompt._element.dispatchEvent(new InputEvent("input", {})); |
| 19 | 19 |
| 20 function suggestionsShown() | 20 function suggestionsShown() |
| 21 { | 21 { |
| 22 consoleView._prompt._element.dispatchEvent(new KeyboardEvent("keydown",
{ key: "e"})); | 22 consoleView._prompt._element.dispatchEvent(new KeyboardEvent("keydown",
{ key: "e"})); |
| 23 consoleView._prompt._element.dispatchEvent(new InputEvent("input", {})); | 23 consoleView._prompt._element.dispatchEvent(new InputEvent("input", {})); |
| 24 setTimeout(keyDownTab, 0); | 24 setTimeout(keyDownTab, 0); |
| 25 } | 25 } |
| 26 | 26 |
| 27 function keyDownTab() | 27 function keyDownTab() |
| 28 { | 28 { |
| 29 consoleView._prompt._element.dispatchEvent(new KeyboardEvent("keydown",
{ keyIdentifier: "U+0009" })); | 29 consoleView._prompt._element.dispatchEvent(new KeyboardEvent("keydown",
{ key: "Tab" })); |
| 30 InspectorTest.completeTest(); | 30 InspectorTest.completeTest(); |
| 31 } | 31 } |
| 32 } | 32 } |
| 33 </script> | 33 </script> |
| 34 </head> | 34 </head> |
| 35 <body onload="runTest()"> | 35 <body onload="runTest()"> |
| 36 <p>Tests that TextPrompt doesn't throw exception on some event sequence. crbug.c
om/587683</p> | 36 <p>Tests that TextPrompt doesn't throw exception on some event sequence. crbug.c
om/587683</p> |
| 37 </body> | 37 </body> |
| 38 </html> | 38 </html> |
| OLD | NEW |