| <!DOCTYPE html> |
| <!-- |
| Copyright 2016 The Chromium Authors. All rights reserved. |
| Use of this source code is governed by a BSD-style license that can be |
| found in the LICENSE file. |
| --> |
| |
| <link rel="import" href="/tracing/value/diagnostics/related_value_map.html"> |
| <link rel="import" href="/tracing/value/histogram.html"> |
| <link rel="import" href="/tracing/value/ui/diagnostic_span.html"> |
| |
| <script> |
| 'use strict'; |
| |
| tr.b.unittest.testSuite(function() { |
| test('instantiate_RelatedValueMap', function() { |
| var aValue = new tr.v.Histogram('a', tr.b.Unit.byName.unitlessNumber); |
| var bValue = new tr.v.Histogram('b', tr.b.Unit.byName.unitlessNumber); |
| var diagnostic = new tr.v.d.RelatedValueMap(); |
| diagnostic.set('foo', aValue); |
| diagnostic.set('bar', bValue); |
| var span = tr.v.ui.createDiagnosticSpan(diagnostic); |
| assert.strictEqual('TR-V-UI-RELATED-VALUE-MAP-SPAN', span.tagName); |
| this.addHTMLOutput(span); |
| assert.isDefined(tr.b.findDeepElementMatchingPredicate( |
| span, function(element) { |
| return element.textContent === 'foo'; |
| })); |
| assert.isDefined(tr.b.findDeepElementMatchingPredicate( |
| span, function(element) { |
| return element.textContent === 'bar'; |
| })); |
| }); |
| }); |
| </script> |