Index: Source/devtools/front_end/main/Tests.js |
diff --git a/Source/devtools/front_end/main/Tests.js b/Source/devtools/front_end/main/Tests.js |
index 0b2a1746034df1069a00d42e0d8e39e9e4694848..cbd5ede269c285f5e23a308b02cb1740898a78a4 100644 |
--- a/Source/devtools/front_end/main/Tests.js |
+++ b/Source/devtools/front_end/main/Tests.js |
@@ -772,6 +772,7 @@ TestSuite.prototype.evaluateInConsole_ = function(code, callback) |
{ |
function innerEvaluate() |
{ |
+ WebInspector.context.removeFlavorChangeListener(WebInspector.ExecutionContext, showConsoleAndEvaluate, this); |
var consoleView = WebInspector.ConsolePanel._view(); |
consoleView._prompt.text = code; |
consoleView._promptElement.dispatchEvent(TestSuite.createKeyEvent("Enter")); |
@@ -782,12 +783,16 @@ TestSuite.prototype.evaluateInConsole_ = function(code, callback) |
}.bind(this)); |
} |
+ function showConsoleAndEvaluate() |
+ { |
+ WebInspector.console.showPromise().then(innerEvaluate.bind(this)); |
+ } |
+ |
if (!WebInspector.context.flavor(WebInspector.ExecutionContext)) { |
- WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext, innerEvaluate, this); |
+ WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext, showConsoleAndEvaluate, this); |
return; |
} |
- |
- WebInspector.console.showPromise().then(innerEvaluate.bind(this)); |
+ showConsoleAndEvaluate.call(this); |
}; |
/** |