| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/environment.h" | 5 #include "base/environment.h" |
| 6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/i18n/case_conversion.h" | 8 #include "base/i18n/case_conversion.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/scoped_native_library.h" | 10 #include "base/scoped_native_library.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 __declspec(dllimport) bool TestDll_SuccessfullyBlocked( | 40 __declspec(dllimport) bool TestDll_SuccessfullyBlocked( |
| 41 const wchar_t** blocked_dlls, | 41 const wchar_t** blocked_dlls, |
| 42 int* size); | 42 int* size); |
| 43 } | 43 } |
| 44 | 44 |
| 45 namespace { | 45 namespace { |
| 46 | 46 |
| 47 class BlacklistTest : public testing::Test { | 47 class BlacklistTest : public testing::Test { |
| 48 protected: | 48 protected: |
| 49 BlacklistTest() : override_manager_() { | 49 BlacklistTest() : override_manager_() { |
| 50 override_manager_.OverrideRegistry(HKEY_CURRENT_USER, L"beacon_test"); | 50 override_manager_.OverrideRegistry(HKEY_CURRENT_USER); |
| 51 } | 51 } |
| 52 | 52 |
| 53 scoped_ptr<base::win::RegKey> blacklist_registry_key_; | 53 scoped_ptr<base::win::RegKey> blacklist_registry_key_; |
| 54 registry_util::RegistryOverrideManager override_manager_; | 54 registry_util::RegistryOverrideManager override_manager_; |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 virtual void SetUp() { | 57 virtual void SetUp() { |
| 58 // Force an import from blacklist_test_main_dll. | 58 // Force an import from blacklist_test_main_dll. |
| 59 InitBlacklistTestDll(); | 59 InitBlacklistTestDll(); |
| 60 blacklist_registry_key_.reset( | 60 blacklist_registry_key_.reset( |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 &blacklist_state); | 327 &blacklist_state); |
| 328 EXPECT_EQ(blacklist_state, blacklist::BLACKLIST_SETUP_RUNNING); | 328 EXPECT_EQ(blacklist_state, blacklist::BLACKLIST_SETUP_RUNNING); |
| 329 | 329 |
| 330 DWORD attempt_count = blacklist::kBeaconMaxAttempts; | 330 DWORD attempt_count = blacklist::kBeaconMaxAttempts; |
| 331 blacklist_registry_key_->ReadValueDW(blacklist::kBeaconAttemptCount, | 331 blacklist_registry_key_->ReadValueDW(blacklist::kBeaconAttemptCount, |
| 332 &attempt_count); | 332 &attempt_count); |
| 333 EXPECT_EQ(static_cast<DWORD>(0), attempt_count); | 333 EXPECT_EQ(static_cast<DWORD>(0), attempt_count); |
| 334 } | 334 } |
| 335 | 335 |
| 336 } // namespace | 336 } // namespace |
| OLD | NEW |