Andrew Top | ef837fa | 2017-10-04 22:44:25 -0700 | [diff] [blame] | 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 | let {session, contextGroup, Protocol} = InspectorTest.start('Tests that protocol works with different locales'); |
| 6 | |
| 7 | Protocol.Runtime.enable(); |
| 8 | |
| 9 | Protocol.Runtime.onConsoleAPICalled(InspectorTest.logMessage); |
| 10 | |
| 11 | InspectorTest.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 | ]); |