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

Side by Side Diff: tracing/tracing/value/ui/composition_span_test.html

Issue 2293533002: Refactor NumericBuilder to HistogramBinBoundaries. (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: rebase Created 4 years, 3 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/value/numeric.html ('k') | tracing/tracing/value/ui/histogram_span_test.html » ('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/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 var TEST_NUMERIC_BUILDER = tr.v.NumericBuilder.createLinear(
19 tr.v.Unit.byName.timeDurationInMs, tr.b.Range.fromExplicitRange(0, 1),
20 20);
21
22 test('instantiate_Composition', function() { 18 test('instantiate_Composition', function() {
23 var numeric = TEST_NUMERIC_BUILDER.build(); 19 var numeric = new tr.v.Histogram(tr.v.Unit.byName.timeDurationInMs);
24 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);
25 for (var i = 0; i < 1e2; ++i) { 21 for (var i = 0; i < 1e2; ++i) {
26 numeric.add(Math.random()); 22 numeric.add(Math.random());
27 } 23 }
28 var composition = new tr.v.d.Composition(); 24 var composition = new tr.v.d.Composition();
29 composition.add(new tr.v.NumericValue('numeric', numeric)); 25 composition.add(new tr.v.NumericValue('numeric', numeric));
30 composition.add(new tr.v.NumericValue('scalar', scalar)); 26 composition.add(new tr.v.NumericValue('scalar', scalar));
31 var span = tr.v.ui.createDiagnosticSpan(composition); 27 var span = tr.v.ui.createDiagnosticSpan(composition);
32 assert.strictEqual('TR-V-UI-COMPOSITION-SPAN', span.tagName); 28 assert.strictEqual('TR-V-UI-COMPOSITION-SPAN', span.tagName);
33 this.addHTMLOutput(span); 29 this.addHTMLOutput(span);
34 }); 30 });
35 }); 31 });
36 </script> 32 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/value/numeric.html ('k') | tracing/tracing/value/ui/histogram_span_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698