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

Unified Diff: test/inspector/sessions/runtime-evaluate.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
Index: test/inspector/sessions/runtime-evaluate.js
diff --git a/test/inspector/sessions/runtime-evaluate.js b/test/inspector/sessions/runtime-evaluate.js
new file mode 100644
index 0000000000000000000000000000000000000000..72ca178535cf0f1816f8d58c2d2a1e2997e7c97f
--- /dev/null
+++ b/test/inspector/sessions/runtime-evaluate.js
@@ -0,0 +1,25 @@
+// 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 multiple sessions share the context.');
+
+(async function test() {
+ var contextGroup = new InspectorTest.ContextGroup();
+ var session1 = contextGroup.connect();
+ var session2 = contextGroup.connect();
+
+ InspectorTest.log('Assigning in 1');
+ await session1.Protocol.Runtime.evaluate({expression: 'var a = 42;'});
+ InspectorTest.log('Evaluating in 2');
+ InspectorTest.logMessage(await session2.Protocol.Runtime.evaluate({expression: 'a'}));
+
+ InspectorTest.log('Awaiting in 1');
+ var promise = session1.Protocol.Runtime.evaluate({expression: 'var cb; new Promise(f => cb = f)', awaitPromise: true});
+ InspectorTest.log('Resolving in 2');
+ await session2.Protocol.Runtime.evaluate({expression: 'cb("foo")'});
+ InspectorTest.log('Should resolve in 1');
+ InspectorTest.logMessage(await promise);
+
+ InspectorTest.completeTest();
+})();
« no previous file with comments | « test/inspector/sessions/runtime-console-api-called-expected.txt ('k') | test/inspector/sessions/runtime-evaluate-exception.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698