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

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

Issue 2163803003: [chrome_elf] Removing blacklist finch for dynamic dll changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review fixes. Created 4 years, 5 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: 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 d429dacdffb3c4e8fa08a7e257f32b0eccaad291..70d09fee2eb4861b39d01e61d6f8cb766507756a 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
@@ -29,8 +29,6 @@ namespace safe_browsing {
namespace {
-const wchar_t test_dll[] = L"test_name.dll";
-
// Returns true if a dll with filename |dll_name| is found in |process_report|,
// providing a copy of it in |result|.
bool GetProcessReportDll(
@@ -125,53 +123,6 @@ TEST(SafeBrowsingEnvironmentDataCollectionWinTest, RecordLspFeature) {
FAIL() << "No LSP feature found for " << lsp;
}
-TEST(SafeBrowsingEnvironmentDataCollectionWinTest, CollectDllBlacklistData) {
- // Ensure that CollectDllBlacklistData correctly adds the set of sanitized dll
- // names currently stored in the registry to the report.
- registry_util::RegistryOverrideManager override_manager;
- override_manager.OverrideRegistry(HKEY_CURRENT_USER);
-
- base::win::RegKey blacklist_registry_key(HKEY_CURRENT_USER,
- blacklist::kRegistryFinchListPath,
- KEY_QUERY_VALUE | KEY_SET_VALUE);
-
- // Check that with an empty registry the blacklisted dlls field is left empty.
- ClientIncidentReport_EnvironmentData_Process process_report;
- CollectDllBlacklistData(&process_report);
- EXPECT_EQ(0, process_report.blacklisted_dll_size());
-
- // Check that after adding exactly one dll to the registry it appears in the
- // process report.
- blacklist_registry_key.WriteValue(test_dll, test_dll);
- CollectDllBlacklistData(&process_report);
- ASSERT_EQ(1, process_report.blacklisted_dll_size());
-
- base::string16 process_report_dll =
- base::UTF8ToWide(process_report.blacklisted_dll(0));
- EXPECT_EQ(base::string16(test_dll), process_report_dll);
-
- // Check that if the registry contains the full path to a dll it is properly
- // sanitized before being reported.
- blacklist_registry_key.DeleteValue(test_dll);
- process_report.clear_blacklisted_dll();
-
- base::FilePath path;
- ASSERT_TRUE(PathService::Get(base::DIR_HOME, &path));
- base::string16 input_path =
- path.Append(FILE_PATH_LITERAL("test_path.dll")).value();
-
- std::string path_expected = base::FilePath(FILE_PATH_LITERAL("~"))
- .Append(FILE_PATH_LITERAL("test_path.dll"))
- .AsUTF8Unsafe();
-
- blacklist_registry_key.WriteValue(input_path.c_str(), input_path.c_str());
- CollectDllBlacklistData(&process_report);
-
- ASSERT_EQ(1, process_report.blacklisted_dll_size());
- std::string process_report_path = process_report.blacklisted_dll(0);
- EXPECT_EQ(path_expected, process_report_path);
-}
-
#if !defined(_WIN64)
TEST(SafeBrowsingEnvironmentDataCollectionWinTest, VerifyLoadedModules) {
// Load the test modules.

Powered by Google App Engine
This is Rietveld 408576698