Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: tracing/tracing/ui/analysis/memory_dump_overview_pane_test.html

Issue 2955053002: Remove tr.b.identity. (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 // Without context (process row). 508 // Without context (process row).
509 const title = c.formatTitle({ 509 const title = c.formatTitle({
510 title: 'Process 1', 510 title: 'Process 1',
511 usedMemoryCells: {}, 511 usedMemoryCells: {},
512 contexts: [tr.ui.analysis.createSingleTestProcessMemoryDump()] 512 contexts: [tr.ui.analysis.createSingleTestProcessMemoryDump()]
513 }); 513 });
514 checkColorLegend(title, 'Process 1'); 514 checkColorLegend(title, 'Process 1');
515 }); 515 });
516 516
517 test('usedMemoryColumn', function() { 517 test('usedMemoryColumn', function() {
518 const c = new UsedMemoryColumn('Private', 'bytes', tr.b.identity, 518 const c = new UsedMemoryColumn('Private', 'bytes', (x => x),
519 AggregationMode.DIFF); 519 AggregationMode.DIFF);
520 checkSpanWithColor(c.title, 'Private', 520 checkSpanWithColor(c.title, 'Private',
521 UsedMemoryColumn.COLOR /* blue (column title) */); 521 UsedMemoryColumn.COLOR /* blue (column title) */);
522 checkColor(c.color(undefined /* contexts */), 522 checkColor(c.color(undefined /* contexts */),
523 UsedMemoryColumn.COLOR /* blue (column cells) */); 523 UsedMemoryColumn.COLOR /* blue (column cells) */);
524 }); 524 });
525 525
526 test('peakMemoryColumn', function() { 526 test('peakMemoryColumn', function() {
527 const c = new PeakMemoryColumn('Peak', 'bytes', tr.b.identity, 527 const c = new PeakMemoryColumn('Peak', 'bytes', (x => x),
528 AggregationMode.MAX); 528 AggregationMode.MAX);
529 checkSpanWithColor(c.title, 'Peak', 529 checkSpanWithColor(c.title, 'Peak',
530 UsedMemoryColumn.COLOR /* blue (column title) */); 530 UsedMemoryColumn.COLOR /* blue (column title) */);
531 checkColor(c.color(undefined) /* contexts */, 531 checkColor(c.color(undefined) /* contexts */,
532 UsedMemoryColumn.COLOR /* blue (column cells) */); 532 UsedMemoryColumn.COLOR /* blue (column cells) */);
533 533
534 const RESETTABLE_PEAK = 1 << 2; 534 const RESETTABLE_PEAK = 1 << 2;
535 const NON_RESETTABLE_PEAK = 1 << 3; 535 const NON_RESETTABLE_PEAK = 1 << 3;
536 function checkPeakColumnInfosAndColor(fieldAndDumpMask, expectedInfos) { 536 function checkPeakColumnInfosAndColor(fieldAndDumpMask, expectedInfos) {
537 checkOverviewColumnInfosAndColor(c, 537 checkOverviewColumnInfosAndColor(c,
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 }; 601 };
602 checkPeakColumnInfosAndColor([ 602 checkPeakColumnInfosAndColor([
603 FIELD | DUMP | NON_RESETTABLE_PEAK, 603 FIELD | DUMP | NON_RESETTABLE_PEAK,
604 0, 604 0,
605 FIELD | DUMP | RESETTABLE_PEAK, 605 FIELD | DUMP | RESETTABLE_PEAK,
606 0 606 0
607 ], [EXPECTED_COMBINATION_INFO]); 607 ], [EXPECTED_COMBINATION_INFO]);
608 }); 608 });
609 609
610 test('byteStatColumn', function() { 610 test('byteStatColumn', function() {
611 const c = new ByteStatColumn('Stat', 'bytes', tr.b.identity, 611 const c = new ByteStatColumn('Stat', 'bytes', (x => x),
612 AggregationMode.DIFF); 612 AggregationMode.DIFF);
613 checkSpanWithColor(c.title, 'Stat', 613 checkSpanWithColor(c.title, 'Stat',
614 UsedMemoryColumn.COLOR /* blue (column title) */); 614 UsedMemoryColumn.COLOR /* blue (column title) */);
615 615
616 const HAS_OWN_VM_REGIONS = 1 << 2; 616 const HAS_OWN_VM_REGIONS = 1 << 2;
617 function checkByteStatColumnInfosAndColor( 617 function checkByteStatColumnInfosAndColor(
618 fieldAndDumpMask, expectedInfos, expectedIsOlderColor) { 618 fieldAndDumpMask, expectedInfos, expectedIsOlderColor) {
619 checkOverviewColumnInfosAndColor(c, 619 checkOverviewColumnInfosAndColor(c,
620 fieldAndDumpMask, 620 fieldAndDumpMask,
621 function(pmd, mask) { 621 function(pmd, mask) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 FIELD | DUMP 679 FIELD | DUMP
680 ], [EXPECTED_SOME_OLDER_VALUES], true /* light blue */); 680 ], [EXPECTED_SOME_OLDER_VALUES], true /* light blue */);
681 checkByteStatColumnInfosAndColor([ 681 checkByteStatColumnInfosAndColor([
682 FIELD | DUMP | HAS_OWN_VM_REGIONS, 682 FIELD | DUMP | HAS_OWN_VM_REGIONS,
683 FIELD | DUMP, 683 FIELD | DUMP,
684 FIELD | DUMP | HAS_OWN_VM_REGIONS 684 FIELD | DUMP | HAS_OWN_VM_REGIONS
685 ], [EXPECTED_SOME_OLDER_VALUES], false /* blue */); 685 ], [EXPECTED_SOME_OLDER_VALUES], false /* blue */);
686 }); 686 });
687 687
688 test('allocatorColumn', function() { 688 test('allocatorColumn', function() {
689 const c = new AllocatorColumn('Allocator', 'bytes', tr.b.identity, 689 const c = new AllocatorColumn('Allocator', 'bytes', (x => x),
690 AggregationMode.MAX); 690 AggregationMode.MAX);
691 checkColorLegend(c.title, 'Allocator'); 691 checkColorLegend(c.title, 'Allocator');
692 checkColor(c.color(undefined /* contexts */), 692 checkColor(c.color(undefined /* contexts */),
693 undefined /* no color (column cells) */); 693 undefined /* no color (column cells) */);
694 694
695 const HAS_HEAP_DUMPS = 1 << 2; 695 const HAS_HEAP_DUMPS = 1 << 2;
696 const HAS_ALLOCATOR_HEAP_DUMP = 1 << 3; 696 const HAS_ALLOCATOR_HEAP_DUMP = 1 << 3;
697 const MISSING_SIZE = 1 << 4; 697 const MISSING_SIZE = 1 << 4;
698 function checkAllocatorColumnInfosAndColor(fieldAndDumpMask, 698 function checkAllocatorColumnInfosAndColor(fieldAndDumpMask,
699 expectedInfos) { 699 expectedInfos) {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 FIELD | DUMP | HAS_HEAP_DUMPS | HAS_ALLOCATOR_HEAP_DUMP, 814 FIELD | DUMP | HAS_HEAP_DUMPS | HAS_ALLOCATOR_HEAP_DUMP,
815 FIELD | DUMP, 815 FIELD | DUMP,
816 FIELD | DUMP | MISSING_SIZE 816 FIELD | DUMP | MISSING_SIZE
817 ], [ 817 ], [
818 EXPECTED_SOME_HAVE_ALLOCATOR_HEAP_DUMP, 818 EXPECTED_SOME_HAVE_ALLOCATOR_HEAP_DUMP,
819 EXPECTED_SOME_MISSING_SIZE 819 EXPECTED_SOME_MISSING_SIZE
820 ]); 820 ]);
821 }); 821 });
822 822
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', (x => x),
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>
OLDNEW
« no previous file with comments | « tracing/tracing/ui/analysis/memory_dump_allocator_details_pane_test.html ('k') | tracing/tracing/ui/tracks/model_track.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698