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 <stdint.h> | 5 #include <stdint.h> |
6 #include <windows.h> | 6 #include <windows.h> |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 std::vector<std::string> elf_imports; | 71 std::vector<std::string> elf_imports; |
72 GetImports(dll, &elf_imports); | 72 GetImports(dll, &elf_imports); |
73 | 73 |
74 // Check that ELF has imports. | 74 // Check that ELF has imports. |
75 ASSERT_LT(0u, elf_imports.size()) << "Ensure the chrome_elf_unittests " | 75 ASSERT_LT(0u, elf_imports.size()) << "Ensure the chrome_elf_unittests " |
76 "target was built, instead of chrome_elf_unittests.exe"; | 76 "target was built, instead of chrome_elf_unittests.exe"; |
77 | 77 |
78 static const char* const kValidFilePatterns[] = { | 78 static const char* const kValidFilePatterns[] = { |
79 "KERNEL32.dll", | 79 "KERNEL32.dll", |
80 "MSVC*", | 80 #if defined(COMPONENT_BUILD) |
| 81 "MSVC*.dll", |
| 82 "VCRUNTIME*.dll", |
| 83 "api-ms-win-crt-*.dll", |
| 84 #endif |
81 #if defined(SYZYASAN) | 85 #if defined(SYZYASAN) |
82 "syzyasan_rtl.dll", | 86 "syzyasan_rtl.dll", |
83 #endif | 87 #endif |
84 #if defined(ADDRESS_SANITIZER) && defined(COMPONENT_BUILD) | 88 #if defined(ADDRESS_SANITIZER) && defined(COMPONENT_BUILD) |
85 "clang_rt.asan_dynamic-i386.dll", | 89 "clang_rt.asan_dynamic-i386.dll", |
86 #endif | 90 #endif |
87 "ADVAPI32.dll" | 91 "ADVAPI32.dll" |
88 }; | 92 }; |
89 | 93 |
90 // Make sure all of ELF's imports are in the valid imports list. | 94 // Make sure all of ELF's imports are in the valid imports list. |
(...skipping 22 matching lines...) Expand all Loading... |
113 ASSERT_LT(0u, exe_imports.size()) << "Ensure the chrome_elf_unittests " | 117 ASSERT_LT(0u, exe_imports.size()) << "Ensure the chrome_elf_unittests " |
114 "target was built, instead of chrome_elf_unittests.exe"; | 118 "target was built, instead of chrome_elf_unittests.exe"; |
115 | 119 |
116 // Chrome.exe's first import must be ELF. | 120 // Chrome.exe's first import must be ELF. |
117 EXPECT_EQ("chrome_elf.dll", exe_imports[0]) << | 121 EXPECT_EQ("chrome_elf.dll", exe_imports[0]) << |
118 "Illegal import order in chrome.exe (ensure the chrome_elf_unittest " | 122 "Illegal import order in chrome.exe (ensure the chrome_elf_unittest " |
119 "target was built, instead of just chrome_elf_unittests.exe)"; | 123 "target was built, instead of just chrome_elf_unittests.exe)"; |
120 } | 124 } |
121 | 125 |
122 } // namespace | 126 } // namespace |
OLD | NEW |