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

Unified Diff: test/inspector/sessions/runtime-remote-object.js

Issue 2916803005: [inspector] Create InjectedScript per session in each context (Closed)
Patch Set: rebased 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 side-by-side diff with in-line comments
Download patch
Index: test/inspector/sessions/runtime-remote-object.js
diff --git a/test/inspector/sessions/runtime-remote-object.js b/test/inspector/sessions/runtime-remote-object.js
new file mode 100644
index 0000000000000000000000000000000000000000..aaaccb41ba004b06460a8cfd62cf8c4c1d7874b1
--- /dev/null
+++ b/test/inspector/sessions/runtime-remote-object.js
@@ -0,0 +1,30 @@
+// 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 do not interfere with each other\'s remote objects.');
+
+(async function test() {
+ var contextGroup = new InspectorTest.ContextGroup();
+ var session1 = contextGroup.connect();
+ var session2 = contextGroup.connect();
+
+ InspectorTest.log('Evaluating in 1');
+ var result1 = await session1.Protocol.Runtime.evaluate({expression: '({a: 42})'});
+ InspectorTest.log('Evaluating in 2');
+ var result2 = await session2.Protocol.Runtime.evaluate({expression: '({a: 17})'});
+
+ await print(2, session2, result2);
+ await print(1, session1, result1);
+ InspectorTest.log('Disconnecting 2');
+ session2.disconnect();
+ await print(1, session1, result1);
+
+ InspectorTest.completeTest();
+})();
+
+async function print(num, session, message) {
+ InspectorTest.log('Retrieving properties in ' + num);
+ var objectId = message.result.result.objectId;
+ InspectorTest.logMessage(await session.Protocol.Runtime.getProperties({objectId, ownProperties: true}));
+}

Powered by Google App Engine
This is Rietveld 408576698