OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome_frame/vtable_patch_manager.h" | 5 #include "chrome_frame/vtable_patch_manager.h" |
6 | 6 |
7 #include <unknwn.h> | 7 #include <unknwn.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
13 #include "base/win/scoped_handle.h" | 13 #include "base/win/scoped_handle.h" |
| 14 #include "gmock/gmock.h" |
14 #include "gtest/gtest.h" | 15 #include "gtest/gtest.h" |
15 #include "gmock/gmock.h" | |
16 | 16 |
17 namespace { | 17 namespace { |
18 // GMock names we use. | 18 // GMock names we use. |
19 using testing::_; | 19 using testing::_; |
20 using testing::Return; | 20 using testing::Return; |
21 | 21 |
22 class MockClassFactory : public IClassFactory { | 22 class MockClassFactory : public IClassFactory { |
23 public: | 23 public: |
24 MOCK_METHOD2_WITH_CALLTYPE(__stdcall, QueryInterface, | 24 MOCK_METHOD2_WITH_CALLTYPE(__stdcall, QueryInterface, |
25 HRESULT(REFIID riid, void **object)); | 25 HRESULT(REFIID riid, void **object)); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 284 |
285 // Release the patch lock and wait on the event. | 285 // Release the patch lock and wait on the event. |
286 vtable_patch::patch_lock_.Release(); | 286 vtable_patch::patch_lock_.Release(); |
287 EXPECT_EQ(WAIT_OBJECT_0, ::WaitForSingleObject(event.Get(), INFINITE)); | 287 EXPECT_EQ(WAIT_OBJECT_0, ::WaitForSingleObject(event.Get(), INFINITE)); |
288 | 288 |
289 // Verify that unpatching took place. | 289 // Verify that unpatching took place. |
290 EXPECT_CALL(factory_, LockServer(TRUE)) | 290 EXPECT_CALL(factory_, LockServer(TRUE)) |
291 .WillOnce(Return(S_FALSE)); | 291 .WillOnce(Return(S_FALSE)); |
292 EXPECT_EQ(S_FALSE, factory_.LockServer(TRUE)); | 292 EXPECT_EQ(S_FALSE, factory_.LockServer(TRUE)); |
293 } | 293 } |
OLD | NEW |