| Index: third_party/WebKit/Source/devtools/front_end/Tests.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/Tests.js b/third_party/WebKit/Source/devtools/front_end/Tests.js
|
| index d78c776ea6a5df58ef12898b611e3615346325fc..4ac330f5240967600ddbb4064e084c6ec658fabf 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/Tests.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/Tests.js
|
| @@ -922,6 +922,25 @@ TestSuite.prototype.testWindowInitializedOnNavigateBack = function()
|
| this.fail(text);
|
| };
|
|
|
| +TestSuite.prototype.testConsoleContextNames = function()
|
| +{
|
| + var test = this;
|
| + test.takeControl();
|
| + this.showPanel("console").then(() => this._waitForExecutionContexts(2, onExecutionContexts.bind(this)));
|
| +
|
| + function onExecutionContexts()
|
| + {
|
| + var consoleView = WebInspector.ConsoleView.instance();
|
| + var options = consoleView._consoleContextSelector._selectElement.options;
|
| + var values = [];
|
| + for (var i = 0; i < options.length; ++i)
|
| + values.push(options[i].value.trim());
|
| + test.assertEquals("top", values[0]);
|
| + test.assertEquals("Simple content script", values[1]);
|
| + test.releaseControl();
|
| + }
|
| +}
|
| +
|
| TestSuite.prototype.waitForTestResultsInConsole = function()
|
| {
|
| var messages = WebInspector.multitargetConsoleModel.messages();
|
| @@ -1176,6 +1195,20 @@ TestSuite.prototype._waitForTargets = function(n, callback)
|
| }
|
| }
|
|
|
| +TestSuite.prototype._waitForExecutionContexts = function(n, callback)
|
| +{
|
| + var runtimeModel = WebInspector.targetManager.mainTarget().runtimeModel;
|
| + checkForExecutionContexts.call(this);
|
| +
|
| + function checkForExecutionContexts()
|
| + {
|
| + if (runtimeModel.executionContexts().length >= n)
|
| + callback.call(null);
|
| + else
|
| + this.addSniffer(WebInspector.RuntimeModel.prototype, "_executionContextCreated", checkForExecutionContexts.bind(this));
|
| + }
|
| +}
|
| +
|
| /**
|
| * Key event with given key identifier.
|
| */
|
|
|