Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | |
| 4 <script src="../../http/tests/inspector/console-test.js"></script> | |
| 5 | |
| 6 <script> | |
|
allada
2017/01/19 02:38:07
nit: can we merge these two script tags?
luoe
2017/01/19 23:22:59
Done.
| |
| 7 function onload() | |
| 8 { | |
| 9 var iframe = document.createElement("iframe"); | |
| 10 iframe.src = "resources/iframe-logger.html"; | |
| 11 document.body.appendChild(iframe); | |
| 12 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.
| |
| 13 console.log('log from target page'); | |
| 14 runTest(); | |
| 15 } | |
| 16 </script> | |
| 17 <script> | |
| 18 function test(){ | |
| 19 InspectorTest.addResult("Adding swContext"); | |
| 20 InspectorTest.runtimeModel._executionContextCreated({id: "sw1", auxData: { i sDefault: true, frameId: "" }, origin: "origin", name: "swContext"}); | |
| 21 var options = Console.ConsoleView.instance()._consoleContextSelector._select Element.options; | |
| 22 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.
| |
| 23 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.
| |
| 24 | |
| 25 for (var value of values) { | |
| 26 InspectorTest.changeExecutionContext(value); | |
| 27 var currentContext = UI.context.flavor(SDK.ExecutionContext); | |
| 28 InspectorTest.addResult('\nSwitched to context:' + Console.ConsoleContex tSelector.titleFor(currentContext, false /* decorate */)); | |
| 29 InspectorTest.dumpConsoleMessages(); | |
| 30 } | |
| 31 InspectorTest.completeTest(); | |
| 32 } | |
| 33 | |
| 34 </script> | |
| 35 </head> | |
| 36 | |
| 37 <body onload="onload()"> | |
| 38 <p> | |
| 39 Tests how execution context and target are selected. | |
| 40 </p> | |
| 41 | |
| 42 </body> | |
| 43 </html> | |
| OLD | NEW |