summaryrefslogtreecommitdiff
path: root/deps/v8/test/inspector/runtime/stable-object-id.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/inspector/runtime/stable-object-id.js')
-rw-r--r--deps/v8/test/inspector/runtime/stable-object-id.js87
1 files changed, 0 insertions, 87 deletions
diff --git a/deps/v8/test/inspector/runtime/stable-object-id.js b/deps/v8/test/inspector/runtime/stable-object-id.js
deleted file mode 100644
index 944bae0d3a..0000000000
--- a/deps/v8/test/inspector/runtime/stable-object-id.js
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright 2018 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.
-
-let {session, contextGroup, Protocol} = InspectorTest.start(
- 'Checks that protocol returns the same RemoteObjectId for the same object');
-
-InspectorTest.runAsyncTestSuite([
- async function testGlobal() {
- const {result:{result:{objectId:firstId}}} =
- await Protocol.Runtime.evaluate({expression: 'this'});
- const firstStableId = await stableObjectId(firstId);
- const {result:{result:{objectId:secondId}}} =
- await Protocol.Runtime.evaluate({expression: 'this'});
- const secondStableId = await stableObjectId(secondId);
- InspectorTest.log(
- `Compare global evaluated twice: ${firstStableId === secondStableId}`);
- },
-
- async function testObject() {
- const {result:{result:{objectId:firstId}}} =
- await Protocol.Runtime.evaluate({expression: 'this.a = {}, this.a'});
- const firstStableId = await stableObjectId(firstId);
- const {result:{result:{objectId:secondId}}} =
- await Protocol.Runtime.evaluate({expression: 'this.a'});
- const secondStableId = await stableObjectId(secondId);
- InspectorTest.log(
- `Compare object evaluated twice: ${firstStableId === secondStableId}`);
- },
-
- async function testObjectInArray() {
- await Protocol.Runtime.evaluate({expression: 'this.b = [this.a, this.a]'});
- const {result:{result:{objectId:firstId}}} =
- await Protocol.Runtime.evaluate({expression: 'this.b[0]'});
- const firstStableId = await stableObjectId(firstId);
- const {result:{result:{objectId:secondId}}} =
- await Protocol.Runtime.evaluate({expression: 'this.b[1]'});
- const secondStableId = await stableObjectId(secondId);
- InspectorTest.log(
- `Compare first and second element: ${firstStableId === secondStableId}`);
- },
-
- async function testObjectOnPause() {
- const {result:{result:{objectId:globalId}}} =
- await Protocol.Runtime.evaluate({expression: 'this'});
- const globalStableId = await stableObjectId(globalId);
- const {result:{result:{objectId:aId}}} =
- await Protocol.Runtime.evaluate({expression: 'this.a'});
- const aStableId = await stableObjectId(aId);
- await Protocol.Debugger.enable();
- Protocol.Runtime.evaluate({expression: 'debugger'});
- const {params:{callFrames:[topFrame]}} =
- await Protocol.Debugger.oncePaused();
- const topFrameThisStableId = await stableObjectId(topFrame.this.objectId);
- InspectorTest.log(
- `Compare global and this: ${globalStableId === topFrameThisStableId}`);
-
- const {result:{result:{objectId:globalIdOnPause}}} =
- await Protocol.Debugger.evaluateOnCallFrame({
- callFrameId: topFrame.callFrameId,
- expression: 'this'
- });
- const globalStableIdOnPause = await stableObjectId(globalIdOnPause);
- InspectorTest.log(
- `Compare global and global on pause: ${
- globalStableId === globalStableIdOnPause}`);
-
- const {result:{result: props}} = await Protocol.Runtime.getProperties({
- objectId: topFrame.scopeChain[0].object.objectId
- });
- const {value:{objectId: aIdOnPause}} = props.find(prop => prop.name === 'a');
- const aStableIdOnPause = await stableObjectId(aIdOnPause);
- InspectorTest.log(`Compare a and a on pause: ${
- aStableId === aStableIdOnPause}`);
- }
-]);
-
-async function stableObjectId(objectId) {
- const {result:{
- internalProperties: props
- }} = await Protocol.Runtime.getProperties({
- objectId,
- ownProperties: true,
- generatePreview: false
- });
- return props.find(prop => prop.name === '[[StableObjectId]]').value.value;
-}