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

Side by Side Diff: tracing/tracing/ui/analysis/memory_dump_allocator_details_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/base/scalar.html"> 9 <link rel="import" href="/tracing/base/scalar.html">
10 <link rel="import" href="/tracing/base/unit.html"> 10 <link rel="import" href="/tracing/base/unit.html">
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 // Sub-allocation row. 660 // Sub-allocation row.
661 const row = c.formatTitle({ 661 const row = c.formatTitle({
662 title: 'Suballocation row', 662 title: 'Suballocation row',
663 suballocation: true, 663 suballocation: true,
664 }); 664 });
665 assert.strictEqual(Polymer.dom(row).textContent, 'Suballocation row'); 665 assert.strictEqual(Polymer.dom(row).textContent, 'Suballocation row');
666 assert.strictEqual(row.style.fontStyle, 'italic'); 666 assert.strictEqual(row.style.fontStyle, 'italic');
667 }); 667 });
668 668
669 test('effectiveSizeColumn_noContext', function() { 669 test('effectiveSizeColumn_noContext', function() {
670 const c = new EffectiveSizeColumn('Effective Size', 'bytes', tr.b.identity, 670 const c = new EffectiveSizeColumn('Effective Size', 'bytes', (x => x),
671 AggregationMode.DIFF); 671 AggregationMode.DIFF);
672 672
673 // Single selection. 673 // Single selection.
674 checkColumnInfosAndColor(c, 674 checkColumnInfosAndColor(c,
675 createSizeFields([128]), 675 createSizeFields([128]),
676 undefined /* no context */, 676 undefined /* no context */,
677 [] /* no infos */, 677 [] /* no infos */,
678 undefined /* no color */); 678 undefined /* no color */);
679 679
680 // Multi-selection. 680 // Multi-selection.
681 checkColumnInfosAndColor(c, 681 checkColumnInfosAndColor(c,
682 createSizeFields([128, 256, undefined, 64]), 682 createSizeFields([128, 256, undefined, 64]),
683 undefined /* no context */, 683 undefined /* no context */,
684 [] /* no infos */, 684 [] /* no infos */,
685 undefined /* no color */); 685 undefined /* no color */);
686 }); 686 });
687 687
688 test('effectiveSizeColumn_suballocationContext', function() { 688 test('effectiveSizeColumn_suballocationContext', function() {
689 const c = new EffectiveSizeColumn('Effective Size', 'bytes', tr.b.identity, 689 const c = new EffectiveSizeColumn('Effective Size', 'bytes', (x => x),
690 AggregationMode.MAX); 690 AggregationMode.MAX);
691 691
692 // Single selection. 692 // Single selection.
693 checkColumnInfosAndColor(c, 693 checkColumnInfosAndColor(c,
694 createSizeFields([128]), 694 createSizeFields([128]),
695 [SUBALLOCATION_CONTEXT], 695 [SUBALLOCATION_CONTEXT],
696 [] /* no infos */, 696 [] /* no infos */,
697 undefined /* no color */); 697 undefined /* no color */);
698 698
699 // Multi-selection. 699 // Multi-selection.
700 checkColumnInfosAndColor(c, 700 checkColumnInfosAndColor(c,
701 createSizeFields([undefined, 256, undefined, 64]), 701 createSizeFields([undefined, 256, undefined, 64]),
702 [undefined, SUBALLOCATION_CONTEXT, SUBALLOCATION_CONTEXT, 702 [undefined, SUBALLOCATION_CONTEXT, SUBALLOCATION_CONTEXT,
703 SUBALLOCATION_CONTEXT], 703 SUBALLOCATION_CONTEXT],
704 [] /* no infos */, 704 [] /* no infos */,
705 undefined /* no color */); 705 undefined /* no color */);
706 }); 706 });
707 707
708 test('effectiveSizeColumn_dumpContext_noOwnership', function() { 708 test('effectiveSizeColumn_dumpContext_noOwnership', function() {
709 const c = new EffectiveSizeColumn('Effective Size', 'bytes', tr.b.identity, 709 const c = new EffectiveSizeColumn('Effective Size', 'bytes', (x => x),
710 AggregationMode.DIFF); 710 AggregationMode.DIFF);
711 const pmds = buildProcessMemoryDumps(4 /* count */, function(pmds) { 711 const pmds = buildProcessMemoryDumps(4 /* count */, function(pmds) {
712 addRootDumps(pmds[0], ['v8'], function(v8Dump) { 712 addRootDumps(pmds[0], ['v8'], function(v8Dump) {
713 addChildDump(v8Dump, 'heaps', {numerics: {size: 64}}); 713 addChildDump(v8Dump, 'heaps', {numerics: {size: 64}});
714 }); 714 });
715 addRootDumps(pmds[2], ['v8'], function(v8Dump) { 715 addRootDumps(pmds[2], ['v8'], function(v8Dump) {
716 addChildDump(v8Dump, 'heaps', {numerics: {size: 128}}); 716 addChildDump(v8Dump, 'heaps', {numerics: {size: 128}});
717 }); 717 });
718 addRootDumps(pmds[3], ['v8'], function(v8Dump) {}); 718 addRootDumps(pmds[3], ['v8'], function(v8Dump) {});
719 }); 719 });
(...skipping 12 matching lines...) Expand all
732 [] /* no infos */); 732 [] /* no infos */);
733 733
734 // Multi-selection, some dumps missing. 734 // Multi-selection, some dumps missing.
735 checkAllocatorPaneColumnInfosAndColor(c, 735 checkAllocatorPaneColumnInfosAndColor(c,
736 v8HeapsDumps, 736 v8HeapsDumps,
737 'effective_size', 737 'effective_size',
738 [] /* no infos */); 738 [] /* no infos */);
739 }); 739 });
740 740
741 test('effectiveSizeColumn_dumpContext_singleOwnership', function() { 741 test('effectiveSizeColumn_dumpContext_singleOwnership', function() {
742 const c = new EffectiveSizeColumn('Effective Size', 'bytes', tr.b.identity, 742 const c = new EffectiveSizeColumn('Effective Size', 'bytes', (x => x),
743 AggregationMode.MAX); 743 AggregationMode.MAX);
744 const pmds = buildProcessMemoryDumps(5 /* count */, function(pmds) { 744 const pmds = buildProcessMemoryDumps(5 /* count */, function(pmds) {
745 addRootDumps(pmds[0], ['v8', 'oilpan'], function(v8Dump, oilpanDump) { 745 addRootDumps(pmds[0], ['v8', 'oilpan'], function(v8Dump, oilpanDump) {
746 const v8HeapsDump = addChildDump(v8Dump, 'heaps', 746 const v8HeapsDump = addChildDump(v8Dump, 'heaps',
747 {numerics: {size: 32}}); 747 {numerics: {size: 32}});
748 const oilpanObjectsDump = 748 const oilpanObjectsDump =
749 addChildDump(oilpanDump, 'objects', {numerics: {size: 64}}); 749 addChildDump(oilpanDump, 'objects', {numerics: {size: 64}});
750 addOwnershipLink(v8HeapsDump, oilpanObjectsDump); 750 addOwnershipLink(v8HeapsDump, oilpanObjectsDump);
751 }); 751 });
752 addRootDumps(pmds[1], ['v8'], function(v8Dump) { 752 addRootDumps(pmds[1], ['v8'], function(v8Dump) {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 { 840 {
841 icon: '\u21FD', 841 icon: '\u21FD',
842 message: 'shared by \'v8/heaps\' in Process 1 at some selected ' + 842 message: 'shared by \'v8/heaps\' in Process 1 at some selected ' +
843 'timestamps (importance: 0\u20132)', 843 'timestamps (importance: 0\u20132)',
844 color: 'green' 844 color: 'green'
845 } 845 }
846 ]); 846 ]);
847 }); 847 });
848 848
849 test('effectiveSizeColumn_dumpContext_multipleOwnerships', function() { 849 test('effectiveSizeColumn_dumpContext_multipleOwnerships', function() {
850 const c = new EffectiveSizeColumn('Effective Size', 'bytes', tr.b.identity, 850 const c = new EffectiveSizeColumn('Effective Size', 'bytes', (x => x),
851 AggregationMode.DIFF); 851 AggregationMode.DIFF);
852 const pmds = buildProcessMemoryDumps(6 /* count */, function(pmds) { 852 const pmds = buildProcessMemoryDumps(6 /* count */, function(pmds) {
853 addRootDumps(pmds[0], ['v8', 'oilpan'], function(v8Dump, oilpanDump) { 853 addRootDumps(pmds[0], ['v8', 'oilpan'], function(v8Dump, oilpanDump) {
854 const v8HeapsDump = addChildDump(v8Dump, 'heaps', 854 const v8HeapsDump = addChildDump(v8Dump, 'heaps',
855 {numerics: {size: 32}}); 855 {numerics: {size: 32}});
856 const v8QueuesDump = addChildDump(v8Dump, 'queues', 856 const v8QueuesDump = addChildDump(v8Dump, 'queues',
857 {numerics: {size: 8}}); 857 {numerics: {size: 8}});
858 const oilpanObjectsDump = 858 const oilpanObjectsDump =
859 addChildDump(oilpanDump, 'objects', {numerics: {size: 64}}); 859 addChildDump(oilpanDump, 'objects', {numerics: {size: 64}});
860 addOwnershipLink(v8HeapsDump, oilpanObjectsDump); 860 addOwnershipLink(v8HeapsDump, oilpanObjectsDump);
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 ' - \'v8/queues\' in Process 1 at some selected timestamps ' + 1004 ' - \'v8/queues\' in Process 1 at some selected timestamps ' +
1005 '(importance: 1)\n' + 1005 '(importance: 1)\n' +
1006 ' - \'v8/piles\' in Process 1 at some selected timestamps ' + 1006 ' - \'v8/piles\' in Process 1 at some selected timestamps ' +
1007 '(importance: 0\u20137)', 1007 '(importance: 0\u20137)',
1008 color: 'green' 1008 color: 'green'
1009 } 1009 }
1010 ]); 1010 ]);
1011 }); 1011 });
1012 1012
1013 test('sizeColumn_noContext', function() { 1013 test('sizeColumn_noContext', function() {
1014 const c = new SizeColumn('Size', 'bytes', tr.b.identity, 1014 const c = new SizeColumn('Size', 'bytes', (x => x),
1015 AggregationMode.DIFF); 1015 AggregationMode.DIFF);
1016 1016
1017 // Single selection. 1017 // Single selection.
1018 checkColumnInfosAndColor(c, 1018 checkColumnInfosAndColor(c,
1019 createSizeFields([128]), 1019 createSizeFields([128]),
1020 undefined /* no context */, 1020 undefined /* no context */,
1021 [] /* no infos */, 1021 [] /* no infos */,
1022 undefined /* no color */); 1022 undefined /* no color */);
1023 1023
1024 // Multi-selection. 1024 // Multi-selection.
1025 checkColumnInfosAndColor(c, 1025 checkColumnInfosAndColor(c,
1026 createSizeFields([128, 256, undefined, 64]), 1026 createSizeFields([128, 256, undefined, 64]),
1027 undefined /* no context */, 1027 undefined /* no context */,
1028 [] /* no infos */, 1028 [] /* no infos */,
1029 undefined /* no color */); 1029 undefined /* no color */);
1030 }); 1030 });
1031 1031
1032 test('sizeColumn_suballocationContext', function() { 1032 test('sizeColumn_suballocationContext', function() {
1033 const c = new SizeColumn('Size', 'bytes', tr.b.identity, 1033 const c = new SizeColumn('Size', 'bytes', (x => x),
1034 AggregationMode.MAX); 1034 AggregationMode.MAX);
1035 1035
1036 // Single selection. 1036 // Single selection.
1037 checkColumnInfosAndColor(c, 1037 checkColumnInfosAndColor(c,
1038 createSizeFields([128]), 1038 createSizeFields([128]),
1039 [SUBALLOCATION_CONTEXT], 1039 [SUBALLOCATION_CONTEXT],
1040 [] /* no infos */, 1040 [] /* no infos */,
1041 undefined /* no color */); 1041 undefined /* no color */);
1042 1042
1043 // Multi-selection. 1043 // Multi-selection.
1044 checkColumnInfosAndColor(c, 1044 checkColumnInfosAndColor(c,
1045 createSizeFields([undefined, 256, undefined, 64]), 1045 createSizeFields([undefined, 256, undefined, 64]),
1046 [undefined, SUBALLOCATION_CONTEXT, undefined, SUBALLOCATION_CONTEXT], 1046 [undefined, SUBALLOCATION_CONTEXT, undefined, SUBALLOCATION_CONTEXT],
1047 [] /* no infos */, 1047 [] /* no infos */,
1048 undefined /* no color */); 1048 undefined /* no color */);
1049 }); 1049 });
1050 1050
1051 test('sizeColumn_dumpContext', function() { 1051 test('sizeColumn_dumpContext', function() {
1052 const c = new SizeColumn('Size', 'bytes', tr.b.identity, 1052 const c = new SizeColumn('Size', 'bytes', (x => x), AggregationMode.DIFF);
1053 AggregationMode.DIFF);
1054 const pmds = buildProcessMemoryDumps(7 /* count */, function(pmds) { 1053 const pmds = buildProcessMemoryDumps(7 /* count */, function(pmds) {
1055 addRootDumps(pmds[0], ['v8'], function(v8Dump) { 1054 addRootDumps(pmds[0], ['v8'], function(v8Dump) {
1056 // Single direct overlap (v8/objects -> v8/heaps). 1055 // Single direct overlap (v8/objects -> v8/heaps).
1057 const v8ObjectsDump = addChildDump(v8Dump, 'objects', 1056 const v8ObjectsDump = addChildDump(v8Dump, 'objects',
1058 {numerics: {size: 1536}}); 1057 {numerics: {size: 1536}});
1059 const v8HeapsDump = addChildDump(v8Dump, 'heaps', 1058 const v8HeapsDump = addChildDump(v8Dump, 'heaps',
1060 {numerics: {size: 2048}}); 1059 {numerics: {size: 2048}});
1061 addOwnershipLink(v8ObjectsDump, v8HeapsDump); 1060 addOwnershipLink(v8ObjectsDump, v8HeapsDump);
1062 }); 1061 });
1063 // pmd[1] intentionally skipped. 1062 // pmd[1] intentionally skipped.
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
1253 { 1252 {
1254 icon: '\u26A0', 1253 icon: '\u26A0',
1255 message: 'provided size was less than the aggregated size of ' + 1254 message: 'provided size was less than the aggregated size of ' +
1256 'the children at some selected timestamps', 1255 'the children at some selected timestamps',
1257 color: 'red' 1256 color: 'red'
1258 } 1257 }
1259 ]); 1258 ]);
1260 }); 1259 });
1261 }); 1260 });
1262 </script> 1261 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/model/clock_sync_manager.html ('k') | tracing/tracing/ui/analysis/memory_dump_overview_pane_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698