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/base/assert_utils.html"> | 8 <link rel="import" href="/tracing/base/assert_utils.html"> |
9 <link rel="import" href="/tracing/base/utils.html"> | 9 <link rel="import" href="/tracing/base/utils.html"> |
10 <link rel="import" href="/tracing/ui/base/deep_utils.html"> | 10 <link rel="import" href="/tracing/ui/base/deep_utils.html"> |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 await table.viewState.update({searchQuery: ''}); | 90 await table.viewState.update({searchQuery: ''}); |
91 cells = getTableCells(table); | 91 cells = getTableCells(table); |
92 assert.lengthOf(cells, 2); | 92 assert.lengthOf(cells, 2); |
93 }); | 93 }); |
94 | 94 |
95 test('controlSearchQuery', async function() { | 95 test('controlSearchQuery', async function() { |
96 const histograms = new tr.v.HistogramSet(); | 96 const histograms = new tr.v.HistogramSet(); |
97 const aHist = histograms.createHistogram('a', tr.b.Unit.byName.count, [1]); | 97 const aHist = histograms.createHistogram('a', tr.b.Unit.byName.count, [1]); |
98 const bHist = histograms.createHistogram('b', tr.b.Unit.byName.count, []); | 98 const bHist = histograms.createHistogram('b', tr.b.Unit.byName.count, []); |
99 const related = new tr.v.d.RelatedHistogramMap(); | 99 const related = new tr.v.d.Breakdown(); |
100 related.set('0', bHist); | 100 related.set('0', 0, bHist.name); |
101 aHist.diagnostics.set('r', related); | 101 aHist.addSample(0, new Map([['r', related]])); |
102 const table = await buildTable(this, histograms); | 102 const table = await buildTable(this, histograms); |
103 await table.viewState.tableRowStates.get('a').cells.get('Value').update( | 103 await table.viewState.tableRowStates.get('a').cells.get('Value').update( |
104 {isOpen: true}); | 104 {isOpen: true}); |
105 const link = tr.ui.b.findDeepElementMatchingPredicate( | 105 const link = tr.ui.b.findDeepElementMatchingPredicate( |
106 table, e => e.tagName === 'TR-UI-A-ANALYSIS-LINK'); | 106 table, e => e.tagName === 'TR-UI-A-ANALYSIS-LINK'); |
107 link.click(); | 107 link.click(); |
108 assert.strictEqual('^(b)$', table.viewState.searchQuery); | 108 assert.strictEqual('^(b)$', table.viewState.searchQuery); |
109 }); | 109 }); |
110 | 110 |
111 test('viewReferenceDisplayLabel', async function() { | 111 test('viewReferenceDisplayLabel', async function() { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 e.tagName === 'TR-V-UI-SCALAR-SPAN'); | 155 e.tagName === 'TR-V-UI-SCALAR-SPAN'); |
156 assert.lengthOf(scalarSpans, 2); | 156 assert.lengthOf(scalarSpans, 2); |
157 assert.strictEqual('3', scalarSpans[0].unit.format(scalarSpans[0].value)); | 157 assert.strictEqual('3', scalarSpans[0].unit.format(scalarSpans[0].value)); |
158 assert.strictEqual('3', scalarSpans[1].unit.format(scalarSpans[1].value)); | 158 assert.strictEqual('3', scalarSpans[1].unit.format(scalarSpans[1].value)); |
159 }); | 159 }); |
160 | 160 |
161 test('viewShowAll', async function() { | 161 test('viewShowAll', async function() { |
162 const histograms = new tr.v.HistogramSet(); | 162 const histograms = new tr.v.HistogramSet(); |
163 const aHist = histograms.createHistogram('a', tr.b.Unit.byName.count, [1]); | 163 const aHist = histograms.createHistogram('a', tr.b.Unit.byName.count, [1]); |
164 const bHist = histograms.createHistogram('b', tr.b.Unit.byName.count, []); | 164 const bHist = histograms.createHistogram('b', tr.b.Unit.byName.count, []); |
165 const related = new tr.v.d.RelatedHistogramMap(); | 165 const related = new tr.v.d.Breakdown(); |
166 related.set('0', bHist); | 166 related.set('r', 0, bHist.name); |
167 aHist.diagnostics.set('r', related); | 167 aHist.addSample(2, new Map([['r', related]])); |
168 const table = await buildTable(this, histograms); | 168 const table = await buildTable(this, histograms); |
169 | 169 |
170 let cells = getNameCells(table); | 170 let cells = getNameCells(table); |
171 assert.lengthOf(cells, 1); | 171 assert.lengthOf(cells, 1); |
172 assert.strictEqual('a', cells[0].row.name); | 172 assert.strictEqual('a', cells[0].row.name); |
173 | 173 |
174 await table.viewState.update({showAll: true}); | 174 await table.viewState.update({showAll: true}); |
175 cells = getNameCells(table); | 175 cells = getNameCells(table); |
176 assert.lengthOf(cells, 2); | 176 assert.lengthOf(cells, 2); |
177 assert.strictEqual('a', cells[0].row.name); | 177 assert.strictEqual('a', cells[0].row.name); |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 new tr.v.d.GenericSet(['bench' + j])], | 979 new tr.v.d.GenericSet(['bench' + j])], |
980 [tr.v.d.RESERVED_NAMES.STORIES, | 980 [tr.v.d.RESERVED_NAMES.STORIES, |
981 new tr.v.d.GenericSet(['story' + i])], | 981 new tr.v.d.GenericSet(['story' + i])], |
982 [tr.v.d.RESERVED_NAMES.LABELS, | 982 [tr.v.d.RESERVED_NAMES.LABELS, |
983 new tr.v.d.GenericSet(['Value'])], | 983 new tr.v.d.GenericSet(['Value'])], |
984 [tr.v.d.RESERVED_NAMES.BENCHMARK_START, | 984 [tr.v.d.RESERVED_NAMES.BENCHMARK_START, |
985 new tr.v.d.DateRange(benchmarkStartMs)], | 985 new tr.v.d.DateRange(benchmarkStartMs)], |
986 ]), | 986 ]), |
987 }); | 987 }); |
988 | 988 |
989 const breakdown = new tr.v.d.RelatedHistogramBreakdown(); | 989 const breakdown = new tr.v.d.Breakdown(); |
990 breakdown.add(aHist); | 990 breakdown.set('a', 1, aHist.name); |
991 breakdown.add(bHist); | 991 breakdown.set('b', 1, bHist.name); |
992 sourceHist.diagnostics.set('breakdown', breakdown); | 992 sourceHist.addSample(2, new Map([['breakdown', breakdown]])); |
993 } | 993 } |
994 } | 994 } |
995 | 995 |
996 const table = await buildTable(this, histograms); | 996 const table = await buildTable(this, histograms); |
997 }); | 997 }); |
998 | 998 |
999 test('sortByDisplayStatistic', async function() { | 999 test('sortByDisplayStatistic', async function() { |
1000 const histograms = new tr.v.HistogramSet(); | 1000 const histograms = new tr.v.HistogramSet(); |
1001 histograms.createHistogram( | 1001 histograms.createHistogram( |
1002 'bar', tr.b.Unit.byName.timeDurationInMs_smallerIsBetter, [0, 10], { | 1002 'bar', tr.b.Unit.byName.timeDurationInMs_smallerIsBetter, [0, 10], { |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 | 1164 |
1165 const fooHist = histograms.createHistogram( | 1165 const fooHist = histograms.createHistogram( |
1166 'foo', tr.b.Unit.byName.timeDurationInMs_smallerIsBetter, [1], { | 1166 'foo', tr.b.Unit.byName.timeDurationInMs_smallerIsBetter, [1], { |
1167 binBoundaries: TEST_BOUNDARIES, | 1167 binBoundaries: TEST_BOUNDARIES, |
1168 }); | 1168 }); |
1169 | 1169 |
1170 const quxHist = histograms.createHistogram( | 1170 const quxHist = histograms.createHistogram( |
1171 'qux', tr.b.Unit.byName.timeDurationInMs_smallerIsBetter, [], { | 1171 'qux', tr.b.Unit.byName.timeDurationInMs_smallerIsBetter, [], { |
1172 binBoundaries: TEST_BOUNDARIES, | 1172 binBoundaries: TEST_BOUNDARIES, |
1173 }); | 1173 }); |
1174 const breakdown = new tr.v.d.RelatedHistogramBreakdown(); | 1174 const breakdown = new tr.v.d.Breakdown(); |
1175 breakdown.set('bar', barHist); | 1175 breakdown.set('bar', 1, barHist.name); |
1176 breakdown.set('qux', quxHist); | 1176 breakdown.set('qux', 1, quxHist.name); |
1177 fooHist.diagnostics.set('breakdown', breakdown); | 1177 fooHist.addSample(2, new Map([['breakdown', breakdown]])); |
1178 | 1178 |
1179 const table = await buildTable(this, histograms); | 1179 const table = await buildTable(this, histograms); |
1180 | 1180 |
1181 let fooCell = tr.ui.b.findDeepElementMatchingPredicate( | 1181 let fooCell = tr.ui.b.findDeepElementMatchingPredicate( |
1182 table, elem => ( | 1182 table, elem => ( |
1183 (elem.tagName === 'TR-V-UI-HISTOGRAM-SET-TABLE-CELL') && | 1183 (elem.tagName === 'TR-V-UI-HISTOGRAM-SET-TABLE-CELL') && |
1184 (elem.histogram.name === 'foo'))); | 1184 (elem.histogram.name === 'foo'))); |
1185 assert.isDefined(fooCell); | 1185 assert.isDefined(fooCell); |
1186 | 1186 |
1187 let barCell = tr.ui.b.findDeepElementMatchingPredicate( | 1187 let barCell = tr.ui.b.findDeepElementMatchingPredicate( |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1675 } | 1675 } |
1676 subRowPath.pop(); | 1676 subRowPath.pop(); |
1677 } | 1677 } |
1678 subRowPath.pop(); | 1678 subRowPath.pop(); |
1679 } | 1679 } |
1680 subRowPath.pop(); | 1680 subRowPath.pop(); |
1681 } | 1681 } |
1682 }); | 1682 }); |
1683 }); | 1683 }); |
1684 </script> | 1684 </script> |
OLD | NEW |