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

Unified Diff: chrome/browser/safe_browsing/incident_reporting/environment_data_collection_win_unittest.cc

Issue 471223002: Fixing VerifyLoadedModules not freeing the loaded dll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@binsign
Patch Set: Sync with trunk Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/incident_reporting/environment_data_collection_win_unittest.cc
diff --git a/chrome/browser/safe_browsing/incident_reporting/environment_data_collection_win_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/environment_data_collection_win_unittest.cc
index e8af00d636b6f55df6de56d140af28b20ff66721..f0560d30cf50739fcfe49534aa6dad42d29ab285 100644
--- a/chrome/browser/safe_browsing/incident_reporting/environment_data_collection_win_unittest.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/environment_data_collection_win_unittest.cc
@@ -179,10 +179,10 @@ TEST(SafeBrowsingEnvironmentDataCollectionWinTest, VerifyLoadedModules) {
base::FilePath(safe_browsing::kTestDllNames[i]), NULL));
}
- // Edit the first byte of the function exported by the first module.
- HMODULE module_handle = NULL;
- EXPECT_TRUE(
- GetModuleHandleEx(0, safe_browsing::kTestDllNames[0], &module_handle));
+ // Edit the first byte of the function exported by the first module. Calling
+ // GetModuleHandle so we do not increment the library ref count.
+ HMODULE module_handle = GetModuleHandle(safe_browsing::kTestDllNames[0]);
+ EXPECT_NE(reinterpret_cast<HANDLE>(NULL), module_handle);
uint8_t* export_addr = reinterpret_cast<uint8_t*>(
GetProcAddress(module_handle, safe_browsing::kTestExportName));
EXPECT_NE(reinterpret_cast<uint8_t*>(NULL), export_addr);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698