OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2016 The Chromium Authors. All rights reserved. | 3 Copyright 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 | 7 |
8 <link rel="import" href="/tracing/value/histogram.html"> | 8 <link rel="import" href="/tracing/value/histogram.html"> |
9 <link rel="import" href="/tracing/value/ui/numeric_stats_span.html"> | 9 <link rel="import" href="/tracing/value/ui/numeric_stats_span.html"> |
10 | 10 |
11 <script> | 11 <script> |
12 'use strict'; | 12 'use strict'; |
13 | 13 |
14 tr.b.unittest.testSuite(function() { | 14 tr.b.unittest.testSuite(function() { |
15 test('instantiate', function() { | 15 test('instantiate', function() { |
16 var span = document.createElement('tr-v-ui-numeric-stats-span'); | 16 var span = document.createElement('tr-v-ui-numeric-stats-span'); |
17 | 17 |
18 var numeric = new tr.v.Histogram(tr.v.Unit.byName.count); | 18 var numeric = new tr.v.Histogram(tr.v.Unit.byName.count); |
19 for (var i = 0; i < 1e2; ++i) { | 19 for (var i = 0; i < 1e2; ++i) { |
20 numeric.add(Math.random() * 1000); | 20 numeric.addSample(Math.random() * 1000); |
21 } | 21 } |
22 | 22 |
23 numeric.add('foo'); | 23 numeric.addSample('foo'); |
24 numeric.customizeSummaryOptions({nans: true}); | 24 numeric.customizeSummaryOptions({nans: true}); |
25 | 25 |
26 span.numeric = numeric; | 26 span.numeric = numeric; |
27 this.addHTMLOutput(span); | 27 this.addHTMLOutput(span); |
28 }); | 28 }); |
29 }); | 29 }); |
30 </script> | 30 </script> |
OLD | NEW |