| 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._appendCommand(code, true); | 24 consoleView._prompt._appendCommand(code, true); |
| 25 InspectorTest.addConsoleViewSniffer(function(commandResult) { | 25 InspectorTest.addConsoleViewSniffer(function(commandResult) { |
| 26 callback(commandResult.toMessageElement().deepTextContent()); | 26 callback(commandResult.toMessageElement().deepTextContent()); |
| 27 }); | 27 }); |
| 28 } | 28 } |
| 29 | 29 |
| 30 InspectorTest.addConsoleViewSniffer = function(override, opt_sticky) | 30 InspectorTest.addConsoleViewSniffer = function(override, opt_sticky) |
| 31 { | 31 { |
| 32 var sniffer = function (viewMessage) { | 32 var sniffer = function (viewMessage) { |
| 33 override(viewMessage); | 33 override(viewMessage); |
| 34 }; | 34 }; |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 if (consoleView._visibleViewMessages.length === expectedCount) { | 415 if (consoleView._visibleViewMessages.length === expectedCount) { |
| 416 InspectorTest.addResult("Message count: " + expectedCount); | 416 InspectorTest.addResult("Message count: " + expectedCount); |
| 417 callback(); | 417 callback(); |
| 418 } else { | 418 } else { |
| 419 InspectorTest.addSniffer(consoleView, "_messageAppendedForTests", ch
eckAndReturn); | 419 InspectorTest.addSniffer(consoleView, "_messageAppendedForTests", ch
eckAndReturn); |
| 420 } | 420 } |
| 421 } | 421 } |
| 422 } | 422 } |
| 423 | 423 |
| 424 } | 424 } |
| OLD | NEW |