OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <!-- | |
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 | |
5 found in the LICENSE file. | |
6 --> | |
7 | |
8 <link rel="import" href="/tracing/value/diagnostics/related_histogram_map.html"> | |
9 <link rel="import" href="/tracing/value/histogram.html"> | |
10 <link rel="import" href="/tracing/value/ui/diagnostic_span.html"> | |
11 | |
12 <script> | |
13 'use strict'; | |
14 | |
15 tr.b.unittest.testSuite(function() { | |
16 test('instantiate_RelatedHistogramMap', function() { | |
17 const aHist = new tr.v.Histogram('a', tr.b.Unit.byName.timeDurationInMs); | |
18 const bHist = new tr.v.Histogram('b', tr.b.Unit.byName.timeDurationInMs); | |
19 aHist.addSample(1); | |
20 bHist.addSample(2); | |
21 const diagnostic = new tr.v.d.RelatedHistogramMap(); | |
22 diagnostic.set('foo', aHist); | |
23 diagnostic.set('bar', bHist); | |
24 const span = tr.v.ui.createDiagnosticSpan(diagnostic); | |
25 assert.strictEqual('TR-V-UI-RELATED-HISTOGRAM-MAP-SPAN', span.tagName); | |
26 this.addHTMLOutput(span); | |
27 assert.isDefined( | |
28 tr.ui.b.findDeepElementWithTextContent(span, /Select All/)); | |
29 assert.isDefined(tr.ui.b.findDeepElementWithTextContent(span, /foo/)); | |
30 assert.isDefined(tr.ui.b.findDeepElementWithTextContent(span, /bar/)); | |
31 assert.isDefined(tr.ui.b.findDeepElementWithTextContent(span, /1\.000 ms/)); | |
32 assert.isDefined(tr.ui.b.findDeepElementWithTextContent(span, /2\.000 ms/)); | |
33 }); | |
34 }); | |
35 </script> | |
OLD | NEW |