OLD | NEW |
(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 multiple sessions do not interfere with each other
\'s remote objects.'); |
| 6 |
| 7 (async function test() { |
| 8 var contextGroup = new InspectorTest.ContextGroup(); |
| 9 var session1 = contextGroup.connect(); |
| 10 var session2 = contextGroup.connect(); |
| 11 |
| 12 InspectorTest.log('Evaluating in 1'); |
| 13 var result1 = await session1.Protocol.Runtime.evaluate({expression: '({a: 42})
'}); |
| 14 InspectorTest.log('Evaluating in 2'); |
| 15 var result2 = await session2.Protocol.Runtime.evaluate({expression: '({a: 17})
'}); |
| 16 |
| 17 await print(2, session2, result2); |
| 18 await print(1, session1, result1); |
| 19 InspectorTest.log('Disconnecting 2'); |
| 20 session2.disconnect(); |
| 21 await print(1, session1, result1); |
| 22 |
| 23 InspectorTest.completeTest(); |
| 24 })(); |
| 25 |
| 26 async function print(num, session, message) { |
| 27 InspectorTest.log('Retrieving properties in ' + num); |
| 28 var objectId = message.result.result.objectId; |
| 29 InspectorTest.logMessage(await session.Protocol.Runtime.getProperties({objectI
d, ownProperties: true})); |
| 30 } |
OLD | NEW |