Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/inspector/console/console-log-multiple-execution-contexts.html |
| diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-log-multiple-execution-contexts.html b/third_party/WebKit/LayoutTests/inspector/console/console-log-multiple-execution-contexts.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..990d14c51d3f23656075fa67e0f94b14690989f1 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/inspector/console/console-log-multiple-execution-contexts.html |
| @@ -0,0 +1,43 @@ |
| +<html> |
| +<head> |
| +<script src="../../http/tests/inspector/inspector-test.js"></script> |
| +<script src="../../http/tests/inspector/console-test.js"></script> |
| + |
| +<script> |
|
allada
2017/01/19 02:38:07
nit: can we merge these two script tags?
luoe
2017/01/19 23:22:59
Done.
|
| +function onload() |
| +{ |
| + var iframe = document.createElement("iframe"); |
| + iframe.src = "resources/iframe-logger.html"; |
| + document.body.appendChild(iframe); |
| + var worker = new Worker("resources/worker-logger.js"); |
|
allada
2017/01/19 02:38:07
There's no guarantee that this worker will have ex
luoe
2017/01/19 23:22:59
Done.
|
| + console.log('log from target page'); |
| + runTest(); |
| +} |
| +</script> |
| +<script> |
| +function test(){ |
| + InspectorTest.addResult("Adding swContext"); |
| + InspectorTest.runtimeModel._executionContextCreated({id: "sw1", auxData: { isDefault: true, frameId: "" }, origin: "origin", name: "swContext"}); |
| + var options = Console.ConsoleView.instance()._consoleContextSelector._selectElement.options; |
| + var values = Array.prototype.map.call(options, option => option.value); |
|
allada
2017/01/19 02:38:07
lets sort it just to protect against flakiness, bu
luoe
2017/01/19 23:22:59
Done.
|
| + InspectorTest.addResult('Context options: ' + values); |
|
allada
2017/01/19 02:38:07
Lets remove this line since it's doing it below.
luoe
2017/01/19 23:22:59
Done.
|
| + |
| + for (var value of values) { |
| + InspectorTest.changeExecutionContext(value); |
| + var currentContext = UI.context.flavor(SDK.ExecutionContext); |
| + InspectorTest.addResult('\nSwitched to context:' + Console.ConsoleContextSelector.titleFor(currentContext, false /* decorate */)); |
| + InspectorTest.dumpConsoleMessages(); |
| + } |
| + InspectorTest.completeTest(); |
| +} |
| + |
| +</script> |
| +</head> |
| + |
| +<body onload="onload()"> |
| +<p> |
| +Tests how execution context and target are selected. |
| +</p> |
| + |
| +</body> |
| +</html> |