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

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

Issue 2283213002: Rename Histogram.add() to addSample(). (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/base/utils.html"> 8 <link rel="import" href="/tracing/base/utils.html">
9 <link rel="import" href="/tracing/ui/base/deep_utils.html"> 9 <link rel="import" href="/tracing/ui/base/deep_utils.html">
10 <link rel="import" href="/tracing/value/histogram.html"> 10 <link rel="import" href="/tracing/value/histogram.html">
(...skipping 12 matching lines...) Expand all
23 row = row.subRows[index]; 23 row = row.subRows[index];
24 return row; 24 return row;
25 } 25 }
26 26
27 test('instantiate_1x1', function() { 27 test('instantiate_1x1', function() {
28 var table = document.createElement('tr-v-ui-value-set-table'); 28 var table = document.createElement('tr-v-ui-value-set-table');
29 var values = new tr.v.ValueSet(); 29 var values = new tr.v.ValueSet();
30 var numeric = new tr.v.Histogram( 30 var numeric = new tr.v.Histogram(
31 tr.v.Unit.byName.timeDurationInMs_smallerIsBetter, TEST_BOUNDARIES); 31 tr.v.Unit.byName.timeDurationInMs_smallerIsBetter, TEST_BOUNDARIES);
32 for (var i = 0; i < 100; ++i) 32 for (var i = 0; i < 100; ++i)
33 numeric.add(Math.random() * 1000); 33 numeric.addSample(Math.random() * 1000);
34 values.addValue(new tr.v.NumericValue('foo', numeric)); 34 values.addValue(new tr.v.NumericValue('foo', numeric));
35 table.values = values; 35 table.values = values;
36 this.addHTMLOutput(table); 36 this.addHTMLOutput(table);
37 var baseTable = tr.b.findDeepElementMatchingPredicate( 37 var baseTable = tr.b.findDeepElementMatchingPredicate(
38 table, elem => elem.tagName === 'TR-UI-B-TABLE'); 38 table, elem => elem.tagName === 'TR-UI-B-TABLE');
39 assert.strictEqual(baseTable.tableRows.length, 1); 39 assert.strictEqual(baseTable.tableRows.length, 1);
40 }); 40 });
41 41
42 // TODO(benjhayden): Test requestSelectionChange. 42 // TODO(benjhayden): Test requestSelectionChange.
43 // TODO(benjhayden): Test search keyup. 43 // TODO(benjhayden): Test search keyup.
44 44
45 test('instantiate_2x2', function() { 45 test('instantiate_2x2', function() {
46 var table = document.createElement('tr-v-ui-value-set-table'); 46 var table = document.createElement('tr-v-ui-value-set-table');
47 var values = new tr.v.ValueSet(); 47 var values = new tr.v.ValueSet();
48 48
49 var numeric0a = new tr.v.Histogram( 49 var numeric0a = new tr.v.Histogram(
50 tr.v.Unit.byName.timeDurationInMs_smallerIsBetter, TEST_BOUNDARIES); 50 tr.v.Unit.byName.timeDurationInMs_smallerIsBetter, TEST_BOUNDARIES);
51 for (var i = 0; i < 100; ++i) 51 for (var i = 0; i < 100; ++i)
52 numeric0a.add(Math.random() * 1000); 52 numeric0a.addSample(Math.random() * 1000);
53 var fooA = new tr.v.NumericValue('foo', numeric0a, { 53 var fooA = new tr.v.NumericValue('foo', numeric0a, {
54 description: 'they should have sent a poet' 54 description: 'they should have sent a poet'
55 }); 55 });
56 values.addValue(fooA); 56 values.addValue(fooA);
57 new tr.v.d.IterationInfo({ 57 new tr.v.d.IterationInfo({
58 label: 'iteration A', 58 label: 'iteration A',
59 benchmarkStartMs: new Date().getTime(), 59 benchmarkStartMs: new Date().getTime(),
60 }).addToValue(fooA); 60 }).addToValue(fooA);
61 61
62 var numeric1a = new tr.v.Histogram( 62 var numeric1a = new tr.v.Histogram(
63 tr.v.Unit.byName.timeDurationInMs_smallerIsBetter, TEST_BOUNDARIES); 63 tr.v.Unit.byName.timeDurationInMs_smallerIsBetter, TEST_BOUNDARIES);
64 for (var i = 0; i < 100; ++i) 64 for (var i = 0; i < 100; ++i)
65 numeric1a.add(Math.random() * 1000); 65 numeric1a.addSample(Math.random() * 1000);
66 var barA = new tr.v.NumericValue('bar', numeric1a, { 66 var barA = new tr.v.NumericValue('bar', numeric1a, {
67 description: 'indescribable' 67 description: 'indescribable'
68 }); 68 });
69 values.addValue(barA); 69 values.addValue(barA);
70 new tr.v.d.IterationInfo({ 70 new tr.v.d.IterationInfo({
71 label: 'iteration A', 71 label: 'iteration A',
72 benchmarkStartMs: new Date().getTime(), 72 benchmarkStartMs: new Date().getTime(),
73 }).addToValue(barA); 73 }).addToValue(barA);
74 74
75 var numeric0b = new tr.v.Histogram( 75 var numeric0b = new tr.v.Histogram(
76 tr.v.Unit.byName.timeDurationInMs_smallerIsBetter, TEST_BOUNDARIES); 76 tr.v.Unit.byName.timeDurationInMs_smallerIsBetter, TEST_BOUNDARIES);
77 for (var i = 0; i < 100; ++i) 77 for (var i = 0; i < 100; ++i)
78 numeric0b.add(Math.random() * 1000); 78 numeric0b.addSample(Math.random() * 1000);
79 var fooB = new tr.v.NumericValue('foo', numeric0b, { 79 var fooB = new tr.v.NumericValue('foo', numeric0b, {
80 description: 'they should have sent a poet' 80 description: 'they should have sent a poet'
81 }); 81 });
82 values.addValue(fooB); 82 values.addValue(fooB);
83 new tr.v.d.IterationInfo({ 83 new tr.v.d.IterationInfo({
84 label: 'iteration B', 84 label: 'iteration B',
85 benchmarkStartMs: new Date().getTime(), 85 benchmarkStartMs: new Date().getTime(),
86 }).addToValue(fooB); 86 }).addToValue(fooB);
87 87
88 var numeric1b = new tr.v.Histogram( 88 var numeric1b = new tr.v.Histogram(
89 tr.v.Unit.byName.timeDurationInMs_smallerIsBetter, TEST_BOUNDARIES); 89 tr.v.Unit.byName.timeDurationInMs_smallerIsBetter, TEST_BOUNDARIES);
90 for (var i = 0; i < 100; ++i) 90 for (var i = 0; i < 100; ++i)
91 numeric1b.add(Math.random() * 1000); 91 numeric1b.addSample(Math.random() * 1000);
92 var barB = new tr.v.NumericValue('bar', numeric1b, { 92 var barB = new tr.v.NumericValue('bar', numeric1b, {
93 description: 'indescribable' 93 description: 'indescribable'
94 }); 94 });
95 values.addValue(barB); 95 values.addValue(barB);
96 new tr.v.d.IterationInfo({ 96 new tr.v.d.IterationInfo({
97 label: 'iteration B', 97 label: 'iteration B',
98 benchmarkStartMs: new Date().getTime(), 98 benchmarkStartMs: new Date().getTime(),
99 }).addToValue(barB); 99 }).addToValue(barB);
100 100
101 table.values = values; 101 table.values = values;
(...skipping 25 matching lines...) Expand all
127 for (var storyName of storyNames) { 127 for (var storyName of storyNames) {
128 for (var startMs of starts) { 128 for (var startMs of starts) {
129 for (var storysetCounter = 0; storysetCounter < 2; 129 for (var storysetCounter = 0; storysetCounter < 2;
130 ++storysetCounter) { 130 ++storysetCounter) {
131 for (var storyCounter = 0; storyCounter < 2; ++storyCounter) { 131 for (var storyCounter = 0; storyCounter < 2; ++storyCounter) {
132 for (var label of labels) { 132 for (var label of labels) {
133 var numeric = new tr.v.Histogram( 133 var numeric = new tr.v.Histogram(
134 tr.v.Unit.byName.timeDurationInMs_smallerIsBetter, 134 tr.v.Unit.byName.timeDurationInMs_smallerIsBetter,
135 TEST_BOUNDARIES); 135 TEST_BOUNDARIES);
136 for (var i = 0; i < 100; ++i) 136 for (var i = 0; i < 100; ++i)
137 numeric.add(Math.random() * 1000); 137 numeric.addSample(Math.random() * 1000);
138 138
139 var value = new tr.v.NumericValue('foo', numeric); 139 var value = new tr.v.NumericValue('foo', numeric);
140 values.addValue(value); 140 values.addValue(value);
141 141
142 new tr.v.d.IterationInfo({ 142 new tr.v.d.IterationInfo({
143 storyGroupingKeys: { 143 storyGroupingKeys: {
144 storyGroupingKey0: storyGroupingKey0, 144 storyGroupingKey0: storyGroupingKey0,
145 storyGroupingKey1: storyGroupingKey1 145 storyGroupingKey1: storyGroupingKey1
146 }, 146 },
147 benchmarkName: benchmarkName, 147 benchmarkName: benchmarkName,
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 } 236 }
237 subRowPath.pop(); 237 subRowPath.pop();
238 } 238 }
239 subRowPath.pop(); 239 subRowPath.pop();
240 } 240 }
241 subRowPath.pop(); 241 subRowPath.pop();
242 } 242 }
243 }); 243 });
244 }); 244 });
245 </script> 245 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/value/ui/numeric_stats_span_test.html ('k') | tracing/tracing/value/ui/value_set_view_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698