v8/test/inspector/runtime/get-heap-usage.js
Alexei Filippov 767b8edd9d [inspector] Add Runtime.getIsolateId & Runtime.getHeapUsage commands
BUG=chromium:823874

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I1df9347ead62dc84150f5549c29815600609c55b
Reviewed-on: https://chromium-review.googlesource.com/972181
Commit-Queue: Alexei Filippov <alph@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52085}
2018-03-20 23:33:53 +00:00

16 lines
602 B
JavaScript

// 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.
const {session, contextGroup, Protocol} = InspectorTest.start('Checks that Runtime.getHeapUsage works');
(async function test() {
const heapUsage = await Protocol.Runtime.getHeapUsage();
const usedSize = heapUsage.result["usedSize"];
const totalSize = heapUsage.result["totalSize"];
console.assert(usedSize > 0);
console.assert(totalSize > 0);
console.assert(totalSize >= usedSize);
InspectorTest.completeTest();
})();