OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 print('Checks format of console.timeEnd output'); |
| 6 |
| 7 Protocol.Runtime.enable(); |
| 8 Protocol.Runtime.onConsoleAPICalled(message => { |
| 9 InspectorTest.log(message.params.args[0].value); |
| 10 }); |
| 11 |
| 12 InspectorTest.runTestSuite([ |
| 13 function zero(next) { |
| 14 checkInterval(0.0).then(next); |
| 15 }, |
| 16 function verySmall(next) { |
| 17 checkInterval(1e-15).then(next); |
| 18 }, |
| 19 function small(next) { |
| 20 checkInterval(0.001).then(next); |
| 21 }, |
| 22 function regular(next) { |
| 23 checkInterval(1.2345).then(next); |
| 24 }, |
| 25 function big(next) { |
| 26 checkInterval(10000.2345).then(next); |
| 27 }, |
| 28 function veryBig(next) { |
| 29 checkInterval(1e+15 + 0.2345).then(next); |
| 30 }, |
| 31 function huge(next) { |
| 32 checkInterval(1e+42).then(next); |
| 33 } |
| 34 ]); |
| 35 |
| 36 function checkInterval(time) { |
| 37 setCurrentTimeMSForTest(0.0); |
| 38 return Protocol.Runtime.evaluate({ |
| 39 expression: `console.log('js: ' + ${time} + 'ms')`}) |
| 40 .then(() => Protocol.Runtime.evaluate({ |
| 41 expression: 'console.time(\'timeEnd\')'})) |
| 42 .then(() => setCurrentTimeMSForTest(time)) |
| 43 .then(() => Protocol.Runtime.evaluate({ |
| 44 expression: 'console.timeEnd(\'timeEnd\')'})); |
| 45 } |
OLD | NEW |