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

Side by Side Diff: tracing/tracing/value/ui/value_set_view_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
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/histogram.html"> 8 <link rel="import" href="/tracing/value/histogram.html">
9 <link rel="import" href="/tracing/value/ui/value_set_table.html"> 9 <link rel="import" href="/tracing/value/ui/value_set_table.html">
10 <link rel="import" href="/tracing/value/ui/value_set_view.html"> 10 <link rel="import" href="/tracing/value/ui/value_set_view.html">
11 <link rel="import" href="/tracing/value/value_set.html"> 11 <link rel="import" href="/tracing/value/value_set.html">
12 12
13 <script> 13 <script>
14 'use strict'; 14 'use strict';
15 15
16 tr.b.unittest.testSuite(function() { 16 tr.b.unittest.testSuite(function() {
17 var TEST_NUMERIC_BUILDER = tr.v.NumericBuilder.createLinear(
18 tr.v.Unit.byName.timeDurationInMs, tr.b.Range.fromExplicitRange(0, 1000),
19 20);
20
21 test('instantiate0', function() { 17 test('instantiate0', function() {
22 var view = document.createElement('tr-v-ui-value-set-view'); 18 var view = document.createElement('tr-v-ui-value-set-view');
23 var values = new tr.v.ValueSet(); 19 var values = new tr.v.ValueSet();
24 20
25 var numeric = TEST_NUMERIC_BUILDER.build(); 21 var numeric = new tr.v.Histogram(tr.v.Unit.byName.normalizedPercentage);
26 for (var i = 0; i < 1e2; ++i) { 22 for (var i = 0; i < 1e2; ++i) {
27 numeric.add(Math.random() * TEST_NUMERIC_BUILDER.maxBinBoundary); 23 numeric.add(Math.random());
28 } 24 }
29 var foo = new tr.v.NumericValue('foo', numeric, {description: 'bar'}); 25 var foo = new tr.v.NumericValue('foo', numeric, {description: 'bar'});
30 values.addValue(foo); 26 values.addValue(foo);
31 27
32 this.addHTMLOutput(view); 28 this.addHTMLOutput(view);
33 view.values = values; 29 view.values = values;
34 }); 30 });
35 }); 31 });
36 </script> 32 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/value/ui/value_set_table_test.html ('k') | tracing/tracing/value/value_set_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698