Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: test/inspector/runtime/console-time-end-format.js

Issue 2631553003: [inspector] console.timeEnd formats ms in the same way as JS formats double (Closed)
Patch Set: fixed protocol-works-with-different-locale test Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/inspector/inspector-test.cc ('k') | test/inspector/runtime/console-time-end-format-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/runtime/console-time-end-format.js
diff --git a/test/inspector/runtime/console-time-end-format.js b/test/inspector/runtime/console-time-end-format.js
new file mode 100644
index 0000000000000000000000000000000000000000..77e7b55831e5f9a991ca5ba38e18bbdd6d17a79c
--- /dev/null
+++ b/test/inspector/runtime/console-time-end-format.js
@@ -0,0 +1,45 @@
+// Copyright 2017 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+print('Checks format of console.timeEnd output');
+
+Protocol.Runtime.enable();
+Protocol.Runtime.onConsoleAPICalled(message => {
+ InspectorTest.log(message.params.args[0].value);
+});
+
+InspectorTest.runTestSuite([
+ function zero(next) {
+ checkInterval(0.0).then(next);
+ },
+ function verySmall(next) {
+ checkInterval(1e-15).then(next);
+ },
+ function small(next) {
+ checkInterval(0.001).then(next);
+ },
+ function regular(next) {
+ checkInterval(1.2345).then(next);
+ },
+ function big(next) {
+ checkInterval(10000.2345).then(next);
+ },
+ function veryBig(next) {
+ checkInterval(1e+15 + 0.2345).then(next);
+ },
+ function huge(next) {
+ checkInterval(1e+42).then(next);
+ }
+]);
+
+function checkInterval(time) {
+ setCurrentTimeMSForTest(0.0);
+ return Protocol.Runtime.evaluate({
+ expression: `console.log('js: ' + ${time} + 'ms')`})
+ .then(() => Protocol.Runtime.evaluate({
+ expression: 'console.time(\'timeEnd\')'}))
+ .then(() => setCurrentTimeMSForTest(time))
+ .then(() => Protocol.Runtime.evaluate({
+ expression: 'console.timeEnd(\'timeEnd\')'}));
+}
« no previous file with comments | « test/inspector/inspector-test.cc ('k') | test/inspector/runtime/console-time-end-format-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698