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 var TEST_NUMERIC_BUILDER = tr.v.NumericBuilder.createLinear( | |
16 tr.v.Unit.byName.timeDurationInMs, tr.b.Range.fromExplicitRange(0, 1000), | |
17 20); | |
18 | |
19 test('instantiate', function() { | 15 test('instantiate', function() { |
20 var span = document.createElement('tr-v-ui-numeric-stats-span'); | 16 var span = document.createElement('tr-v-ui-numeric-stats-span'); |
21 | 17 |
22 var numeric = TEST_NUMERIC_BUILDER.build(); | 18 var numeric = new tr.v.Histogram(tr.v.Unit.byName.count); |
23 for (var i = 0; i < 1e2; ++i) { | 19 for (var i = 0; i < 1e2; ++i) { |
24 numeric.add(Math.random() * 1000); | 20 numeric.add(Math.random() * 1000); |
25 } | 21 } |
26 | 22 |
27 numeric.add('foo'); | 23 numeric.add('foo'); |
28 numeric.customizeSummaryOptions({nans: true}); | 24 numeric.customizeSummaryOptions({nans: true}); |
29 | 25 |
30 span.numeric = numeric; | 26 span.numeric = numeric; |
31 this.addHTMLOutput(span); | 27 this.addHTMLOutput(span); |
32 }); | 28 }); |
33 }); | 29 }); |
34 </script> | 30 </script> |
OLD | NEW |