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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 // Find out how many dlls were blocked before the test starts. | 198 // Find out how many dlls were blocked before the test starts. |
199 TestDll_SuccessfullyBlocked(NULL, &num_initially_blocked_); | 199 TestDll_SuccessfullyBlocked(NULL, &num_initially_blocked_); |
200 } | 200 } |
201 | 201 |
202 void TearDown() override { | 202 void TearDown() override { |
203 TestDll_RemoveDllFromBlacklist(kTestDllName1); | 203 TestDll_RemoveDllFromBlacklist(kTestDllName1); |
204 TestDll_RemoveDllFromBlacklist(kTestDllName2); | 204 TestDll_RemoveDllFromBlacklist(kTestDllName2); |
205 TestDll_RemoveDllFromBlacklist(kTestDllName3); | 205 TestDll_RemoveDllFromBlacklist(kTestDllName3); |
206 } | 206 } |
207 | |
208 // A scoped temporary directory to be destroyed with this test. | |
209 base::ScopedTempDir reg_override_dir_; | |
210 }; | 207 }; |
211 | 208 |
212 TEST_F(BlacklistTest, Beacon) { | 209 TEST_F(BlacklistTest, Beacon) { |
213 // Ensure that the beacon state starts off 'running' for this version. | 210 // Ensure that the beacon state starts off 'running' for this version. |
214 LONG result = blacklist_registry_key_->WriteValue( | 211 LONG result = blacklist_registry_key_->WriteValue( |
215 blacklist::kBeaconState, blacklist::BLACKLIST_SETUP_RUNNING); | 212 blacklist::kBeaconState, blacklist::BLACKLIST_SETUP_RUNNING); |
216 EXPECT_EQ(ERROR_SUCCESS, result); | 213 EXPECT_EQ(ERROR_SUCCESS, result); |
217 | 214 |
218 result = blacklist_registry_key_->WriteValue(blacklist::kBeaconVersion, | 215 result = blacklist_registry_key_->WriteValue(blacklist::kBeaconVersion, |
219 TEXT(CHROME_VERSION_STRING)); | 216 TEXT(CHROME_VERSION_STRING)); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 &blacklist_state); | 379 &blacklist_state); |
383 EXPECT_EQ(blacklist_state, blacklist::BLACKLIST_SETUP_RUNNING); | 380 EXPECT_EQ(blacklist_state, blacklist::BLACKLIST_SETUP_RUNNING); |
384 | 381 |
385 DWORD attempt_count = blacklist::kBeaconMaxAttempts; | 382 DWORD attempt_count = blacklist::kBeaconMaxAttempts; |
386 blacklist_registry_key_->ReadValueDW(blacklist::kBeaconAttemptCount, | 383 blacklist_registry_key_->ReadValueDW(blacklist::kBeaconAttemptCount, |
387 &attempt_count); | 384 &attempt_count); |
388 EXPECT_EQ(static_cast<DWORD>(0), attempt_count); | 385 EXPECT_EQ(static_cast<DWORD>(0), attempt_count); |
389 } | 386 } |
390 | 387 |
391 } // namespace | 388 } // namespace |
OLD | NEW |