OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/safe_browsing/incident_reporting/environment_data_colle
ction_win.h" | 5 #include "chrome/browser/safe_browsing/incident_reporting/environment_data_colle
ction_win.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 if (DllEntryContainsLspFeature(process_report, lsp)) | 120 if (DllEntryContainsLspFeature(process_report, lsp)) |
121 return; | 121 return; |
122 | 122 |
123 FAIL() << "No LSP feature found for " << lsp; | 123 FAIL() << "No LSP feature found for " << lsp; |
124 } | 124 } |
125 | 125 |
126 TEST(SafeBrowsingEnvironmentDataCollectionWinTest, CollectDllBlacklistData) { | 126 TEST(SafeBrowsingEnvironmentDataCollectionWinTest, CollectDllBlacklistData) { |
127 // Ensure that CollectDllBlacklistData correctly adds the set of sanitized dll | 127 // Ensure that CollectDllBlacklistData correctly adds the set of sanitized dll |
128 // names currently stored in the registry to the report. | 128 // names currently stored in the registry to the report. |
129 registry_util::RegistryOverrideManager override_manager; | 129 registry_util::RegistryOverrideManager override_manager; |
130 override_manager.OverrideRegistry(HKEY_CURRENT_USER, L"safe_browsing_test"); | 130 override_manager.OverrideRegistry(HKEY_CURRENT_USER); |
131 | 131 |
132 base::win::RegKey blacklist_registry_key(HKEY_CURRENT_USER, | 132 base::win::RegKey blacklist_registry_key(HKEY_CURRENT_USER, |
133 blacklist::kRegistryFinchListPath, | 133 blacklist::kRegistryFinchListPath, |
134 KEY_QUERY_VALUE | KEY_SET_VALUE); | 134 KEY_QUERY_VALUE | KEY_SET_VALUE); |
135 | 135 |
136 // Check that with an empty registry the blacklisted dlls field is left empty. | 136 // Check that with an empty registry the blacklisted dlls field is left empty. |
137 safe_browsing::ClientIncidentReport_EnvironmentData_Process process_report; | 137 safe_browsing::ClientIncidentReport_EnvironmentData_Process process_report; |
138 safe_browsing::CollectDllBlacklistData(&process_report); | 138 safe_browsing::CollectDllBlacklistData(&process_report); |
139 EXPECT_EQ(0, process_report.blacklisted_dll_size()); | 139 EXPECT_EQ(0, process_report.blacklisted_dll_size()); |
140 | 140 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 EXPECT_EQ(base::WideToUTF8(std::wstring(safe_browsing::kTestDllNames[0])), | 210 EXPECT_EQ(base::WideToUTF8(std::wstring(safe_browsing::kTestDllNames[0])), |
211 process_report.module_state(0).name()); | 211 process_report.module_state(0).name()); |
212 EXPECT_EQ( | 212 EXPECT_EQ( |
213 safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState:: | 213 safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState:: |
214 MODULE_STATE_MODIFIED, | 214 MODULE_STATE_MODIFIED, |
215 process_report.module_state(0).modified_state()); | 215 process_report.module_state(0).modified_state()); |
216 EXPECT_EQ(1, process_report.module_state(0).modified_export_size()); | 216 EXPECT_EQ(1, process_report.module_state(0).modified_export_size()); |
217 EXPECT_EQ(std::string(safe_browsing::kTestExportName), | 217 EXPECT_EQ(std::string(safe_browsing::kTestExportName), |
218 process_report.module_state(0).modified_export(0)); | 218 process_report.module_state(0).modified_export(0)); |
219 } | 219 } |
OLD | NEW |