Chromium Code Reviews| Index: chrome_elf/elf_imports_unittest.cc |
| diff --git a/chrome_elf/elf_imports_unittest.cc b/chrome_elf/elf_imports_unittest.cc |
| index 8c3527a13858f5c2e476b3efbfb3655e400ea7d9..8a3c851490878072811e923eb2d655690709ac3f 100644 |
| --- a/chrome_elf/elf_imports_unittest.cc |
| +++ b/chrome_elf/elf_imports_unittest.cc |
| @@ -107,6 +107,20 @@ TEST_F(ELFImportsTest, ChromeElfSanityCheck) { |
| ASSERT_TRUE(match) << "Illegal import in chrome_elf.dll: " << import; |
| } |
| } |
| +TEST_F(ELFImportsTest, ChromeElfLoadSanityTest) { |
| + base::FilePath dll; |
| + ASSERT_TRUE(PathService::Get(base::DIR_EXE, &dll)); |
| + dll = dll.Append(L"chrome_elf.dll"); |
| + |
| + // We don't expect user32 to be loaded in chrome_elf_unittests. |
| + EXPECT_EQ(nullptr, ::GetModuleHandle(L"user32.dll")); |
|
robertshield
2016/06/20 16:59:54
Can you expand the comment here to explicitly stat
ananta
2016/06/20 19:08:03
Done.
|
| + |
| + HMODULE chrome_elf_module_handle = ::LoadLibrary(dll.value().c_str()); |
| + EXPECT_TRUE(chrome_elf_module_handle != nullptr); |
| + // Loading chrome_elf.dll should not load user32.dll |
| + EXPECT_EQ(nullptr, ::GetModuleHandle(L"user32.dll")); |
| + EXPECT_TRUE(!!::FreeLibrary(chrome_elf_module_handle)); |
| +} |
| #endif // NDEBUG |
| TEST_F(ELFImportsTest, ChromeExeSanityCheck) { |