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" href="/tracing/core/test_utils.html"> | 9 <link rel="import" href="/tracing/core/test_utils.html"> |
10 <link rel="import" href="/tracing/model/heap_dump.html"> | 10 <link rel="import" href="/tracing/model/heap_dump.html"> |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // Check all sizes. The first assert below is a test sanity check. | 92 // Check all sizes. The first assert below is a test sanity check. |
93 assert.lengthOf(expectedSizes, columns.length - 1 /* all except title */); | 93 assert.lengthOf(expectedSizes, columns.length - 1 /* all except title */); |
94 for (let i = 0; i < expectedSizes.length; i++) { | 94 for (let i = 0; i < expectedSizes.length; i++) { |
95 checkSizeNumericFields(row, columns[i + 1], expectedSizes[i]); | 95 checkSizeNumericFields(row, columns[i + 1], expectedSizes[i]); |
96 } | 96 } |
97 | 97 |
98 // There should be no row nesting on the overview pane. | 98 // There should be no row nesting on the overview pane. |
99 assert.isUndefined(row.subRows); | 99 assert.isUndefined(row.subRows); |
100 | 100 |
101 if (expectedContexts) { | 101 if (expectedContexts) { |
102 assert.deepEqual(tr.b.asArray(row.contexts), expectedContexts); | 102 assert.deepEqual(Array.from(row.contexts), expectedContexts); |
103 } else { | 103 } else { |
104 assert.isUndefined(row.contexts); | 104 assert.isUndefined(row.contexts); |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 function checkRows(columns, actualRows, expectedRows) { | 108 function checkRows(columns, actualRows, expectedRows) { |
109 if (expectedRows === undefined) { | 109 if (expectedRows === undefined) { |
110 assert.isUndefined(actualRows); | 110 assert.isUndefined(actualRows); |
111 return; | 111 return; |
112 } | 112 } |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 }); | 433 }); |
434 | 434 |
435 simulateView( | 435 simulateView( |
436 [2, 3], | 436 [2, 3], |
437 AggregationMode.MAX, | 437 AggregationMode.MAX, |
438 [18350080, 18350080, 18350080], 'Process 2', 3, /* PSS */ | 438 [18350080, 18350080, 18350080], 'Process 2', 3, /* PSS */ |
439 function(view, table) { | 439 function(view, table) { |
440 const childPane = view.createChildPane(); | 440 const childPane = view.createChildPane(); |
441 assert.strictEqual( | 441 assert.strictEqual( |
442 childPane.tagName, 'TR-UI-A-MEMORY-DUMP-VM-REGIONS-DETAILS-PANE'); | 442 childPane.tagName, 'TR-UI-A-MEMORY-DUMP-VM-REGIONS-DETAILS-PANE'); |
443 assert.deepEqual(tr.b.asArray(childPane.vmRegions), | 443 assert.deepEqual(Array.from(childPane.vmRegions), |
444 extractVmRegions(processMemoryDumps, 2)); | 444 extractVmRegions(processMemoryDumps, 2)); |
445 assert.strictEqual(childPane.aggregationMode, AggregationMode.MAX); | 445 assert.strictEqual(childPane.aggregationMode, AggregationMode.MAX); |
446 }); | 446 }); |
447 | 447 |
448 simulateView( | 448 simulateView( |
449 [3], | 449 [3], |
450 undefined, /* No aggregation */ | 450 undefined, /* No aggregation */ |
451 undefined, undefined, undefined, // No cell selected. | 451 undefined, undefined, undefined, // No cell selected. |
452 function(view, table) { | 452 function(view, table) { |
453 assert.isUndefined(view.createChildPane()); | 453 assert.isUndefined(view.createChildPane()); |
454 }); | 454 }); |
455 | 455 |
456 simulateView( | 456 simulateView( |
457 [1, 2, 3, 4], | 457 [1, 2, 3, 4], |
458 AggregationMode.DIFF, | 458 AggregationMode.DIFF, |
459 [18350080, 18350080, 18350080], 'Process 2', 3, /* PSS */ | 459 [18350080, 18350080, 18350080], 'Process 2', 3, /* PSS */ |
460 function(view, table) { | 460 function(view, table) { |
461 const childPane = view.createChildPane(); | 461 const childPane = view.createChildPane(); |
462 assert.strictEqual( | 462 assert.strictEqual( |
463 childPane.tagName, 'TR-UI-A-MEMORY-DUMP-VM-REGIONS-DETAILS-PANE'); | 463 childPane.tagName, 'TR-UI-A-MEMORY-DUMP-VM-REGIONS-DETAILS-PANE'); |
464 assert.deepEqual(tr.b.asArray(childPane.vmRegions), | 464 assert.deepEqual(Array.from(childPane.vmRegions), |
465 extractVmRegions(processMemoryDumps, 2)); | 465 extractVmRegions(processMemoryDumps, 2)); |
466 assert.strictEqual(childPane.aggregationMode, AggregationMode.DIFF); | 466 assert.strictEqual(childPane.aggregationMode, AggregationMode.DIFF); |
467 | 467 |
468 // Select the 'v8' column of the first process (empty cell). | 468 // Select the 'v8' column of the first process (empty cell). |
469 table.selectedTableRow = table.tableRows[0]; | 469 table.selectedTableRow = table.tableRows[0]; |
470 table.selectedColumnIndex = 10; | 470 table.selectedColumnIndex = 10; |
471 }); | 471 }); |
472 | 472 |
473 simulateView( | 473 simulateView( |
474 [1], | 474 [1], |
475 undefined, /* No aggregation */ | 475 undefined, /* No aggregation */ |
476 undefined, undefined, undefined, // No cell should selected. | 476 undefined, undefined, undefined, // No cell should selected. |
477 function(view, table) { | 477 function(view, table) { |
478 assert.isUndefined(view.createChildPane()); | 478 assert.isUndefined(view.createChildPane()); |
479 | 479 |
480 // Select 'Total resident' column of the first process. | 480 // Select 'Total resident' column of the first process. |
481 table.selectedTableRow = table.tableRows[0]; | 481 table.selectedTableRow = table.tableRows[0]; |
482 table.selectedColumnIndex = 1; | 482 table.selectedColumnIndex = 1; |
483 }); | 483 }); |
484 | 484 |
485 simulateView( | 485 simulateView( |
486 [1, 2, 3, 4], | 486 [1, 2, 3, 4], |
487 AggregationMode.MAX, | 487 AggregationMode.MAX, |
488 [31457280, 29884416, undefined], 'Process 1', 1, /* Total resident */ | 488 [31457280, 29884416, undefined], 'Process 1', 1, /* Total resident */ |
489 function(view, table) { | 489 function(view, table) { |
490 const childPane = view.createChildPane(); | 490 const childPane = view.createChildPane(); |
491 assert.strictEqual( | 491 assert.strictEqual( |
492 childPane.tagName, 'TR-UI-A-MEMORY-DUMP-VM-REGIONS-DETAILS-PANE'); | 492 childPane.tagName, 'TR-UI-A-MEMORY-DUMP-VM-REGIONS-DETAILS-PANE'); |
493 assert.deepEqual(tr.b.asArray(childPane.vmRegions), | 493 assert.deepEqual(Array.from(childPane.vmRegions), |
494 extractVmRegions(processMemoryDumps, 1)); | 494 extractVmRegions(processMemoryDumps, 1)); |
495 assert.strictEqual(childPane.aggregationMode, AggregationMode.MAX); | 495 assert.strictEqual(childPane.aggregationMode, AggregationMode.MAX); |
496 }); | 496 }); |
497 }); | 497 }); |
498 | 498 |
499 test('processNameColumn_formatTitle', function() { | 499 test('processNameColumn_formatTitle', function() { |
500 const c = new ProcessNameColumn(); | 500 const c = new ProcessNameColumn(); |
501 | 501 |
502 // With context (total row). | 502 // With context (total row). |
503 assert.strictEqual(c.formatTitle({ | 503 assert.strictEqual(c.formatTitle({ |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 test('tracingColumn', function() { | 823 test('tracingColumn', function() { |
824 const c = new TracingColumn('Tracing', 'bytes', tr.b.identity, | 824 const c = new TracingColumn('Tracing', 'bytes', tr.b.identity, |
825 AggregationMode.DIFF); | 825 AggregationMode.DIFF); |
826 checkSpanWithColor(c.title, 'Tracing', | 826 checkSpanWithColor(c.title, 'Tracing', |
827 TracingColumn.COLOR /* expected column title gray color */); | 827 TracingColumn.COLOR /* expected column title gray color */); |
828 checkColor(c.color(undefined /* contexts */), | 828 checkColor(c.color(undefined /* contexts */), |
829 TracingColumn.COLOR /* expected column cells gray color */); | 829 TracingColumn.COLOR /* expected column cells gray color */); |
830 }); | 830 }); |
831 }); | 831 }); |
832 </script> | 832 </script> |
OLD | NEW |