| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 Protocol.Runtime.enable(); | 5 Protocol.Runtime.enable(); |
| 6 | 6 |
| 7 Protocol.Runtime.onConsoleAPICalled(dumpConsoleApiCalled); | 7 Protocol.Runtime.onConsoleAPICalled(InspectorTest.logMessage); |
| 8 | 8 |
| 9 InspectorTest.runTestSuite([ | 9 InspectorTest.runTestSuite([ |
| 10 function consoleLogWithDefaultLocale(next) { | 10 function consoleLogWithDefaultLocale(next) { |
| 11 Protocol.Runtime.evaluate({ expression: "console.log(239) "}).then(next); | 11 Protocol.Runtime.evaluate({ expression: "console.log(239) "}).then(next); |
| 12 }, | 12 }, |
| 13 | 13 |
| 14 function consoleTimeWithCommaAsSeparator(next) { | 14 function consoleTimeWithCommaAsSeparator(next) { |
| 15 InspectorTest.log("set locale to fr_CA.UTF-8 (has comma as separator)"); | 15 InspectorTest.log("set locale to fr_CA.UTF-8 (has comma as separator)"); |
| 16 setlocale("fr_CA.UTF-8"); | 16 setlocale("fr_CA.UTF-8"); |
| 17 Protocol.Runtime.evaluate({ expression: "console.time(\"a\"); console.timeEn
d(\"a\")"}).then(next); | 17 setCurrentTimeMSForTest(0.0); |
| 18 Protocol.Runtime.evaluate({ expression: "console.time(\"a\");"}) |
| 19 .then(() => setCurrentTimeMSForTest(0.001)) |
| 20 .then(() => Protocol.Runtime.evaluate({ expression: "console.timeEnd(\"a\"
);"})) |
| 21 .then(next); |
| 18 }, | 22 }, |
| 19 | 23 |
| 20 function consoleLogWithCommaAsSeparator(next) { | 24 function consoleLogWithCommaAsSeparator(next) { |
| 21 InspectorTest.log("set locale to fr_CA.UTF-8 (has comma as separator)"); | 25 InspectorTest.log("set locale to fr_CA.UTF-8 (has comma as separator)"); |
| 22 setlocale("fr_CA.UTF-8"); | 26 setlocale("fr_CA.UTF-8"); |
| 23 Protocol.Runtime.evaluate({ expression: "console.log(239) "}).then(next); | 27 Protocol.Runtime.evaluate({ expression: "console.log(239) "}).then(next); |
| 24 }, | 28 }, |
| 25 | 29 |
| 26 function consoleTimeWithCommaAfterConsoleLog(next) { | 30 function consoleTimeWithCommaAfterConsoleLog(next) { |
| 27 InspectorTest.log("set locale to fr_CA.UTF-8 (has comma as separator)"); | 31 InspectorTest.log("set locale to fr_CA.UTF-8 (has comma as separator)"); |
| 28 setlocale("fr_CA.UTF-8"); | 32 setlocale("fr_CA.UTF-8"); |
| 29 Protocol.Runtime.evaluate({ expression: "console.log(239) "}) | 33 Protocol.Runtime.evaluate({ expression: "console.log(239) "}) |
| 30 .then(() => Protocol.Runtime.evaluate({ expression: "console.time(\"a\");
console.timeEnd(\"a\")"})) | 34 .then(() => setCurrentTimeMSForTest(0.0)) |
| 35 .then(() => Protocol.Runtime.evaluate({ expression: "console.time(\"a\");"
})) |
| 36 .then(() => setCurrentTimeMSForTest(0.001)) |
| 37 .then(() => Protocol.Runtime.evaluate({ expression: "console.timeEnd(\"a\"
);"})) |
| 31 .then(next); | 38 .then(next); |
| 32 } | 39 } |
| 33 ]); | 40 ]); |
| 34 | |
| 35 function dumpConsoleApiCalled(message) { | |
| 36 var firstArg = message.params.args[0]; | |
| 37 if (firstArg.type === "string") | |
| 38 firstArg.value = firstArg.value.replace(/[0-9]+/g, "x"); | |
| 39 InspectorTest.logMessage(message); | |
| 40 } | |
| OLD | NEW |