OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2016 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2016 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 <link rel="import" href="/tracing/base/running_statistics.html"> | 7 <link rel="import" href="/tracing/base/math/running_statistics.html"> |
8 <link rel="import" href="/tracing/base/statistics.html"> | 8 <link rel="import" href="/tracing/base/math/statistics.html"> |
9 <script> | 9 <script> |
10 'use strict'; | 10 'use strict'; |
11 | 11 |
12 tr.b.unittest.testSuite(function() { | 12 tr.b.unittest.testSuite(function() { |
13 var RunningStatistics = tr.b.RunningStatistics; | 13 var RunningStatistics = tr.b.math.RunningStatistics; |
14 var Statistics = tr.b.Statistics; | 14 var Statistics = tr.b.math.Statistics; |
15 | 15 |
16 function run(data) { | 16 function run(data) { |
17 var running = new RunningStatistics(); | 17 var running = new RunningStatistics(); |
18 data.forEach(x => running.add(x)); | 18 data.forEach(x => running.add(x)); |
19 return running; | 19 return running; |
20 } | 20 } |
21 | 21 |
22 test('sum', function() { | 22 test('sum', function() { |
23 var data; | 23 var data; |
24 data = []; | 24 data = []; |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 for (var field = 0; field < dict.length; ++field) { | 184 for (var field = 0; field < dict.length; ++field) { |
185 assert.closeTo(dict[field], cloneDict[field], 1e-6); | 185 assert.closeTo(dict[field], cloneDict[field], 1e-6); |
186 } | 186 } |
187 | 187 |
188 // You can change this number, but when you do, please explain in your CL | 188 // You can change this number, but when you do, please explain in your CL |
189 // description why it changed. | 189 // description why it changed. |
190 assert.strictEqual(32, JSON.stringify(dict).length); | 190 assert.strictEqual(32, JSON.stringify(dict).length); |
191 }); | 191 }); |
192 }); | 192 }); |
193 </script> | 193 </script> |
OLD | NEW |