Fix console time format error

There should be a space between the quantity and the unit symbol
as per the SI, so this commit fixes this issue.

Change-Id: I3356942391d96906f3e3840c7bb802e10f29eb4a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2190230
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67789}
This commit is contained in:
Varun Varada 2020-05-08 19:35:12 -05:00 committed by Commit Bot
parent 288b545ad0
commit a25dce8a05
7 changed files with 44 additions and 43 deletions

View File

@ -196,6 +196,7 @@ Tobias Burnus <burnus@net-b.de>
Tobias Nießen <tniessen@tnie.de>
Ujjwal Sharma <usharma1998@gmail.com>
Vadim Gorbachev <bmsdave@gmail.com>
Varun Varada <varuncvarada@gmail.com>
Victor Costan <costan@gmail.com>
Vlad Burlik <vladbph@gmail.com>
Vladimir Krivosheev <develar@gmail.com>

View File

@ -411,7 +411,7 @@ static void timeEndFunction(const v8::debug::ConsoleCallArguments& info,
helper.consoleMessageStorage()->timeEnd(helper.contextId(), title);
}
String16 message =
protocolTitle + ": " + String16::fromDouble(elapsed) + "ms";
protocolTitle + ": " + String16::fromDouble(elapsed) + " ms";
if (timeLog)
helper.reportCallAndReplaceFirstArgument(ConsoleAPIType::kLog, message);
else

View File

@ -1,37 +1,37 @@
Checks format of console.timeEnd output
Running test: zero
js: 0ms
timeEnd: 0ms
js: 0 ms
timeEnd: 0 ms
Running test: verySmall
js: 1e-15ms
timeEnd: 1e-15ms
js: 1e-15 ms
timeEnd: 1e-15 ms
Running test: small
js: 0.001ms
timeEnd: 0.001ms
js: 0.001 ms
timeEnd: 0.001 ms
Running test: regular
js: 1.2345ms
timeEnd: 1.2345ms
js: 1.2345 ms
timeEnd: 1.2345 ms
Running test: big
js: 10000.2345ms
timeEnd: 10000.2345ms
js: 10000.2345 ms
timeEnd: 10000.2345 ms
Running test: veryBig
js: 1000000000000000.2ms
timeEnd: 1000000000000000.2ms
js: 1000000000000000.2 ms
timeEnd: 1000000000000000.2 ms
Running test: huge
js: 1e+42ms
timeEnd: 1e+42ms
js: 1e+42 ms
timeEnd: 1e+42 ms
Running test: undefinedAsLabel
js: 1ms
default: 1ms
js: 1 ms
default: 1 ms
Running test: emptyAsLabel
js: 1ms
default: 1ms
js: 1 ms
default: 1 ms

View File

@ -43,7 +43,7 @@ async function checkInterval(time, label) {
label = label === undefined ? '\'timeEnd\'' : label;
utils.setCurrentTimeMSForTest(0.0);
Protocol.Runtime.evaluate({
expression: `console.log('js: ' + ${time} + 'ms')`
expression: `console.log('js: ' + ${time} + ' ms')`
});
await Protocol.Runtime.evaluate({expression: `console.time(${label})`});
utils.setCurrentTimeMSForTest(time);

View File

@ -2,7 +2,7 @@ Test for console.timeLog
[
[0] : {
type : string
value : 42: 1ms
value : 42: 1 ms
}
[1] : {
type : string
@ -12,7 +12,7 @@ Test for console.timeLog
[
[0] : {
type : string
value : 42: 2ms
value : 42: 2 ms
}
[1] : {
type : string
@ -26,7 +26,7 @@ Test for console.timeLog
[
[0] : {
type : string
value : 42: 3ms
value : 42: 3 ms
}
]
[

View File

@ -30,7 +30,7 @@ Checks that repeated console.time do not reset
args : [
[0] : {
type : string
value : a: 2ms
value : a: 2 ms
}
]
executionContextId : <executionContextId>

View File

@ -36,7 +36,7 @@ set locale to fr_CA.UTF-8 (has comma as separator)
args : [
[0] : {
type : string
value : a: 0.001ms
value : a: 0.001 ms
}
]
executionContextId : <executionContextId>
@ -119,7 +119,7 @@ set locale to fr_CA.UTF-8 (has comma as separator)
args : [
[0] : {
type : string
value : a: 0.001ms
value : a: 0.001 ms
}
]
executionContextId : <executionContextId>