Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 var initialize_ConsoleTest = function() { | 1 var initialize_ConsoleTest = function() { |
| 2 | 2 |
| 3 InspectorTest.preloadModule("source_frame"); | 3 InspectorTest.preloadModule("source_frame"); |
| 4 InspectorTest.preloadPanel("console"); | 4 InspectorTest.preloadPanel("console"); |
| 5 | 5 |
| 6 InspectorTest.selectMainExecutionContext = function() | 6 InspectorTest.selectMainExecutionContext = function() |
| 7 { | 7 { |
| 8 var executionContexts = InspectorTest.mainTarget.runtimeModel.executionConte xts(); | 8 var executionContexts = InspectorTest.mainTarget.runtimeModel.executionConte xts(); |
| 9 for (var context of executionContexts) { | 9 for (var context of executionContexts) { |
| 10 if (context.isDefault) { | 10 if (context.isDefault) { |
| 11 WebInspector.context.setFlavor(WebInspector.ExecutionContext, contex t); | 11 WebInspector.context.setFlavor(WebInspector.ExecutionContext, contex t); |
| 12 return; | 12 return; |
| 13 } | 13 } |
| 14 } | 14 } |
| 15 } | 15 } |
| 16 | 16 |
| 17 InspectorTest.evaluateInConsole = function(code, callback, dontForceMainContext) | 17 InspectorTest.evaluateInConsole = function(code, callback, dontForceMainContext) |
| 18 { | 18 { |
| 19 if (!dontForceMainContext) | 19 if (!dontForceMainContext) |
| 20 InspectorTest.selectMainExecutionContext(); | 20 InspectorTest.selectMainExecutionContext(); |
| 21 callback = InspectorTest.safeWrap(callback); | 21 callback = InspectorTest.safeWrap(callback); |
| 22 | 22 |
| 23 var consoleView = WebInspector.ConsoleView.instance(); | 23 var consoleView = WebInspector.ConsoleView.instance(); |
| 24 consoleView.visible = true; | 24 consoleView.visible = true; |
| 25 consoleView._prompt.setText(code); | 25 consoleView._prompt.setText(code); |
| 26 var event = document.createEvent("KeyboardEvent"); | 26 var event = new KeyboardEvent("keydown", |
| 27 event.initKeyboardEvent("keydown", true, true, null, "Enter", ""); | 27 { key: "Enter", |
| 28 keyIdentifier: "Enter", | |
| 29 bubbles: true, | |
| 30 cancelable: true | |
| 31 }); | |
|
caseq
2016/06/10 18:59:11
reformat to use indent of 4:
var event = new Keybo
dtapuska
2016/06/10 20:25:43
Done. I believe keyIdentifier is kind of needed un
| |
| 28 consoleView._prompt.proxyElementForTests().dispatchEvent(event); | 32 consoleView._prompt.proxyElementForTests().dispatchEvent(event); |
| 29 InspectorTest.addConsoleViewSniffer(function(commandResult) { | 33 InspectorTest.addConsoleViewSniffer(function(commandResult) { |
| 30 callback(commandResult.toMessageElement().deepTextContent()); | 34 callback(commandResult.toMessageElement().deepTextContent()); |
| 31 }); | 35 }); |
| 32 } | 36 } |
| 33 | 37 |
| 34 InspectorTest.addConsoleViewSniffer = function(override, opt_sticky) | 38 InspectorTest.addConsoleViewSniffer = function(override, opt_sticky) |
| 35 { | 39 { |
| 36 var sniffer = function (viewMessage) { | 40 var sniffer = function (viewMessage) { |
| 37 override(viewMessage); | 41 override(viewMessage); |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 404 if (consoleView._visibleViewMessages.length === expectedCount) { | 408 if (consoleView._visibleViewMessages.length === expectedCount) { |
| 405 InspectorTest.addResult("Message count: " + expectedCount); | 409 InspectorTest.addResult("Message count: " + expectedCount); |
| 406 callback(); | 410 callback(); |
| 407 } else { | 411 } else { |
| 408 InspectorTest.addSniffer(consoleView, "_messageAppendedForTests", ch eckAndReturn); | 412 InspectorTest.addSniffer(consoleView, "_messageAppendedForTests", ch eckAndReturn); |
| 409 } | 413 } |
| 410 } | 414 } |
| 411 } | 415 } |
| 412 | 416 |
| 413 } | 417 } |
| OLD | NEW |