OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2015 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2015 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/base/assert_utils.html"> | 8 <link rel="import" href="/tracing/base/assert_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/value/histogram.html"> | 10 <link rel="import" href="/tracing/value/histogram.html"> |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 h.addSample(100); | 230 h.addSample(100); |
231 h.addSample(100); | 231 h.addSample(100); |
232 h.addSample(25); | 232 h.addSample(25); |
233 h.addSample(50); | 233 h.addSample(50); |
234 h.addSample(75); | 234 h.addSample(75); |
235 const span = document.createElement('tr-v-ui-histogram-span'); | 235 const span = document.createElement('tr-v-ui-histogram-span'); |
236 this.addHTMLOutput(span); | 236 this.addHTMLOutput(span); |
237 span.histogram = h; | 237 span.histogram = h; |
238 }); | 238 }); |
239 | 239 |
| 240 test('referenceHistogram', function() { |
| 241 const span = document.createElement('tr-v-ui-histogram-span'); |
| 242 span.histogram = tr.v.Histogram.create('', tr.b.Unit.byName.unitlessNumber, |
| 243 [1, 10, 100], { |
| 244 binBoundaries: tr.v.HistogramBinBoundaries.SINGULAR, |
| 245 }); |
| 246 span.referenceHistogram = tr.v.Histogram.create('', |
| 247 tr.b.Unit.byName.unitlessNumber, [2, 20, 200], { |
| 248 binBoundaries: tr.v.HistogramBinBoundaries.SINGULAR, |
| 249 }); |
| 250 this.addHTMLOutput(span); |
| 251 }); |
| 252 |
240 test('breakdownUnit', async function() { | 253 test('breakdownUnit', async function() { |
241 const root = new tr.v.Histogram('root', tr.b.Unit.byName.sizeInBytes); | 254 const root = new tr.v.Histogram('root', tr.b.Unit.byName.sizeInBytes); |
242 const sampleBreakdown = new tr.v.d.Breakdown(); | 255 const sampleBreakdown = new tr.v.d.Breakdown(); |
243 sampleBreakdown.set('x', 30 << 20); | 256 sampleBreakdown.set('x', 30 << 20); |
244 sampleBreakdown.set('y', 70 << 20); | 257 sampleBreakdown.set('y', 70 << 20); |
245 root.addSample(100 << 20, {sampleBreakdown}); | 258 root.addSample(100 << 20, {sampleBreakdown}); |
246 const rhb = new tr.v.d.RelatedHistogramBreakdown(); | 259 const rhb = new tr.v.d.RelatedHistogramBreakdown(); |
247 root.diagnostics.set('rhb', rhb); | 260 root.diagnostics.set('rhb', rhb); |
248 const aHist = new tr.v.Histogram('a', tr.b.Unit.byName.sizeInBytes); | 261 const aHist = new tr.v.Histogram('a', tr.b.Unit.byName.sizeInBytes); |
249 rhb.set('a', aHist); | 262 rhb.set('a', aHist); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 await tr.b.animationFrame(); | 314 await tr.b.animationFrame(); |
302 assert.strictEqual(tabs.selectedSubView, sample); | 315 assert.strictEqual(tabs.selectedSubView, sample); |
303 | 316 |
304 const metadata = tr.ui.b.findDeepElementMatching( | 317 const metadata = tr.ui.b.findDeepElementMatching( |
305 span, '#metadata_diagnostics'); | 318 span, '#metadata_diagnostics'); |
306 await span.rowState.update({diagnosticsTab: metadata.tabLabel}); | 319 await span.rowState.update({diagnosticsTab: metadata.tabLabel}); |
307 assert.strictEqual(tabs.selectedSubView, metadata); | 320 assert.strictEqual(tabs.selectedSubView, metadata); |
308 }); | 321 }); |
309 }); | 322 }); |
310 </script> | 323 </script> |
OLD | NEW |