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

Unified Diff: base/trace_event/process_memory_dump_unittest.cc

Issue 1398163003: Handle EAGAIN error for the mincore syscall used (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@resident
Patch Set: Rebase. Created 5 years, 2 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_dump_unittest.cc
diff --git a/base/trace_event/process_memory_dump_unittest.cc b/base/trace_event/process_memory_dump_unittest.cc
index 132bb475bd3a10f642ba544b3afe6df23228c928..afdefaf6dfd606cf6c4c94809c0d3857635b4a3e 100644
--- a/base/trace_event/process_memory_dump_unittest.cc
+++ b/base/trace_event/process_memory_dump_unittest.cc
@@ -164,17 +164,21 @@ TEST(ProcessMemoryDumpTest, CountResidentBytes) {
scoped_ptr<char, base::AlignedFreeDeleter> memory1(
static_cast<char*>(base::AlignedAlloc(size1, page_size)));
memset(memory1.get(), 0, size1);
- size_t res1 = ProcessMemoryDump::CountResidentBytes(memory1.get(), size1);
- ASSERT_EQ(res1, size1);
+ size_t res1 = 0;
+ bool ret = ProcessMemoryDump::CountResidentBytes(memory1.get(), size1, &res1);
+ ASSERT_TRUE(ret);
+ ASSERT_EQ(size1, res1);
// Allocate a large memory segment (>32Mib).
const size_t kVeryLargeMemorySize = 34 * 1024 * 1024;
scoped_ptr<char, base::AlignedFreeDeleter> memory2(
static_cast<char*>(base::AlignedAlloc(kVeryLargeMemorySize, page_size)));
memset(memory2.get(), 0, kVeryLargeMemorySize);
- size_t res2 = ProcessMemoryDump::CountResidentBytes(memory2.get(),
- kVeryLargeMemorySize);
- ASSERT_EQ(res2, kVeryLargeMemorySize);
+ size_t res2 = 0;
+ ret = ProcessMemoryDump::CountResidentBytes(memory2.get(),
+ kVeryLargeMemorySize, &res2);
+ ASSERT_TRUE(ret);
+ ASSERT_EQ(kVeryLargeMemorySize, res2);
}
#endif // defined(COUNT_RESIDENT_BYTES_SUPPORTED)

Powered by Google App Engine
This is Rietveld 408576698