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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 virtual void TearDown() { | 66 virtual void TearDown() { |
67 TestDll_RemoveDllFromBlacklist(kTestDllName1); | 67 TestDll_RemoveDllFromBlacklist(kTestDllName1); |
68 TestDll_RemoveDllFromBlacklist(kTestDllName2); | 68 TestDll_RemoveDllFromBlacklist(kTestDllName2); |
69 TestDll_RemoveDllFromBlacklist(kTestDllName3); | 69 TestDll_RemoveDllFromBlacklist(kTestDllName3); |
70 } | 70 } |
71 }; | 71 }; |
72 | 72 |
73 struct TestData { | 73 struct TestData { |
74 const wchar_t* dll_name; | 74 const wchar_t* dll_name; |
75 const wchar_t* dll_beacon; | 75 const wchar_t* dll_beacon; |
76 } test_data[] = {{kTestDllName2, kDll2Beacon}, {kTestDllName3, kDll3Beacon}}; | 76 } test_data[] = { |
| 77 {kTestDllName2, kDll2Beacon}, |
| 78 #if !defined(_WIN64) |
| 79 // The third test dll is special in that it does not contain an export |
| 80 // table. This prevents SafeGetImageInfo from extracting the name from there |
| 81 // AND for some reason NtQueryVirtualMemory with MemorySectionName returns |
| 82 // STATUS_ACCESS_VIOLATION in 64 bit builds for reasons still unknown. |
| 83 // http://crbug.com/397137 |
| 84 {kTestDllName3, kDll3Beacon} |
| 85 #endif |
| 86 }; |
77 | 87 |
78 TEST_F(BlacklistTest, Beacon) { | 88 TEST_F(BlacklistTest, Beacon) { |
79 // Ensure that the beacon state starts off 'running' for this version. | 89 // Ensure that the beacon state starts off 'running' for this version. |
80 LONG result = blacklist_registry_key_->WriteValue( | 90 LONG result = blacklist_registry_key_->WriteValue( |
81 blacklist::kBeaconState, blacklist::BLACKLIST_SETUP_RUNNING); | 91 blacklist::kBeaconState, blacklist::BLACKLIST_SETUP_RUNNING); |
82 EXPECT_EQ(ERROR_SUCCESS, result); | 92 EXPECT_EQ(ERROR_SUCCESS, result); |
83 | 93 |
84 result = blacklist_registry_key_->WriteValue(blacklist::kBeaconVersion, | 94 result = blacklist_registry_key_->WriteValue(blacklist::kBeaconVersion, |
85 TEXT(CHROME_VERSION_STRING)); | 95 TEXT(CHROME_VERSION_STRING)); |
86 EXPECT_EQ(ERROR_SUCCESS, result); | 96 EXPECT_EQ(ERROR_SUCCESS, result); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 &blacklist_state); | 327 &blacklist_state); |
318 EXPECT_EQ(blacklist_state, blacklist::BLACKLIST_SETUP_RUNNING); | 328 EXPECT_EQ(blacklist_state, blacklist::BLACKLIST_SETUP_RUNNING); |
319 | 329 |
320 DWORD attempt_count = blacklist::kBeaconMaxAttempts; | 330 DWORD attempt_count = blacklist::kBeaconMaxAttempts; |
321 blacklist_registry_key_->ReadValueDW(blacklist::kBeaconAttemptCount, | 331 blacklist_registry_key_->ReadValueDW(blacklist::kBeaconAttemptCount, |
322 &attempt_count); | 332 &attempt_count); |
323 EXPECT_EQ(static_cast<DWORD>(0), attempt_count); | 333 EXPECT_EQ(static_cast<DWORD>(0), attempt_count); |
324 } | 334 } |
325 | 335 |
326 } // namespace | 336 } // namespace |
OLD | NEW |