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" |
11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "base/test/test_reg_util_win.h" | 14 #include "base/test/test_reg_util_win.h" |
15 #include "base/win/registry.h" | 15 #include "base/win/registry.h" |
16 #include "chrome_elf/blacklist/blacklist.h" | 16 #include "chrome_elf/blacklist/blacklist.h" |
17 #include "chrome_elf/blacklist/test/blacklist_test_main_dll.h" | 17 #include "chrome_elf/blacklist/test/blacklist_test_main_dll.h" |
| 18 #include "chrome_elf/chrome_elf_constants.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
19 #include "version.h" // NOLINT | 20 #include "version.h" // NOLINT |
20 | 21 |
21 const wchar_t kTestDllName1[] = L"blacklist_test_dll_1.dll"; | 22 const wchar_t kTestDllName1[] = L"blacklist_test_dll_1.dll"; |
22 const wchar_t kTestDllName2[] = L"blacklist_test_dll_2.dll"; | 23 const wchar_t kTestDllName2[] = L"blacklist_test_dll_2.dll"; |
23 const wchar_t kTestDllName3[] = L"blacklist_test_dll_3.dll"; | 24 const wchar_t kTestDllName3[] = L"blacklist_test_dll_3.dll"; |
24 | 25 |
25 const wchar_t kDll2Beacon[] = L"{F70A0100-2889-4629-9B44-610FE5C73231}"; | 26 const wchar_t kDll2Beacon[] = L"{F70A0100-2889-4629-9B44-610FE5C73231}"; |
26 const wchar_t kDll3Beacon[] = L"{9E056AEC-169E-400c-B2D0-5A07E3ACE2EB}"; | 27 const wchar_t kDll3Beacon[] = L"{9E056AEC-169E-400c-B2D0-5A07E3ACE2EB}"; |
27 | 28 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 EXPECT_TRUE(TestDll_AddDllToBlacklist(uppercase_name.c_str())); | 164 EXPECT_TRUE(TestDll_AddDllToBlacklist(uppercase_name.c_str())); |
164 base::ScopedNativeLibrary dll_blacklisted_different_case( | 165 base::ScopedNativeLibrary dll_blacklisted_different_case( |
165 current_dir.Append(test_data[i].dll_name)); | 166 current_dir.Append(test_data[i].dll_name)); |
166 EXPECT_FALSE(dll_blacklisted_different_case.is_valid()); | 167 EXPECT_FALSE(dll_blacklisted_different_case.is_valid()); |
167 EXPECT_EQ(0u, ::GetEnvironmentVariable(test_data[i].dll_beacon, NULL, 0)); | 168 EXPECT_EQ(0u, ::GetEnvironmentVariable(test_data[i].dll_beacon, NULL, 0)); |
168 dll_blacklisted_different_case.Reset(NULL); | 169 dll_blacklisted_different_case.Reset(NULL); |
169 | 170 |
170 EXPECT_TRUE(TestDll_RemoveDllFromBlacklist(uppercase_name.c_str())); | 171 EXPECT_TRUE(TestDll_RemoveDllFromBlacklist(uppercase_name.c_str())); |
171 } | 172 } |
172 } | 173 } |
OLD | NEW |