blob: 833b927c160f883c878308b1231252ab4e009391 [file] [log] [blame]
Andrew Topef837fa2017-10-04 22:44:25 -07001// 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
5let {session, contextGroup, Protocol} = InspectorTest.start('Tests that protocol works with different locales');
6
7Protocol.Runtime.enable();
8
9Protocol.Runtime.onConsoleAPICalled(InspectorTest.logMessage);
10
11InspectorTest.runTestSuite([
12 function consoleLogWithDefaultLocale(next) {
13 Protocol.Runtime.evaluate({ expression: "console.log(239) "}).then(next);
14 },
15
16 function consoleTimeWithCommaAsSeparator(next) {
17 InspectorTest.log("set locale to fr_CA.UTF-8 (has comma as separator)");
18 utils.setlocale("fr_CA.UTF-8");
19 utils.setCurrentTimeMSForTest(0.0);
20 Protocol.Runtime.evaluate({ expression: "console.time(\"a\");"})
21 .then(() => utils.setCurrentTimeMSForTest(0.001))
22 .then(() => Protocol.Runtime.evaluate({ expression: "console.timeEnd(\"a\");"}))
23 .then(next);
24 },
25
26 function consoleLogWithCommaAsSeparator(next) {
27 InspectorTest.log("set locale to fr_CA.UTF-8 (has comma as separator)");
28 utils.setlocale("fr_CA.UTF-8");
29 Protocol.Runtime.evaluate({ expression: "console.log(239) "}).then(next);
30 },
31
32 function consoleTimeWithCommaAfterConsoleLog(next) {
33 InspectorTest.log("set locale to fr_CA.UTF-8 (has comma as separator)");
34 utils.setlocale("fr_CA.UTF-8");
35 Protocol.Runtime.evaluate({ expression: "console.log(239) "})
36 .then(() => utils.setCurrentTimeMSForTest(0.0))
37 .then(() => Protocol.Runtime.evaluate({ expression: "console.time(\"a\");"}))
38 .then(() => utils.setCurrentTimeMSForTest(0.001))
39 .then(() => Protocol.Runtime.evaluate({ expression: "console.timeEnd(\"a\");"}))
40 .then(next);
41 }
42]);