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

Side by Side Diff: components/metrics/leak_detector/protobuf_to_mojo_converter_unittest.cc

Issue 2721553004: Remove auto raw pointer deduction from non-linux specific code. (Closed)
Patch Set: rebase Created 3 years, 9 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/metrics/leak_detector/protobuf_to_mojo_converter.h" 5 #include "components/metrics/leak_detector/protobuf_to_mojo_converter.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace metrics { 9 namespace metrics {
10 namespace leak_detector { 10 namespace leak_detector {
(...skipping 30 matching lines...) Expand all
41 41
42 TEST(protobuf_to_mojo_converterTest, ConvertReport) { 42 TEST(protobuf_to_mojo_converterTest, ConvertReport) {
43 MemoryLeakReportProto report; 43 MemoryLeakReportProto report;
44 report.add_call_stack(0xdeadbeef); 44 report.add_call_stack(0xdeadbeef);
45 report.add_call_stack(0xc001d00d); 45 report.add_call_stack(0xc001d00d);
46 report.add_call_stack(0x900df00d); 46 report.add_call_stack(0x900df00d);
47 report.set_size_bytes(24); 47 report.set_size_bytes(24);
48 report.set_num_rising_intervals(5); 48 report.set_num_rising_intervals(5);
49 report.set_num_allocs_increase(42); 49 report.set_num_allocs_increase(42);
50 50
51 auto entry1 = report.add_alloc_breakdown_history(); 51 auto* entry1 = report.add_alloc_breakdown_history();
52 entry1->add_counts_by_size(1); 52 entry1->add_counts_by_size(1);
53 entry1->add_counts_by_size(2); 53 entry1->add_counts_by_size(2);
54 entry1->add_counts_by_size(3); 54 entry1->add_counts_by_size(3);
55 entry1->set_count_for_call_stack(4); 55 entry1->set_count_for_call_stack(4);
56 56
57 auto entry2 = report.add_alloc_breakdown_history(); 57 auto* entry2 = report.add_alloc_breakdown_history();
58 entry2->add_counts_by_size(11); 58 entry2->add_counts_by_size(11);
59 entry2->add_counts_by_size(12); 59 entry2->add_counts_by_size(12);
60 entry2->add_counts_by_size(13); 60 entry2->add_counts_by_size(13);
61 entry2->add_counts_by_size(14); 61 entry2->add_counts_by_size(14);
62 entry2->set_count_for_call_stack(15); 62 entry2->set_count_for_call_stack(15);
63 63
64 auto entry3 = report.add_alloc_breakdown_history(); 64 auto* entry3 = report.add_alloc_breakdown_history();
65 entry3->add_counts_by_size(21); 65 entry3->add_counts_by_size(21);
66 entry3->add_counts_by_size(22); 66 entry3->add_counts_by_size(22);
67 entry3->add_counts_by_size(23); 67 entry3->add_counts_by_size(23);
68 entry3->add_counts_by_size(24); 68 entry3->add_counts_by_size(24);
69 entry3->add_counts_by_size(25); 69 entry3->add_counts_by_size(25);
70 entry3->set_count_for_call_stack(26); 70 entry3->set_count_for_call_stack(26);
71 71
72 // Convert to equivalent Mojo struct. 72 // Convert to equivalent Mojo struct.
73 mojo::StructPtr<mojom::MemoryLeakReport> mojo_report = 73 mojo::StructPtr<mojom::MemoryLeakReport> mojo_report =
74 mojom::MemoryLeakReport::New(); 74 mojom::MemoryLeakReport::New();
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 EXPECT_EQ(21U, new_report.alloc_breakdown_history(2).counts_by_size(0)); 136 EXPECT_EQ(21U, new_report.alloc_breakdown_history(2).counts_by_size(0));
137 EXPECT_EQ(22U, new_report.alloc_breakdown_history(2).counts_by_size(1)); 137 EXPECT_EQ(22U, new_report.alloc_breakdown_history(2).counts_by_size(1));
138 EXPECT_EQ(23U, new_report.alloc_breakdown_history(2).counts_by_size(2)); 138 EXPECT_EQ(23U, new_report.alloc_breakdown_history(2).counts_by_size(2));
139 EXPECT_EQ(24U, new_report.alloc_breakdown_history(2).counts_by_size(3)); 139 EXPECT_EQ(24U, new_report.alloc_breakdown_history(2).counts_by_size(3));
140 EXPECT_EQ(25U, new_report.alloc_breakdown_history(2).counts_by_size(4)); 140 EXPECT_EQ(25U, new_report.alloc_breakdown_history(2).counts_by_size(4));
141 EXPECT_EQ(26U, new_report.alloc_breakdown_history(2).count_for_call_stack()); 141 EXPECT_EQ(26U, new_report.alloc_breakdown_history(2).count_for_call_stack());
142 } 142 }
143 143
144 } // namespace leak_detector 144 } // namespace leak_detector
145 } // namespace metrics 145 } // namespace metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698