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

Side by Side Diff: test/inspector/sessions/runtime-console-api-called.js

Issue 2906153002: [inspector] Support multiple sessions per context group (Closed)
Patch Set: using set per kozy@ Created 3 years, 6 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 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 InspectorTest.log('Tests that all sessions get console api notifications.');
6
7 function connect(contextGroup, num) {
8 var session = contextGroup.connect();
9 session.Protocol.Runtime.onConsoleAPICalled(message => {
10 InspectorTest.log('From session ' + num);
11 InspectorTest.logMessage(message);
12 });
13 return session;
14 }
15
16 (async function test() {
17 var contextGroup = new InspectorTest.ContextGroup();
18 var session1 = connect(contextGroup, 1);
19 var session2 = connect(contextGroup, 2);
20 await session1.Protocol.Runtime.enable();
21 await session2.Protocol.Runtime.enable();
22
23 InspectorTest.log('Error in 2');
24 await session2.Protocol.Runtime.evaluate({expression: 'console.error(1)'});
25
26 InspectorTest.log('Logging in 1');
27 await session1.Protocol.Runtime.evaluate({expression: 'console.log(2)'});
28
29 InspectorTest.log('Error in setTimeout 1');
30 await session1.Protocol.Runtime.evaluate({expression: 'setTimeout(() => consol e.error("a"), 0)'});
31 await InspectorTest.waitForPendingTasks();
32
33 InspectorTest.log('Logging in setTimeout 2');
34 await session2.Protocol.Runtime.evaluate({expression: 'setTimeout(() => consol e.log("b"), 0)'});
35 await InspectorTest.waitForPendingTasks();
36
37 InspectorTest.completeTest();
38 })();
OLDNEW
« no previous file with comments | « test/inspector/sessions/create-session-expected.txt ('k') | test/inspector/sessions/runtime-console-api-called-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698