node/deps/v8/test/inspector/runtime/console-time-default.js
Michaël Zasso 9d7cd9b864
deps: update V8 to 12.8.374.13
PR-URL: https://github.com/nodejs/node/pull/54077
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2024-08-16 16:03:01 +02:00

44 lines
1.5 KiB
JavaScript

// Copyright 2024 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(
'Test for default label with console.time() and friends');
(async function test() {
await Protocol.Runtime.enable();
utils.setCurrentTimeMSForTest(0.0);
await Protocol.Runtime.evaluate({expression: `console.time(undefined)`});
utils.setCurrentTimeMSForTest(1.0);
await Promise.all([
Protocol.Runtime.evaluate({expression: `console.timeLog(undefined, 'a')`}),
Protocol.Runtime.onceConsoleAPICalled().then(logArgs),
]);
utils.setCurrentTimeMSForTest(2.0);
await Promise.all([
Protocol.Runtime.evaluate({expression: `console.timeEnd(undefined)`}),
Protocol.Runtime.onceConsoleAPICalled().then(logArgs),
]);
utils.setCurrentTimeMSForTest(3.0);
await Protocol.Runtime.evaluate({expression: `console.time()`});
utils.setCurrentTimeMSForTest(4.0);
await Promise.all([
Protocol.Runtime.evaluate({expression: `console.timeLog()`}),
Protocol.Runtime.onceConsoleAPICalled().then(logArgs),
]);
utils.setCurrentTimeMSForTest(5.0);
await Promise.all([
Protocol.Runtime.evaluate({expression: `console.timeEnd()`}),
Protocol.Runtime.onceConsoleAPICalled().then(logArgs),
]);
await Protocol.Runtime.disable();
InspectorTest.completeTest();
})()
function logArgs(message) {
InspectorTest.logMessage(message.params.args);
}