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

Unified Diff: util/win/process_info_test.cc

Issue 1369833002: win: Gather memory information (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@save-peb-stuff
Patch Set: . Created 5 years, 3 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
« util/win/process_info.cc ('K') | « util/win/process_info.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« util/win/process_info.cc ('K') | « util/win/process_info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698