v8/test/inspector/heap-profiler/take-heap-snapshot-on-pause.js
kozyatinskiy ec36c513a3 [test/inspector] remove any usage of v8::Extension
.. replace all of them with prepared global object template.

+ bonus: wrap inspector related methods with inspector namespace.

BUG=none
R=dgozman@chromium.org

Review-Url: https://codereview.chromium.org/2832723004
Cr-Commit-Position: refs/heads/master@{#44785}
2017-04-21 23:41:07 +00:00

25 lines
800 B
JavaScript

// 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('Checks that takeHeapSnapshot uses empty accessing_context for access \
checks.');
InspectorTest.addScript(`
function testFunction() {
var array = [ inspector.createObjectWithStrictCheck() ];
debugger;
}
//# sourceURL=test.js`);
Protocol.Debugger.onScriptParsed(message => {
Protocol.HeapProfiler.takeHeapSnapshot({ reportProgress: false })
.then(() => Protocol.Debugger.resume());
});
Protocol.Debugger.enable();
Protocol.HeapProfiler.enable();
Protocol.Runtime.evaluate({ expression: 'testFunction()' })
.then(() => InspectorTest.log('Successfully finished'))
.then(InspectorTest.completeTest);