Commit a62322aa authored by kozyatinskiy's avatar kozyatinskiy Committed by Commit bot

[inspector] added missing test for console methods

- and removed ":" from the output of console.count without argument.

BUG=none
R=luoe@chromium.org,alph@chromium.org

Review-Url: https://codereview.chromium.org/2674583002
Cr-Commit-Position: refs/heads/master@{#42903}
parent 1b116567
......@@ -366,8 +366,10 @@ void V8Console::countCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
if (!helper.privateMap("V8Console#countMap").ToLocal(&countMap)) return;
int32_t count = helper.getIntFromMap(countMap, identifier, 0) + 1;
helper.setIntOnMap(countMap, identifier, count);
helper.reportCallWithArgument(ConsoleAPIType::kCount,
title + ": " + String16::fromInteger(count));
String16 countString = String16::fromInteger(count);
helper.reportCallWithArgument(
ConsoleAPIType::kCount,
title.isEmpty() ? countString : (title + ": " + countString));
}
void V8Console::assertCallback(
......
This diff is collapsed.
// 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.
print('Checks console methods');
InspectorTest.addScript(`
function testFunction() {
console.debug('debug');
console.error('error');
console.info('info');
console.log('log');
console.warn('warn');
console.dir('dir');
console.dirxml('dirxml');
console.table([[1,2],[3,4]]);
console.trace('trace');
console.trace();
console.group();
console.groupEnd();
console.groupCollapsed();
console.clear('clear');
console.clear();
console.count('count');
function foo() {
console.count();
}
foo();
foo();
}
//# sourceURL=test.js`, 7, 26);
Protocol.Runtime.onConsoleAPICalled(InspectorTest.logMessage);
Protocol.Runtime.enable();
Protocol.Runtime.evaluate({ expression: 'testFunction()' })
.then(InspectorTest.completeTest);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment