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

Unified Diff: base/trace_event/process_memory_maps_dump_provider_unittest.cc

Issue 1262333005: [tracing] Introduce MemoryDumpArgs to enable light and heavy dumps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: base/trace_event/process_memory_maps_dump_provider_unittest.cc
diff --git a/base/trace_event/process_memory_maps_dump_provider_unittest.cc b/base/trace_event/process_memory_maps_dump_provider_unittest.cc
index 5416e119960f790858386de5bafb167d549da6fe..fcb9eaff4f19b2913fa12d4be5a7dc2bd42a4f27 100644
--- a/base/trace_event/process_memory_maps_dump_provider_unittest.cc
+++ b/base/trace_event/process_memory_maps_dump_provider_unittest.cc
@@ -110,6 +110,7 @@ TEST(ProcessMemoryMapsDumpProviderTest, ParseProcSmaps) {
const uint32 kProtR = ProcessMemoryMaps::VMRegion::kProtectionFlagsRead;
const uint32 kProtW = ProcessMemoryMaps::VMRegion::kProtectionFlagsWrite;
const uint32 kProtX = ProcessMemoryMaps::VMRegion::kProtectionFlagsExec;
+ const MemoryDumpArgs dump_args = {MemoryDumpArgs::LEVEL_OF_DETAIL_HIGH};
auto pmmdp = ProcessMemoryMapsDumpProvider::GetInstance();
@@ -118,21 +119,21 @@ TEST(ProcessMemoryMapsDumpProviderTest, ParseProcSmaps) {
std::ifstream non_existent_file("/tmp/does-not-exist");
ProcessMemoryMapsDumpProvider::proc_smaps_for_testing = &non_existent_file;
CHECK_EQ(false, non_existent_file.good());
- pmmdp->OnMemoryDump(&pmd_invalid);
+ pmmdp->OnMemoryDump(dump_args, &pmd_invalid);
ASSERT_FALSE(pmd_invalid.has_process_mmaps());
// Emulate an empty /proc/self/smaps.
std::ifstream empty_file("/dev/null");
ProcessMemoryMapsDumpProvider::proc_smaps_for_testing = &empty_file;
CHECK_EQ(true, empty_file.good());
- pmmdp->OnMemoryDump(&pmd_invalid);
+ pmmdp->OnMemoryDump(dump_args, &pmd_invalid);
ASSERT_FALSE(pmd_invalid.has_process_mmaps());
// Parse the 1st smaps file.
ProcessMemoryDump pmd_1(nullptr /* session_state */);
std::istringstream test_smaps_1(kTestSmaps1);
ProcessMemoryMapsDumpProvider::proc_smaps_for_testing = &test_smaps_1;
- pmmdp->OnMemoryDump(&pmd_1);
+ pmmdp->OnMemoryDump(dump_args, &pmd_1);
ASSERT_TRUE(pmd_1.has_process_mmaps());
const auto& regions_1 = pmd_1.process_mmaps()->vm_regions();
ASSERT_EQ(2UL, regions_1.size());
@@ -163,7 +164,7 @@ TEST(ProcessMemoryMapsDumpProviderTest, ParseProcSmaps) {
ProcessMemoryDump pmd_2(nullptr /* session_state */);
std::istringstream test_smaps_2(kTestSmaps2);
ProcessMemoryMapsDumpProvider::proc_smaps_for_testing = &test_smaps_2;
- pmmdp->OnMemoryDump(&pmd_2);
+ pmmdp->OnMemoryDump(dump_args, &pmd_2);
ASSERT_TRUE(pmd_2.has_process_mmaps());
const auto& regions_2 = pmd_2.process_mmaps()->vm_regions();
ASSERT_EQ(1UL, regions_2.size());
« no previous file with comments | « base/trace_event/process_memory_maps_dump_provider.cc ('k') | base/trace_event/process_memory_totals_dump_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698