Index: util/win/process_info_test.cc |
diff --git a/util/win/process_info_test.cc b/util/win/process_info_test.cc |
index 0fe49981d4cb0e808edb1f621c6eea6ba9687e86..4119db8047b86fadf3ce479bb17327fce4f42d11 100644 |
--- a/util/win/process_info_test.cc |
+++ b/util/win/process_info_test.cc |
@@ -101,6 +101,24 @@ TEST(ProcessInfo, Self) { |
// System modules are forced to particular stamps and the file header values |
// don't match the on-disk times. Just make sure we got some data here. |
EXPECT_GT(modules[1].timestamp, 0); |
+ |
+ // Find something we know is a code address and confirm expected memory |
+ // information settings. |
+ const std::vector<ProcessInfo::MemoryInfo>& memory_info = |
+ process_info.MemoryInformation(); |
+ WinVMAddress code_address = reinterpret_cast<WinVMAddress>(_ReturnAddress()); |
+ bool found_region = false; |
+ for (const auto& mi : memory_info) { |
+ if (mi.base_address <= code_address && |
+ mi.base_address + mi.region_size > code_address) { |
+ EXPECT_EQ(MEM_COMMIT, mi.state); |
+ EXPECT_EQ(PAGE_EXECUTE_READ, mi.protect); |
+ EXPECT_EQ(MEM_IMAGE, mi.type); |
+ found_region = true; |
+ break; |
Mark Mentovai
2015/09/26 02:02:14
Don’t break. Walk the whole list, and before you s
scottmg
2015/09/26 03:12:36
Done.
|
+ } |
+ } |
+ EXPECT_TRUE(found_region); |
} |
void TestOtherProcess(const base::string16& directory_modification) { |