| 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/win/chrome_elf_init.h" | 5 #include "chrome/browser/win/chrome_elf_init.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 class ChromeBlacklistTrialTest : public testing::Test { | 25 class ChromeBlacklistTrialTest : public testing::Test { |
| 26 protected: | 26 protected: |
| 27 ChromeBlacklistTrialTest() {} | 27 ChromeBlacklistTrialTest() {} |
| 28 ~ChromeBlacklistTrialTest() override {} | 28 ~ChromeBlacklistTrialTest() override {} |
| 29 | 29 |
| 30 void SetUp() override { | 30 void SetUp() override { |
| 31 testing::Test::SetUp(); | 31 testing::Test::SetUp(); |
| 32 | 32 |
| 33 override_manager_.OverrideRegistry(HKEY_CURRENT_USER); | 33 ASSERT_NO_FATAL_FAILURE( |
| 34 override_manager_.OverrideRegistry(HKEY_CURRENT_USER)); |
| 34 | 35 |
| 35 blacklist_registry_key_.reset( | 36 blacklist_registry_key_.reset( |
| 36 new base::win::RegKey(HKEY_CURRENT_USER, | 37 new base::win::RegKey(HKEY_CURRENT_USER, |
| 37 blacklist::kRegistryBeaconPath, | 38 blacklist::kRegistryBeaconPath, |
| 38 KEY_QUERY_VALUE | KEY_SET_VALUE)); | 39 KEY_QUERY_VALUE | KEY_SET_VALUE)); |
| 39 } | 40 } |
| 40 | 41 |
| 41 DWORD GetBlacklistState() { | 42 DWORD GetBlacklistState() { |
| 42 DWORD blacklist_state = blacklist::BLACKLIST_STATE_MAX; | 43 DWORD blacklist_state = blacklist::BLACKLIST_STATE_MAX; |
| 43 blacklist_registry_key_->ReadValueDW(blacklist::kBeaconState, | 44 blacklist_registry_key_->ReadValueDW(blacklist::kBeaconState, |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 ASSERT_EQ(expected_version, GetBlacklistVersion()); | 150 ASSERT_EQ(expected_version, GetBlacklistVersion()); |
| 150 | 151 |
| 151 // The counter should be reset. | 152 // The counter should be reset. |
| 152 DWORD attempt_count = blacklist::kBeaconMaxAttempts; | 153 DWORD attempt_count = blacklist::kBeaconMaxAttempts; |
| 153 blacklist_registry_key_->ReadValueDW(blacklist::kBeaconAttemptCount, | 154 blacklist_registry_key_->ReadValueDW(blacklist::kBeaconAttemptCount, |
| 154 &attempt_count); | 155 &attempt_count); |
| 155 ASSERT_EQ(static_cast<DWORD>(0), attempt_count); | 156 ASSERT_EQ(static_cast<DWORD>(0), attempt_count); |
| 156 } | 157 } |
| 157 | 158 |
| 158 } // namespace | 159 } // namespace |
| OLD | NEW |