OLD | NEW |
1 // Copyright (c) 2010 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 #ifndef CHROME_FRAME_TEST_MOCK_IE_EVENT_SINK_TEST_H_ | 5 #ifndef CHROME_FRAME_TEST_MOCK_IE_EVENT_SINK_TEST_H_ |
6 #define CHROME_FRAME_TEST_MOCK_IE_EVENT_SINK_TEST_H_ | 6 #define CHROME_FRAME_TEST_MOCK_IE_EVENT_SINK_TEST_H_ |
7 | 7 |
8 #include <atlbase.h> | 8 #include <atlbase.h> |
9 #include <atlcom.h> | 9 #include <atlcom.h> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 DCHECK_NE(cookie_, 0UL); | 196 DCHECK_NE(cookie_, 0UL); |
197 AtlUnadvise(event_source_, IID_IPropertyNotifySink, cookie_); | 197 AtlUnadvise(event_source_, IID_IPropertyNotifySink, cookie_); |
198 event_source_.Release(); | 198 event_source_.Release(); |
199 cookie_ = 0; | 199 cookie_ = 0; |
200 } | 200 } |
201 } | 201 } |
202 | 202 |
203 private: | 203 private: |
204 CComObject<PropertyNotifySinkImpl>* sink_; | 204 CComObject<PropertyNotifySinkImpl>* sink_; |
205 DWORD cookie_; | 205 DWORD cookie_; |
206 ScopedComPtr<IUnknown> event_source_; | 206 base::win::ScopedComPtr<IUnknown> event_source_; |
207 }; | 207 }; |
208 | 208 |
209 // Allows tests to observe when processes exit. | 209 // Allows tests to observe when processes exit. |
210 class MockObjectWatcherDelegate : public base::win::ObjectWatcher::Delegate { | 210 class MockObjectWatcherDelegate : public base::win::ObjectWatcher::Delegate { |
211 public: | 211 public: |
212 // base::win::ObjectWatcher::Delegate implementation | 212 // base::win::ObjectWatcher::Delegate implementation |
213 MOCK_METHOD1(OnObjectSignaled, void (HANDLE process_handle)); // NOLINT | 213 MOCK_METHOD1(OnObjectSignaled, void (HANDLE process_handle)); // NOLINT |
214 | 214 |
215 virtual ~MockObjectWatcherDelegate() { | 215 virtual ~MockObjectWatcherDelegate() { |
216 // Would be nice to free them when OnObjectSignaled is called, too, but | 216 // Would be nice to free them when OnObjectSignaled is called, too, but |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 testing::StrictMock<MockIEEventSink> ie_mock_; | 332 testing::StrictMock<MockIEEventSink> ie_mock_; |
333 testing::StrictMock<MockWebServer> server_mock_; | 333 testing::StrictMock<MockWebServer> server_mock_; |
334 scoped_refptr<HungCOMCallDetector> hung_call_detector_; | 334 scoped_refptr<HungCOMCallDetector> hung_call_detector_; |
335 private: | 335 private: |
336 DISALLOW_COPY_AND_ASSIGN(MockIEEventSinkTest); | 336 DISALLOW_COPY_AND_ASSIGN(MockIEEventSinkTest); |
337 }; | 337 }; |
338 | 338 |
339 } // namespace chrome_frame_test | 339 } // namespace chrome_frame_test |
340 | 340 |
341 #endif // CHROME_FRAME_TEST_MOCK_IE_EVENT_SINK_TEST_H_ | 341 #endif // CHROME_FRAME_TEST_MOCK_IE_EVENT_SINK_TEST_H_ |
OLD | NEW |