OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2015 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2015 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/iteration_helpers.html"> | 8 <link rel="import" href="/tracing/base/iteration_helpers.html"> |
9 <link rel="import" | 9 <link rel="import" |
10 href="/tracing/ui/analysis/memory_dump_sub_view_test_utils.html"> | 10 href="/tracing/ui/analysis/memory_dump_sub_view_test_utils.html"> |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 else | 144 else |
145 assert.strictEqual(column.title, expectedTitle); | 145 assert.strictEqual(column.title, expectedTitle); |
146 assert.strictEqual(column.aggregationMode, expectedAggregationMode); | 146 assert.strictEqual(column.aggregationMode, expectedAggregationMode); |
147 assert.strictEqual(column.cell(testRow), expectedCell); | 147 assert.strictEqual(column.cell(testRow), expectedCell); |
148 assert.instanceOf(column, expectedType); | 148 assert.instanceOf(column, expectedType); |
149 } | 149 } |
150 | 150 |
151 function checkCellValue( | 151 function checkCellValue( |
152 test, value, expectedText, expectedColor, opt_expectedInfos) { | 152 test, value, expectedText, expectedColor, opt_expectedInfos) { |
153 var expectedInfos = opt_expectedInfos || []; | 153 var expectedInfos = opt_expectedInfos || []; |
154 assert.lengthOf(value.childNodes, 1 + expectedInfos.length); | 154 assert.lengthOf(Polymer.dom(value).childNodes, 1 + expectedInfos.length); |
155 assert.strictEqual(value.style.color, expectedColor); | 155 assert.strictEqual(value.style.color, expectedColor); |
156 if (typeof expectedText === 'string') | 156 if (typeof expectedText === 'string') |
157 assert.strictEqual(value.childNodes[0].textContent, expectedText); | 157 assert.strictEqual( |
| 158 Polymer.dom(value).childNodes[0].textContent, expectedText); |
158 else | 159 else |
159 expectedText(value.childNodes[0]); | 160 expectedText(Polymer.dom(value).childNodes[0]); |
160 for (var i = 0; i < expectedInfos.length; i++) { | 161 for (var i = 0; i < expectedInfos.length; i++) { |
161 var expectedInfo = expectedInfos[i]; | 162 var expectedInfo = expectedInfos[i]; |
162 var infoEl = value.childNodes[i + 1]; | 163 var infoEl = Polymer.dom(value).childNodes[i + 1]; |
163 assert.strictEqual(infoEl.textContent, expectedInfo.icon); | 164 assert.strictEqual(infoEl.textContent, expectedInfo.icon); |
164 assert.strictEqual(infoEl.title, expectedInfo.message); | 165 assert.strictEqual(infoEl.title, expectedInfo.message); |
165 assert.strictEqual(infoEl.style.color, expectedInfo.color || ''); | 166 assert.strictEqual(infoEl.style.color, expectedInfo.color || ''); |
166 } | 167 } |
167 test.addHTMLOutput(value); | 168 test.addHTMLOutput(value); |
168 } | 169 } |
169 | 170 |
170 function sizeSpanMatcher(expectedValue, opt_expectedIsDelta) { | 171 function sizeSpanMatcher(expectedValue, opt_expectedIsDelta) { |
171 return function(element) { | 172 return function(element) { |
172 assert.strictEqual(element.tagName, 'TR-V-UI-SCALAR-SPAN'); | 173 assert.strictEqual(element.tagName, 'TR-V-UI-SCALAR-SPAN'); |
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1196 }); | 1197 }); |
1197 assert.deepEqual(Object.keys(cells), ['a', 'b', 'd']); | 1198 assert.deepEqual(Object.keys(cells), ['a', 'b', 'd']); |
1198 checkSizeNumericFields( | 1199 checkSizeNumericFields( |
1199 cells.a, mockColumn, [9, undefined, undefined, undefined]); | 1200 cells.a, mockColumn, [9, undefined, undefined, undefined]); |
1200 checkSizeNumericFields(cells.b, mockColumn, [314, 159, undefined, 265]); | 1201 checkSizeNumericFields(cells.b, mockColumn, [314, 159, undefined, 265]); |
1201 checkSizeNumericFields( | 1202 checkSizeNumericFields( |
1202 cells.d, mockColumn, [undefined, undefined, undefined, 0]); | 1203 cells.d, mockColumn, [undefined, undefined, undefined, 0]); |
1203 }); | 1204 }); |
1204 }); | 1205 }); |
1205 </script> | 1206 </script> |
OLD | NEW |