PerformanceTests: Another build fix after r125178.
[WebKit-https.git] / LayoutTests / fast / harness / perftests / runs-per-second-log.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <p id="description">This test verifies PerfTestRunner.runPerSecond() outputs log as expected.</p>
5 <div id="console"></div>
6 <script src="../../../../PerformanceTests/resources/runner.js"></script>
7 <script type="text/javascript">
8
9 var logLines = [];
10 var initial = true;
11 var runs = 0;
12
13 PerfTestRunner._perSecondRunnerIterator = function (callsPerIteration) {
14     return 1000 / runs;
15 }
16
17 PerfTestRunner.storeHeapResults = function () { }
18
19 var printStatistics = PerfTestRunner.printStatistics;
20 PerfTestRunner.printStatistics = function (statistics) {
21     statistics.stdev = statistics.stdev.toPrecision(3);
22     return printStatistics.call(PerfTestRunner, statistics, 'Time:');
23 }
24
25 PerfTestRunner.runPerSecond({
26     setup: function () {
27         if (initial)
28             initial = false;
29         else
30             runs++;
31     },
32     run: function () { },
33     runCount: 5,
34     timeToRun: 500,
35 });
36
37 </script>
38 </body>
39 </html>