Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/console/console-log-multiple-execution-contexts.html

Issue 2623143002: DevTools: insert console message decorations in order
Patch Set: ac Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 <script>
6 function prepareMessages()
7 {
8 var iframe = document.createElement("iframe");
9 iframe.src = "resources/iframe-logger.html";
10 document.body.appendChild(iframe);
11 console.log('log from target page');
12 var worker = new Worker("resources/worker-logger.js");
13 var startedTest = false;
14 worker.onmessage = function() {
15 if (!startedTest) {
16 runTest();
17 startedTest = true;
18 }
19 }
20 worker.postMessage(null);
21 }
22
23 function test(){
24 InspectorTest.evaluateInPage("prepareMessages()", step2);
25
26 function step2() {
27 InspectorTest.waitForConsoleMessages(3, step3);
28 }
29
30 function step3() {
31 InspectorTest.addResult("Adding swContext");
32 InspectorTest.runtimeModel._executionContextCreated({id: "sw1", auxData: { isDefault: true, frameId: "" }, origin: "origin", name: "swContext"});
33 var options = Console.ConsoleView.instance()._consoleContextSelector._se lectElement.options;
34 var values = Array.prototype.map.call(options, option => option.value).s ort();
35 var currentContextName = Console.ConsoleContextSelector.titleForContext( UI.context.flavor(SDK.ExecutionContext), false /* formatForSelector */);
36 InspectorTest.addResult('Current context:' + currentContextName);
37
38 for (var value of values) {
39 InspectorTest.changeExecutionContext(value);
40 var currentContext = UI.context.flavor(SDK.ExecutionContext);
41 InspectorTest.addResult('\nSwitched to context:' + Console.ConsoleCo ntextSelector.titleForContext(currentContext, false /* formatForSelector */));
42 InspectorTest.dumpConsoleMessages();
43 }
44 InspectorTest.completeTest();
45 }
46 }
47
48 </script>
49 </head>
50
51 <body onload="runTest()">
52 <p>
53 Tests how execution context and target are selected.
54 </p>
55
56 </body>
57 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698