Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: chrome_frame/test/mock_ie_event_sink_test.h

Issue 9838058: More non-debug logging in Chrome Frame tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copyright and formatting tweaks Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome_frame/test/ie_event_sink.cc ('k') | chrome_frame/test/mock_ie_event_sink_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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>
(...skipping 27 matching lines...) Expand all
38 class MockIEEventSink : public IEEventListener { 38 class MockIEEventSink : public IEEventListener {
39 public: 39 public:
40 MockIEEventSink() { 40 MockIEEventSink() {
41 CComObject<IEEventSink>::CreateInstance(&event_sink_); 41 CComObject<IEEventSink>::CreateInstance(&event_sink_);
42 event_sink_->AddRef(); 42 event_sink_->AddRef();
43 } 43 }
44 44
45 ~MockIEEventSink() { 45 ~MockIEEventSink() {
46 Detach(); 46 Detach();
47 int reference_count = event_sink_->reference_count(); 47 int reference_count = event_sink_->reference_count();
48 DLOG_IF(ERROR, reference_count != 1) 48 LOG_IF(ERROR, reference_count != 1)
49 << "Event sink is still referenced externally: ref count = " 49 << "Event sink is still referenced externally: ref count = "
50 << reference_count; 50 << reference_count;
51 event_sink_->Release(); 51 event_sink_->Release();
52 } 52 }
53 53
54 // Override IEEventListener methods. 54 // Override IEEventListener methods.
55 MOCK_METHOD7(OnBeforeNavigate2, void (IDispatch* dispatch, // NOLINT 55 MOCK_METHOD7(OnBeforeNavigate2, void (IDispatch* dispatch, // NOLINT
56 VARIANT* url, 56 VARIANT* url,
57 VARIANT* flags, 57 VARIANT* flags,
58 VARIANT* target_frame_name, 58 VARIANT* target_frame_name,
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 public: 160 public:
161 MockPropertyNotifySinkListener() : cookie_(0), sink_(NULL) { 161 MockPropertyNotifySinkListener() : cookie_(0), sink_(NULL) {
162 CComObject<PropertyNotifySinkImpl>::CreateInstance(&sink_); 162 CComObject<PropertyNotifySinkImpl>::CreateInstance(&sink_);
163 sink_->AddRef(); 163 sink_->AddRef();
164 sink_->set_listener(this); 164 sink_->set_listener(this);
165 } 165 }
166 166
167 ~MockPropertyNotifySinkListener() { 167 ~MockPropertyNotifySinkListener() {
168 Detach(); 168 Detach();
169 sink_->set_listener(NULL); 169 sink_->set_listener(NULL);
170 DLOG_IF(ERROR, sink_->m_dwRef != 1) 170 LOG_IF(ERROR, sink_->m_dwRef != 1)
171 << "Event sink is still referenced externally: ref count = " 171 << "Event sink is still referenced externally: ref count = "
172 << sink_->m_dwRef; 172 << sink_->m_dwRef;
173 sink_->Release(); 173 sink_->Release();
174 } 174 }
175 175
176 // Override PropertyNotifySinkListener methods. 176 // Override PropertyNotifySinkListener methods.
177 MOCK_METHOD1(OnChanged, void (DISPID dispid)); // NOLINT 177 MOCK_METHOD1(OnChanged, void (DISPID dispid)); // NOLINT
178 178
179 bool Attach(IUnknown* obj) { 179 bool Attach(IUnknown* obj) {
180 DCHECK_EQ(cookie_, 0UL); 180 DCHECK_EQ(cookie_, 0UL);
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 testing::StrictMock<MockIEEventSink> ie_mock_; 358 testing::StrictMock<MockIEEventSink> ie_mock_;
359 testing::StrictMock<MockWebServer> server_mock_; 359 testing::StrictMock<MockWebServer> server_mock_;
360 scoped_refptr<HungCOMCallDetector> hung_call_detector_; 360 scoped_refptr<HungCOMCallDetector> hung_call_detector_;
361 private: 361 private:
362 DISALLOW_COPY_AND_ASSIGN(MockIEEventSinkTest); 362 DISALLOW_COPY_AND_ASSIGN(MockIEEventSinkTest);
363 }; 363 };
364 364
365 } // namespace chrome_frame_test 365 } // namespace chrome_frame_test
366 366
367 #endif // CHROME_FRAME_TEST_MOCK_IE_EVENT_SINK_TEST_H_ 367 #endif // CHROME_FRAME_TEST_MOCK_IE_EVENT_SINK_TEST_H_
OLDNEW
« no previous file with comments | « chrome_frame/test/ie_event_sink.cc ('k') | chrome_frame/test/mock_ie_event_sink_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698