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

Unified Diff: test/inspector/sessions/create-session.js

Issue 2906153002: [inspector] Support multiple sessions per context group (Closed)
Patch Set: using set per kozy@ Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/inspector/isolate-data.cc ('k') | test/inspector/sessions/create-session-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/sessions/create-session.js
diff --git a/test/inspector/sessions/create-session.js b/test/inspector/sessions/create-session.js
new file mode 100644
index 0000000000000000000000000000000000000000..11635838452e3b054c2cbc89df97f22ff7fdaac7
--- /dev/null
+++ b/test/inspector/sessions/create-session.js
@@ -0,0 +1,58 @@
+// Copyright 2017 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+InspectorTest.log('Tests that creating multiple sessions works.');
+
+function connect(contextGroup, num) {
+ var session = contextGroup.connect();
+ var executionContextId;
+ session.Protocol.Runtime.onExecutionContextCreated(message => {
+ InspectorTest.log('From session ' + num);
+ InspectorTest.logMessage(message);
+ executionContextId = message.params.context.id;
+ });
+ session.Protocol.Runtime.onExecutionContextDestroyed(message => {
+ InspectorTest.log('From session ' + num);
+ InspectorTest.logMessage(message);
+ InspectorTest.log('id matching: ' + (message.params.executionContextId === executionContextId));
+ });
+ return session;
+}
+
+(async function test() {
+ var contextGroup = new InspectorTest.ContextGroup();
+ InspectorTest.log('Connecting session 1');
+ var session1 = connect(contextGroup, 1);
+ await session1.Protocol.Runtime.enable();
+
+ InspectorTest.log('Connecting session 2');
+ var session2 = connect(contextGroup, 2);
+ await session2.Protocol.Runtime.enable();
+
+ InspectorTest.log('Reconnecting session 2');
+ session2.reconnect();
+ await session2.Protocol.Runtime.enable();
+
+ InspectorTest.log('Reconnecting session 1');
+ session1.reconnect();
+ await session1.Protocol.Runtime.enable();
+
+ InspectorTest.log('Connecting session 3');
+ var session3 = connect(contextGroup, 3);
+ await session3.Protocol.Runtime.enable();
+
+ InspectorTest.log('Destroying and creating context');
+ await session2.Protocol.Runtime.evaluate({expression: 'inspector.fireContextDestroyed(); inspector.fireContextCreated(); '});
+
+ InspectorTest.log('Disconnecting all sessions');
+ session1.disconnect();
+ session2.disconnect();
+ session3.disconnect();
+
+ InspectorTest.log('Connecting session 4');
+ var session4 = connect(contextGroup, 4);
+ await session4.Protocol.Runtime.enable();
+
+ InspectorTest.completeTest();
+})();
« no previous file with comments | « test/inspector/isolate-data.cc ('k') | test/inspector/sessions/create-session-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698