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/value/diagnostics/composition.html"> | 8 <link rel="import" href="/tracing/value/diagnostics/composition.html"> |
9 <link rel="import" href="/tracing/value/histogram.html"> | 9 <link rel="import" href="/tracing/value/histogram.html"> |
10 <link rel="import" href="/tracing/value/ui/composition_span.html"> | 10 <link rel="import" href="/tracing/value/ui/composition_span.html"> |
11 <link rel="import" href="/tracing/value/ui/diagnostic_span.html"> | 11 <link rel="import" href="/tracing/value/ui/diagnostic_span.html"> |
12 <link rel="import" href="/tracing/value/value.html"> | 12 <link rel="import" href="/tracing/value/value.html"> |
13 | 13 |
14 <script> | 14 <script> |
15 'use strict'; | 15 'use strict'; |
16 | 16 |
17 tr.b.unittest.testSuite(function() { | 17 tr.b.unittest.testSuite(function() { |
18 test('instantiate_Composition', function() { | 18 test('instantiate_Composition', function() { |
19 var numeric = new tr.v.Histogram(tr.v.Unit.byName.timeDurationInMs); | 19 var numeric = new tr.v.Histogram(tr.v.Unit.byName.timeDurationInMs); |
20 var scalar = new tr.v.ScalarNumeric(tr.v.Unit.byName.timeDurationInMs, 42); | 20 var scalar = new tr.v.ScalarNumeric(tr.v.Unit.byName.timeDurationInMs, 42); |
21 for (var i = 0; i < 1e2; ++i) { | 21 for (var i = 0; i < 1e2; ++i) { |
22 numeric.add(Math.random()); | 22 numeric.addSample(Math.random()); |
23 } | 23 } |
24 var composition = new tr.v.d.Composition(); | 24 var composition = new tr.v.d.Composition(); |
25 composition.add(new tr.v.NumericValue('numeric', numeric)); | 25 composition.add(new tr.v.NumericValue('numeric', numeric)); |
26 composition.add(new tr.v.NumericValue('scalar', scalar)); | 26 composition.add(new tr.v.NumericValue('scalar', scalar)); |
27 var span = tr.v.ui.createDiagnosticSpan(composition); | 27 var span = tr.v.ui.createDiagnosticSpan(composition); |
28 assert.strictEqual('TR-V-UI-COMPOSITION-SPAN', span.tagName); | 28 assert.strictEqual('TR-V-UI-COMPOSITION-SPAN', span.tagName); |
29 this.addHTMLOutput(span); | 29 this.addHTMLOutput(span); |
30 }); | 30 }); |
31 }); | 31 }); |
32 </script> | 32 </script> |
OLD | NEW |