| 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 aHist.diagnostics.set('r', new tr.v.d.RelatedHistogramSet([bHist])); | 99 const related = new tr.v.d.RelatedHistogramMap(); |
| 100 related.set('0', bHist); |
| 101 aHist.diagnostics.set('r', related); |
| 100 const table = await buildTable(this, histograms); | 102 const table = await buildTable(this, histograms); |
| 101 await table.viewState.tableRowStates.get('a').cells.get('Value').update( | 103 await table.viewState.tableRowStates.get('a').cells.get('Value').update( |
| 102 {isOpen: true}); | 104 {isOpen: true}); |
| 103 const link = tr.ui.b.findDeepElementMatchingPredicate( | 105 const link = tr.ui.b.findDeepElementMatchingPredicate( |
| 104 table, e => e.tagName === 'TR-UI-A-ANALYSIS-LINK'); | 106 table, e => e.tagName === 'TR-UI-A-ANALYSIS-LINK'); |
| 105 link.click(); | 107 link.click(); |
| 106 assert.strictEqual('^(b)$', table.viewState.searchQuery); | 108 assert.strictEqual('^(b)$', table.viewState.searchQuery); |
| 107 }); | 109 }); |
| 108 | 110 |
| 109 test('viewReferenceDisplayLabel', async function() { | 111 test('viewReferenceDisplayLabel', async function() { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 e.tagName === 'TR-V-UI-SCALAR-SPAN'); | 159 e.tagName === 'TR-V-UI-SCALAR-SPAN'); |
| 158 assert.lengthOf(scalarSpans, 2); | 160 assert.lengthOf(scalarSpans, 2); |
| 159 assert.strictEqual('3', scalarSpans[0].unit.format(scalarSpans[0].value)); | 161 assert.strictEqual('3', scalarSpans[0].unit.format(scalarSpans[0].value)); |
| 160 assert.strictEqual('3', scalarSpans[1].unit.format(scalarSpans[1].value)); | 162 assert.strictEqual('3', scalarSpans[1].unit.format(scalarSpans[1].value)); |
| 161 }); | 163 }); |
| 162 | 164 |
| 163 test('viewShowAll', async function() { | 165 test('viewShowAll', async function() { |
| 164 const histograms = new tr.v.HistogramSet(); | 166 const histograms = new tr.v.HistogramSet(); |
| 165 const aHist = histograms.createHistogram('a', tr.b.Unit.byName.count, [1]); | 167 const aHist = histograms.createHistogram('a', tr.b.Unit.byName.count, [1]); |
| 166 const bHist = histograms.createHistogram('b', tr.b.Unit.byName.count, []); | 168 const bHist = histograms.createHistogram('b', tr.b.Unit.byName.count, []); |
| 167 aHist.diagnostics.set('r', new tr.v.d.RelatedHistogramSet([bHist])); | 169 const related = new tr.v.d.RelatedHistogramMap(); |
| 170 related.set('0', bHist); |
| 171 aHist.diagnostics.set('r', related); |
| 168 const table = await buildTable(this, histograms); | 172 const table = await buildTable(this, histograms); |
| 169 | 173 |
| 170 let cells = getNameCells(table); | 174 let cells = getNameCells(table); |
| 171 assert.lengthOf(cells, 1); | 175 assert.lengthOf(cells, 1); |
| 172 assert.strictEqual('a', cells[0].row.name); | 176 assert.strictEqual('a', cells[0].row.name); |
| 173 | 177 |
| 174 await table.viewState.update({showAll: true}); | 178 await table.viewState.update({showAll: true}); |
| 175 cells = getNameCells(table); | 179 cells = getNameCells(table); |
| 176 assert.lengthOf(cells, 2); | 180 assert.lengthOf(cells, 2); |
| 177 assert.strictEqual('a', cells[0].row.name); | 181 assert.strictEqual('a', cells[0].row.name); |
| (...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1692 } | 1696 } |
| 1693 subRowPath.pop(); | 1697 subRowPath.pop(); |
| 1694 } | 1698 } |
| 1695 subRowPath.pop(); | 1699 subRowPath.pop(); |
| 1696 } | 1700 } |
| 1697 subRowPath.pop(); | 1701 subRowPath.pop(); |
| 1698 } | 1702 } |
| 1699 }); | 1703 }); |
| 1700 }); | 1704 }); |
| 1701 </script> | 1705 </script> |
| OLD | NEW |