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/core/test_utils.html"> | 8 <link rel="import" href="/tracing/core/test_utils.html"> |
9 <link rel="import" href="/tracing/ui/base/deep_utils.html"> | 9 <link rel="import" href="/tracing/ui/base/deep_utils.html"> |
10 <link rel="import" href="/tracing/ui/side_panel/metrics_side_panel.html"> | 10 <link rel="import" href="/tracing/ui/side_panel/metrics_side_panel.html"> |
(...skipping 17 matching lines...) Expand all Loading... |
28 }); | 28 }); |
29 return m; | 29 return m; |
30 } | 30 } |
31 | 31 |
32 function testMetric(values, model) { | 32 function testMetric(values, model) { |
33 var hist = new tr.v.Histogram('test histogram', tr.b.Unit.byName.count); | 33 var hist = new tr.v.Histogram('test histogram', tr.b.Unit.byName.count); |
34 hist.addSample(1); | 34 hist.addSample(1); |
35 values.addHistogram(hist); | 35 values.addHistogram(hist); |
36 } | 36 } |
37 | 37 |
38 tr.metrics.MetricRegistry.register(testMetric); | 38 tr.metrics.MetricRegistry.register(testMetric, { |
| 39 histogramNames: new Set(['test histogram']), |
| 40 }); |
39 | 41 |
40 test('instantiateCollapsed', function() { | 42 test('instantiateCollapsed', function() { |
41 var metricsPanel = document.createElement('tr-ui-sp-metrics-side-panel'); | 43 var metricsPanel = document.createElement('tr-ui-sp-metrics-side-panel'); |
42 metricsPanel.currentMetricName_ = 'testMetric'; | 44 metricsPanel.currentMetricName_ = 'testMetric'; |
43 metricsPanel.model = createModel(); | 45 metricsPanel.model = createModel(); |
44 this.addHTMLOutput(metricsPanel); | 46 this.addHTMLOutput(metricsPanel); |
45 | 47 |
46 assert.isDefined(tr.b.findDeepElementMatchingPredicate( | 48 assert.isDefined(tr.b.findDeepElementMatchingPredicate( |
47 metricsPanel, elem => elem.textContent === 'test histogram')); | 49 metricsPanel, elem => elem.textContent === 'test histogram')); |
48 }); | 50 }); |
49 }); | 51 }); |
50 </script> | 52 </script> |
OLD | NEW |