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

Unified Diff: base/process/memory_unittest.cc

Issue 1852143002: win: Remove GetModuleFromAddress, deduplicate __ImageBase code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 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 side-by-side diff with in-line comments
Download patch
Index: base/process/memory_unittest.cc
diff --git a/base/process/memory_unittest.cc b/base/process/memory_unittest.cc
index 9e5de0c95452ed5c29f21003ea51b46a99536363..49d6e741a500405e815a2732df6108cecf0ad126 100644
--- a/base/process/memory_unittest.cc
+++ b/base/process/memory_unittest.cc
@@ -49,24 +49,6 @@ typedef BOOL (WINAPI* HeapQueryFn) \
const int kConstantInModule = 42;
sof 2016/04/04 07:32:44 This now appears unused -- https://build.chromium.
sof 2016/04/04 07:49:08 Removing in https://codereview.chromium.org/185769
-TEST(ProcessMemoryTest, GetModuleFromAddress) {
- // Since the unit tests are their own EXE, this should be
- // equivalent to the EXE's HINSTANCE.
- //
- // kConstantInModule is a constant in this file and
- // therefore within the unit test EXE.
- EXPECT_EQ(::GetModuleHandle(NULL),
- base::GetModuleFromAddress(
- const_cast<int*>(&kConstantInModule)));
-
- // Any address within the kernel32 module should return
- // kernel32's HMODULE. Our only assumption here is that
- // kernel32 is larger than 4 bytes.
- HMODULE kernel32 = ::GetModuleHandle(L"kernel32.dll");
- HMODULE kernel32_from_address =
- base::GetModuleFromAddress(reinterpret_cast<DWORD*>(kernel32) + 1);
- EXPECT_EQ(kernel32, kernel32_from_address);
-}
#endif // defined(OS_WIN)
#if defined(OS_MACOSX)
« no previous file with comments | « base/process/memory.h ('k') | base/process/memory_win.cc » ('j') | base/win/current_module.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698