OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2015 The Chromium Authors. All rights reserved. | 3 Copyright 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/utils.html"> | 8 <link rel="import" href="/tracing/base/utils.html"> |
9 <link rel="import" href="/tracing/model/event_set.html"> | 9 <link rel="import" href="/tracing/model/event_set.html"> |
10 <link rel="import" | 10 <link rel="import" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 checkAllocatorPane(undefined); | 155 checkAllocatorPane(undefined); |
156 | 156 |
157 // PSS of process 4. | 157 // PSS of process 4. |
158 overviewTableEl.selectedColumnIndex = 3; | 158 overviewTableEl.selectedColumnIndex = 3; |
159 overviewTableEl.selectedTableRow = overviewTableEl.tableRows[2]; | 159 overviewTableEl.selectedTableRow = overviewTableEl.tableRows[2]; |
160 checkVmRegionsPane(undefined); | 160 checkVmRegionsPane(undefined); |
161 checkAllocatorPane(undefined); | 161 checkAllocatorPane(undefined); |
162 | 162 |
163 // Malloc of process 2. | 163 // Malloc of process 2. |
164 overviewTableEl.selectedTableRow = overviewTableEl.tableRows[1]; | 164 overviewTableEl.selectedTableRow = overviewTableEl.tableRows[1]; |
165 overviewTableEl.selectedColumnIndex = 9; | 165 overviewTableEl.selectedColumnIndex = 10; |
166 checkVmRegionsPane(undefined); | 166 checkVmRegionsPane(undefined); |
167 checkAllocatorPane(2 /* PID */, 'malloc', | 167 checkAllocatorPane(2 /* PID */, 'malloc', |
168 false /* no heap details pane */); | 168 false /* no heap details pane */); |
169 }); | 169 }); |
170 }); | 170 }); |
171 | 171 |
172 test('instantiate_multipleGlobalMemoryDumps', function() { | 172 test('instantiate_multipleGlobalMemoryDumps', function() { |
173 createAndCheckContainerMemoryDumpView(this, | 173 createAndCheckContainerMemoryDumpView(this, |
174 tr.ui.analysis.createMultipleTestGlobalMemoryDumps(), | 174 tr.ui.analysis.createMultipleTestGlobalMemoryDumps(), |
175 function(overviewTableEl, checkVmRegionsPane, checkAllocatorPane) { | 175 function(overviewTableEl, checkVmRegionsPane, checkAllocatorPane) { |
176 // Nothing should be selected initially. | 176 // Nothing should be selected initially. |
177 assert.isUndefined(overviewTableEl.selectedTableRow); | 177 assert.isUndefined(overviewTableEl.selectedTableRow); |
178 assert.isUndefined(overviewTableEl.selectedColumnIndex); | 178 assert.isUndefined(overviewTableEl.selectedColumnIndex); |
179 checkVmRegionsPane(undefined); | 179 checkVmRegionsPane(undefined); |
180 checkAllocatorPane(undefined); | 180 checkAllocatorPane(undefined); |
181 | 181 |
182 // Blink of Process 1. | 182 // Blink of Process 1. |
183 overviewTableEl.selectedTableRow = overviewTableEl.tableRows[0]; | 183 overviewTableEl.selectedTableRow = overviewTableEl.tableRows[0]; |
184 overviewTableEl.selectedColumnIndex = 7; | 184 overviewTableEl.selectedColumnIndex = 8; |
185 checkVmRegionsPane(undefined); | 185 checkVmRegionsPane(undefined); |
186 checkAllocatorPane(undefined); | 186 checkAllocatorPane(undefined); |
187 | 187 |
188 // Peak total resident of Process 4. | 188 // Peak total resident of Process 4. |
189 overviewTableEl.selectedTableRow = overviewTableEl.tableRows[3]; | 189 overviewTableEl.selectedTableRow = overviewTableEl.tableRows[3]; |
190 overviewTableEl.selectedColumnIndex = 2; | 190 overviewTableEl.selectedColumnIndex = 2; |
191 checkVmRegionsPane(undefined); | 191 checkVmRegionsPane(undefined); |
192 checkAllocatorPane(undefined); | 192 checkAllocatorPane(undefined); |
193 | 193 |
194 // V8 of Process 3. | 194 // V8 of Process 3. |
195 overviewTableEl.selectedTableRow = overviewTableEl.tableRows[2]; | 195 overviewTableEl.selectedTableRow = overviewTableEl.tableRows[2]; |
196 overviewTableEl.selectedColumnIndex = 11; | 196 overviewTableEl.selectedColumnIndex = 12; |
197 checkVmRegionsPane(undefined); | 197 checkVmRegionsPane(undefined); |
198 checkAllocatorPane(3 /* PID */, 'v8', true /* heap details pane */); | 198 checkAllocatorPane(3 /* PID */, 'v8', true /* heap details pane */); |
199 }); | 199 }); |
200 }); | 200 }); |
201 | 201 |
202 test('instantiate_singleProcessMemoryDump', function() { | 202 test('instantiate_singleProcessMemoryDump', function() { |
203 createAndCheckContainerMemoryDumpView(this, | 203 createAndCheckContainerMemoryDumpView(this, |
204 [tr.ui.analysis.createSingleTestProcessMemoryDump()], | 204 [tr.ui.analysis.createSingleTestProcessMemoryDump()], |
205 function(overviewTableEl, checkVmRegionsPane, checkAllocatorPane) { | 205 function(overviewTableEl, checkVmRegionsPane, checkAllocatorPane) { |
206 // Nothing should be selected initially. | 206 // Nothing should be selected initially. |
207 assert.isUndefined(overviewTableEl.selectedTableRow); | 207 assert.isUndefined(overviewTableEl.selectedTableRow); |
208 assert.isUndefined(overviewTableEl.selectedColumnIndex); | 208 assert.isUndefined(overviewTableEl.selectedColumnIndex); |
209 checkVmRegionsPane(undefined); | 209 checkVmRegionsPane(undefined); |
210 checkAllocatorPane(undefined); | 210 checkAllocatorPane(undefined); |
211 | 211 |
212 // Tracing of Process 2. | 212 // Tracing of Process 2. |
213 overviewTableEl.selectedTableRow = overviewTableEl.tableRows[0]; | 213 overviewTableEl.selectedTableRow = overviewTableEl.tableRows[0]; |
214 overviewTableEl.selectedColumnIndex = 12; | 214 overviewTableEl.selectedColumnIndex = 13; |
215 checkVmRegionsPane(undefined); | 215 checkVmRegionsPane(undefined); |
216 checkAllocatorPane(2 /* PID */, 'tracing', | 216 checkAllocatorPane(2 /* PID */, 'tracing', |
217 false /* no heap details pane */); | 217 false /* no heap details pane */); |
218 | 218 |
219 // Blink of Process 2. | 219 // Blink of Process 2. |
220 overviewTableEl.selectedColumnIndex = 7; | 220 overviewTableEl.selectedColumnIndex = 8; |
221 checkVmRegionsPane(undefined); | 221 checkVmRegionsPane(undefined); |
222 checkAllocatorPane(2 /* PID */, 'blink', | 222 checkAllocatorPane(2 /* PID */, 'blink', |
223 false /* no heap details pane */); | 223 false /* no heap details pane */); |
224 | 224 |
225 // Total resident of Process 2. | 225 // Total resident of Process 2. |
226 overviewTableEl.selectedColumnIndex = 1; | 226 overviewTableEl.selectedColumnIndex = 1; |
227 checkVmRegionsPane(2 /* PID */); | 227 checkVmRegionsPane(2 /* PID */); |
228 checkAllocatorPane(undefined); | 228 checkAllocatorPane(undefined); |
229 }); | 229 }); |
230 }); | 230 }); |
231 | 231 |
232 test('instantiate_multipleProcessMemoryDumps', function() { | 232 test('instantiate_multipleProcessMemoryDumps', function() { |
233 createAndCheckContainerMemoryDumpView(this, | 233 createAndCheckContainerMemoryDumpView(this, |
234 tr.ui.analysis.createMultipleTestProcessMemoryDumps(), | 234 tr.ui.analysis.createMultipleTestProcessMemoryDumps(), |
235 function(overviewTableEl, checkVmRegionsPane, checkAllocatorPane) { | 235 function(overviewTableEl, checkVmRegionsPane, checkAllocatorPane) { |
236 // Nothing should be selected initially. | 236 // Nothing should be selected initially. |
237 assert.isUndefined(overviewTableEl.selectedTableRow); | 237 assert.isUndefined(overviewTableEl.selectedTableRow); |
238 assert.isUndefined(overviewTableEl.selectedColumnIndex); | 238 assert.isUndefined(overviewTableEl.selectedColumnIndex); |
239 checkVmRegionsPane(undefined); | 239 checkVmRegionsPane(undefined); |
240 checkAllocatorPane(undefined); | 240 checkAllocatorPane(undefined); |
241 | 241 |
242 // Tracing of Process 2. | 242 // Tracing of Process 2. |
243 overviewTableEl.selectedTableRow = overviewTableEl.tableRows[0]; | 243 overviewTableEl.selectedTableRow = overviewTableEl.tableRows[0]; |
244 overviewTableEl.selectedColumnIndex = 12; | 244 overviewTableEl.selectedColumnIndex = 13; |
245 checkVmRegionsPane(undefined); | 245 checkVmRegionsPane(undefined); |
246 checkAllocatorPane(2 /* PID */, 'tracing', | 246 checkAllocatorPane(2 /* PID */, 'tracing', |
247 false /* no heap details pane */); | 247 false /* no heap details pane */); |
248 | 248 |
249 // V8 of Process 2. | 249 // V8 of Process 2. |
250 overviewTableEl.selectedColumnIndex = 11; | 250 overviewTableEl.selectedColumnIndex = 12; |
251 checkVmRegionsPane(undefined); | 251 checkVmRegionsPane(undefined); |
252 checkAllocatorPane(2 /* PID */, 'v8', | 252 checkAllocatorPane(2 /* PID */, 'v8', |
253 false /* no heap details pane */); | 253 false /* no heap details pane */); |
254 | 254 |
255 // PSS of Process 2. | 255 // PSS of Process 2. |
256 overviewTableEl.selectedColumnIndex = 3; | 256 overviewTableEl.selectedColumnIndex = 3; |
257 checkVmRegionsPane(2 /* PID */); | 257 checkVmRegionsPane(2 /* PID */); |
258 checkAllocatorPane(undefined); | 258 checkAllocatorPane(undefined); |
259 }); | 259 }); |
260 }); | 260 }); |
261 | 261 |
262 test('memory', function() { | 262 test('memory', function() { |
263 const containerEl = document.createElement('div'); | 263 const containerEl = document.createElement('div'); |
264 containerEl.brushingStateController = | 264 containerEl.brushingStateController = |
265 new tr.c.BrushingStateController(undefined); | 265 new tr.c.BrushingStateController(undefined); |
266 | 266 |
267 // Create the first container memory view. | 267 // Create the first container memory view. |
268 createAndCheckContainerMemoryDumpView(this, | 268 createAndCheckContainerMemoryDumpView(this, |
269 [tr.ui.analysis.createSingleTestProcessMemoryDump()], | 269 [tr.ui.analysis.createSingleTestProcessMemoryDump()], |
270 function(overviewTableEl, checkVmRegionsPane, checkAllocatorPane) { | 270 function(overviewTableEl, checkVmRegionsPane, checkAllocatorPane) { |
271 // Nothing should be selected initially. | 271 // Nothing should be selected initially. |
272 assert.isUndefined(overviewTableEl.selectedTableRow); | 272 assert.isUndefined(overviewTableEl.selectedTableRow); |
273 assert.isUndefined(overviewTableEl.selectedColumnIndex); | 273 assert.isUndefined(overviewTableEl.selectedColumnIndex); |
274 checkVmRegionsPane(undefined); | 274 checkVmRegionsPane(undefined); |
275 checkAllocatorPane(undefined); | 275 checkAllocatorPane(undefined); |
276 | 276 |
277 // Select V8 of Process 2. | 277 // Select V8 of Process 2. |
278 overviewTableEl.selectedTableRow = overviewTableEl.tableRows[0]; | 278 overviewTableEl.selectedTableRow = overviewTableEl.tableRows[0]; |
279 overviewTableEl.selectedColumnIndex = 11; | 279 overviewTableEl.selectedColumnIndex = 12; |
280 checkVmRegionsPane(undefined); | 280 checkVmRegionsPane(undefined); |
281 checkAllocatorPane(2 /* PID */, 'v8', | 281 checkAllocatorPane(2 /* PID */, 'v8', |
282 false /* no heap details pane */); | 282 false /* no heap details pane */); |
283 }, containerEl); | 283 }, containerEl); |
284 | 284 |
285 // Destroy the first container memory view. | 285 // Destroy the first container memory view. |
286 Polymer.dom(containerEl).textContent = ''; | 286 Polymer.dom(containerEl).textContent = ''; |
287 | 287 |
288 // Create the second container memory view. | 288 // Create the second container memory view. |
289 createAndCheckContainerMemoryDumpView(this, | 289 createAndCheckContainerMemoryDumpView(this, |
290 tr.ui.analysis.createMultipleTestGlobalMemoryDumps(), | 290 tr.ui.analysis.createMultipleTestGlobalMemoryDumps(), |
291 function(overviewTableEl, checkVmRegionsPane, checkAllocatorPane) { | 291 function(overviewTableEl, checkVmRegionsPane, checkAllocatorPane) { |
292 // V8 of Process 2 should still be selected (even though the selection | 292 // V8 of Process 2 should still be selected (even though the selection |
293 // changed). | 293 // changed). |
294 assert.strictEqual( | 294 assert.strictEqual( |
295 overviewTableEl.selectedTableRow, overviewTableEl.tableRows[1]); | 295 overviewTableEl.selectedTableRow, overviewTableEl.tableRows[1]); |
296 assert.strictEqual(overviewTableEl.selectedColumnIndex, 11); | 296 assert.strictEqual(overviewTableEl.selectedColumnIndex, 12); |
297 checkVmRegionsPane(undefined); | 297 checkVmRegionsPane(undefined); |
298 checkAllocatorPane(2 /* PID */, 'v8', | 298 checkAllocatorPane(2 /* PID */, 'v8', |
299 false /* no heap details pane */); | 299 false /* no heap details pane */); |
300 }, containerEl); | 300 }, containerEl); |
301 }); | 301 }); |
302 | 302 |
303 test('instantiate_differentProcessMemoryDumps', function() { | 303 test('instantiate_differentProcessMemoryDumps', function() { |
304 const globalMemoryDumps = | 304 const globalMemoryDumps = |
305 tr.ui.analysis.createMultipleTestGlobalMemoryDumps(); | 305 tr.ui.analysis.createMultipleTestGlobalMemoryDumps(); |
306 // 2 dumps in Process 1, 3 dumps in Process 2, and 1 dump in Process 4 | 306 // 2 dumps in Process 1, 3 dumps in Process 2, and 1 dump in Process 4 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 | 342 |
343 // Check the timestamp. | 343 // Check the timestamp. |
344 assert.strictEqual(col.value(subRow).children[0].value, 42); | 344 assert.strictEqual(col.value(subRow).children[0].value, 42); |
345 | 345 |
346 // Check that the analysis link is associated with the right dump. | 346 // Check that the analysis link is associated with the right dump. |
347 assert.isTrue(col.value(subRow).selection.equals( | 347 assert.isTrue(col.value(subRow).selection.equals( |
348 new tr.model.EventSet(globalMemoryDumps[0].processMemoryDumps[2]))); | 348 new tr.model.EventSet(globalMemoryDumps[0].processMemoryDumps[2]))); |
349 }); | 349 }); |
350 }); | 350 }); |
351 </script> | 351 </script> |
OLD | NEW |