Chromium Code Reviews

Side by Side Diff: test/inspector/runtime/protocol-works-with-different-locale.js

Issue 2410933002: [inspector] fix timestamp formatting with non C locales (Closed)
Patch Set: using stringstream Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 Protocol.Runtime.enable();
6
7 Protocol.Runtime.onConsoleAPICalled(dumpConsoleApiCalled);
8
9 InspectorTest.runTestSuite([
10 function consoleLogWithDefaultLocale(next) {
11 Protocol.Runtime.evaluate({ expression: "console.log(239) "}).then(next);
12 },
13
14 function consoleTimeWithCommaAsSeparator(next) {
15 InspectorTest.log("set locale to fr_CA.UTF-8 (has comma as separator)");
16 setlocale("fr_CA.UTF-8");
17 Protocol.Runtime.evaluate({ expression: "console.time(\"a\"); console.timeEn d(\"a\")"}).then(next);
18 },
19
20 function consoleLogWithCommaAsSeparator(next) {
21 InspectorTest.log("set locale to fr_CA.UTF-8 (has comma as separator)");
22 setlocale("fr_CA.UTF-8");
23 Protocol.Runtime.evaluate({ expression: "console.log(239) "}).then(next);
24 },
25
26 function consoleTimeWithCommaAfterConsoleLog(next) {
27 InspectorTest.log("set locale to fr_CA.UTF-8 (has comma as separator)");
28 setlocale("fr_CA.UTF-8");
29 Protocol.Runtime.evaluate({ expression: "console.log(239) "})
30 .then(() => Protocol.Runtime.evaluate({ expression: "console.time(\"a\"); console.timeEnd(\"a\")"}))
31 .then(next);
32 }
33 ]);
34
35 function dumpConsoleApiCalled(message)
36 {
dgozman 2016/10/11 21:03:35 { on next line
kozy 2016/10/11 22:26:15 Done.
37 var firstArg = message.params.args[0];
38 if (firstArg.type === "string")
39 firstArg.value = firstArg.value.replace(/[0-9]+/g, "x");
40 InspectorTest.logMessage(message);
41 }
OLDNEW

Powered by Google App Engine