OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <windows.h> | 5 #include <windows.h> |
6 #if defined(_WIN32_WINNT_WIN8) && _MSC_VER < 1700 | |
7 // The Windows 8 SDK defines FACILITY_VISUALCPP in winerror.h, and in | |
8 // delayimp.h previous to VS2012. | |
9 #undef FACILITY_VISUALCPP | |
10 #endif | |
11 #include <DelayIMP.h> | 6 #include <DelayIMP.h> |
12 | 7 |
13 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
14 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
15 #include "base/scoped_native_library.h" | 10 #include "base/scoped_native_library.h" |
16 #include "chrome/app/delay_load_hook_win.h" | 11 #include "chrome/app/delay_load_hook_win.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
18 | 13 |
19 namespace { | 14 namespace { |
20 | 15 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 TEST_F(ChromeDelayLoadHookTest, IgnoresUnhandledNotifications) { | 76 TEST_F(ChromeDelayLoadHookTest, IgnoresUnhandledNotifications) { |
82 SetupInfo("kernel32-delay.dll"); | 77 SetupInfo("kernel32-delay.dll"); |
83 | 78 |
84 // The hook should ignore all notifications but the preload notifications. | 79 // The hook should ignore all notifications but the preload notifications. |
85 EXPECT_TRUE(ChromeDelayLoadHook(dliNoteStartProcessing, &info_) == NULL); | 80 EXPECT_TRUE(ChromeDelayLoadHook(dliNoteStartProcessing, &info_) == NULL); |
86 EXPECT_TRUE(ChromeDelayLoadHook(dliNotePreGetProcAddress, &info_) == NULL); | 81 EXPECT_TRUE(ChromeDelayLoadHook(dliNotePreGetProcAddress, &info_) == NULL); |
87 EXPECT_TRUE(ChromeDelayLoadHook(dliNoteEndProcessing, &info_) == NULL); | 82 EXPECT_TRUE(ChromeDelayLoadHook(dliNoteEndProcessing, &info_) == NULL); |
88 EXPECT_TRUE(ChromeDelayLoadHook(dliFailLoadLib, &info_) == NULL); | 83 EXPECT_TRUE(ChromeDelayLoadHook(dliFailLoadLib, &info_) == NULL); |
89 EXPECT_TRUE(ChromeDelayLoadHook(dliFailGetProc, &info_) == NULL); | 84 EXPECT_TRUE(ChromeDelayLoadHook(dliFailGetProc, &info_) == NULL); |
90 } | 85 } |
OLD | NEW |