Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: tracing/tracing/ui/side_panel/metrics_side_panel_test.html

Issue 2656493002: Register metric Histogram names. (Closed)
Patch Set: rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tracing/tracing/metrics/v8/v8_metrics.html ('k') | tracing/tracing_project.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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>
OLDNEW
« no previous file with comments | « tracing/tracing/metrics/v8/v8_metrics.html ('k') | tracing/tracing_project.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698