| 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/iteration_helpers.html"> | 8 <link rel="import" href="/tracing/base/iteration_helpers.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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 viewEl, 'tr-ui-a-stacked-pane-view'); | 57 viewEl, 'tr-ui-a-stacked-pane-view'); |
| 58 const headerPaneEl = tr.b.findDeepElementMatching( | 58 const headerPaneEl = tr.b.findDeepElementMatching( |
| 59 stackedPaneViewEl, 'tr-ui-a-memory-dump-header-pane'); | 59 stackedPaneViewEl, 'tr-ui-a-memory-dump-header-pane'); |
| 60 const overviewPaneEl = tr.b.findDeepElementMatching( | 60 const overviewPaneEl = tr.b.findDeepElementMatching( |
| 61 stackedPaneViewEl, 'tr-ui-a-memory-dump-overview-pane'); | 61 stackedPaneViewEl, 'tr-ui-a-memory-dump-overview-pane'); |
| 62 | 62 |
| 63 // Check that the header pane and overview pane are correctly set up. | 63 // Check that the header pane and overview pane are correctly set up. |
| 64 const processMemoryDumps = containerMemoryDumps.map( | 64 const processMemoryDumps = containerMemoryDumps.map( |
| 65 containerDump => containerDump.processMemoryDumps); | 65 containerDump => containerDump.processMemoryDumps); |
| 66 assert.deepEqual( | 66 assert.deepEqual( |
| 67 tr.b.asArray(headerPaneEl.containerMemoryDumps), containerMemoryDumps); | 67 Array.from(headerPaneEl.containerMemoryDumps), containerMemoryDumps); |
| 68 assert.deepEqual(overviewPaneEl.processMemoryDumps, processMemoryDumps); | 68 assert.deepEqual(overviewPaneEl.processMemoryDumps, processMemoryDumps); |
| 69 assert.strictEqual( | 69 assert.strictEqual( |
| 70 overviewPaneEl.aggregationMode, headerPaneEl.aggregationMode); | 70 overviewPaneEl.aggregationMode, headerPaneEl.aggregationMode); |
| 71 | 71 |
| 72 // Get the overview pane table to drive the details pane checks. | 72 // Get the overview pane table to drive the details pane checks. |
| 73 const overviewTableEl = tr.b.findDeepElementMatching( | 73 const overviewTableEl = tr.b.findDeepElementMatching( |
| 74 overviewPaneEl, 'tr-ui-b-table'); | 74 overviewPaneEl, 'tr-ui-b-table'); |
| 75 | 75 |
| 76 function checkVmRegionsPane(pid) { | 76 function checkVmRegionsPane(pid) { |
| 77 const detailsPaneEl = tr.b.findDeepElementMatching( | 77 const detailsPaneEl = tr.b.findDeepElementMatching( |
| 78 stackedPaneViewEl, 'tr-ui-a-memory-dump-vm-regions-details-pane'); | 78 stackedPaneViewEl, 'tr-ui-a-memory-dump-vm-regions-details-pane'); |
| 79 if (pid === undefined) { | 79 if (pid === undefined) { |
| 80 assert.isUndefined(detailsPaneEl); | 80 assert.isUndefined(detailsPaneEl); |
| 81 } else { | 81 } else { |
| 82 assert.deepEqual(tr.b.asArray(detailsPaneEl.vmRegions), | 82 assert.deepEqual(Array.from(detailsPaneEl.vmRegions), |
| 83 extractVmRegions(processMemoryDumps, pid)); | 83 extractVmRegions(processMemoryDumps, pid)); |
| 84 assert.strictEqual( | 84 assert.strictEqual( |
| 85 detailsPaneEl.aggregationMode, headerPaneEl.aggregationMode); | 85 detailsPaneEl.aggregationMode, headerPaneEl.aggregationMode); |
| 86 } | 86 } |
| 87 } | 87 } |
| 88 | 88 |
| 89 function checkAllocatorPane(pid, allocatorName, withHeapDetailsPane) { | 89 function checkAllocatorPane(pid, allocatorName, withHeapDetailsPane) { |
| 90 const allocatorDetailsPaneEl = tr.b.findDeepElementMatching( | 90 const allocatorDetailsPaneEl = tr.b.findDeepElementMatching( |
| 91 stackedPaneViewEl, 'tr-ui-a-memory-dump-allocator-details-pane'); | 91 stackedPaneViewEl, 'tr-ui-a-memory-dump-allocator-details-pane'); |
| 92 if (pid === undefined) { | 92 if (pid === undefined) { |
| 93 assert.isUndefined(allocatorDetailsPaneEl); | 93 assert.isUndefined(allocatorDetailsPaneEl); |
| 94 assert.isUndefined(allocatorName); // Test sanity check. | 94 assert.isUndefined(allocatorName); // Test sanity check. |
| 95 assert.isUndefined(withHeapDetailsPane); // Test sanity check. | 95 assert.isUndefined(withHeapDetailsPane); // Test sanity check. |
| 96 return; | 96 return; |
| 97 } | 97 } |
| 98 | 98 |
| 99 assert.deepEqual( | 99 assert.deepEqual( |
| 100 tr.b.asArray(allocatorDetailsPaneEl.memoryAllocatorDumps), | 100 Array.from(allocatorDetailsPaneEl.memoryAllocatorDumps), |
| 101 extractMemoryAllocatorDumps(processMemoryDumps, pid, allocatorName)); | 101 extractMemoryAllocatorDumps(processMemoryDumps, pid, allocatorName)); |
| 102 assert.strictEqual( | 102 assert.strictEqual( |
| 103 allocatorDetailsPaneEl.aggregationMode, headerPaneEl.aggregationMode); | 103 allocatorDetailsPaneEl.aggregationMode, headerPaneEl.aggregationMode); |
| 104 | 104 |
| 105 const heapDetailsPaneEl = tr.b.findDeepElementMatching( | 105 const heapDetailsPaneEl = tr.b.findDeepElementMatching( |
| 106 stackedPaneViewEl, 'tr-ui-a-memory-dump-heap-details-pane'); | 106 stackedPaneViewEl, 'tr-ui-a-memory-dump-heap-details-pane'); |
| 107 if (!withHeapDetailsPane) { | 107 if (!withHeapDetailsPane) { |
| 108 assert.isUndefined(heapDetailsPaneEl); | 108 assert.isUndefined(heapDetailsPaneEl); |
| 109 return; | 109 return; |
| 110 } | 110 } |
| 111 | 111 |
| 112 assert.deepEqual(tr.b.asArray(heapDetailsPaneEl.heapDumps), | 112 assert.deepEqual(Array.from(heapDetailsPaneEl.heapDumps), |
| 113 extractHeapDumps(processMemoryDumps, pid, allocatorName)); | 113 extractHeapDumps(processMemoryDumps, pid, allocatorName)); |
| 114 assert.strictEqual( | 114 assert.strictEqual( |
| 115 heapDetailsPaneEl.aggregationMode, headerPaneEl.aggregationMode); | 115 heapDetailsPaneEl.aggregationMode, headerPaneEl.aggregationMode); |
| 116 } | 116 } |
| 117 | 117 |
| 118 detailsCheckCallback( | 118 detailsCheckCallback( |
| 119 overviewTableEl, checkVmRegionsPane, checkAllocatorPane); | 119 overviewTableEl, checkVmRegionsPane, checkAllocatorPane); |
| 120 } | 120 } |
| 121 | 121 |
| 122 test('instantiate_empty', function() { | 122 test('instantiate_empty', function() { |
| (...skipping 219 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 |