Commit d9806cec authored by Erik Luo's avatar Erik Luo Committed by Commit Bot

DevTools: also use default label for console.count

Aligns console.count() behavior with spec, which says the default label
should be "default" when the label provided is not defined.

Bug: chromium:700624
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ie58af210d300ef3151082b23187dd18e356f5de8
Reviewed-on: https://chromium-review.googlesource.com/780620
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: 's avatarAleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49804}
parent 3cfbcc72
......@@ -284,7 +284,7 @@ void V8Console::Clear(const v8::debug::ConsoleCallArguments& info,
void V8Console::Count(const v8::debug::ConsoleCallArguments& info,
const v8::debug::ConsoleContext& consoleContext) {
ConsoleHelper helper(info, consoleContext, m_inspector);
String16 title = helper.firstArgToString(String16());
String16 title = helper.firstArgToString(String16("default"), false);
String16 identifier;
if (title.isEmpty()) {
std::unique_ptr<V8StackTraceImpl> stackTrace =
......
......@@ -653,7 +653,7 @@ Checks console methods
args : [
[0] : {
type : string
value : 1
value : default: 1
}
]
executionContextId : <executionContextId>
......@@ -692,7 +692,7 @@ Checks console methods
args : [
[0] : {
type : string
value : 2
value : default: 2
}
]
executionContextId : <executionContextId>
......@@ -725,3 +725,99 @@ Checks console methods
type : count
}
}
{
method : Runtime.consoleAPICalled
params : {
args : [
[0] : {
type : string
value : default: 3
}
]
executionContextId : <executionContextId>
stackTrace : {
callFrames : [
[0] : {
columnNumber : 10
functionName : testFunction
lineNumber : 31
scriptId : <scriptId>
url : test.js
}
[1] : {
columnNumber : 0
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
}
]
}
timestamp : <timestamp>
type : count
}
}
{
method : Runtime.consoleAPICalled
params : {
args : [
[0] : {
type : string
value : default: 4
}
]
executionContextId : <executionContextId>
stackTrace : {
callFrames : [
[0] : {
columnNumber : 10
functionName : testFunction
lineNumber : 32
scriptId : <scriptId>
url : test.js
}
[1] : {
columnNumber : 0
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
}
]
}
timestamp : <timestamp>
type : count
}
}
{
method : Runtime.consoleAPICalled
params : {
args : [
[0] : {
type : string
value : default: 5
}
]
executionContextId : <executionContextId>
stackTrace : {
callFrames : [
[0] : {
columnNumber : 10
functionName : testFunction
lineNumber : 33
scriptId : <scriptId>
url : test.js
}
[1] : {
columnNumber : 0
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
}
]
}
timestamp : <timestamp>
type : count
}
}
......@@ -29,6 +29,9 @@ function testFunction() {
}
foo();
foo();
console.count();
console.count(undefined);
console.count('default');
}
//# sourceURL=test.js`, 7, 26);
......
......@@ -7,7 +7,7 @@ Running test: testThrowException
args : [
[0] : {
type : string
value : 1
value : default: 1
}
]
executionContextId : <executionContextId>
......
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