OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/test/mock_ie_event_sink_test.h" | 5 #include "chrome_frame/test/mock_ie_event_sink_test.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "base/scoped_variant_win.h" | 9 #include "base/win/scoped_variant.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "chrome_frame/test/mock_ie_event_sink_actions.h" | 11 #include "chrome_frame/test/mock_ie_event_sink_actions.h" |
12 | 12 |
13 // Needed for CreateFunctor. | 13 // Needed for CreateFunctor. |
14 #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING | 14 #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING |
15 #include "testing/gmock_mutant.h" | 15 #include "testing/gmock_mutant.h" |
16 | 16 |
17 using testing::_; | 17 using testing::_; |
18 using testing::Cardinality; | 18 using testing::Cardinality; |
19 using testing::Exactly; | 19 using testing::Exactly; |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 153 |
154 void MockIEEventSink::ExpectDocumentReadystate(int ready_state) { | 154 void MockIEEventSink::ExpectDocumentReadystate(int ready_state) { |
155 ScopedComPtr<IWebBrowser2> browser(event_sink_->web_browser2()); | 155 ScopedComPtr<IWebBrowser2> browser(event_sink_->web_browser2()); |
156 EXPECT_TRUE(browser != NULL); | 156 EXPECT_TRUE(browser != NULL); |
157 if (browser) { | 157 if (browser) { |
158 ScopedComPtr<IDispatch> document; | 158 ScopedComPtr<IDispatch> document; |
159 browser->get_Document(document.Receive()); | 159 browser->get_Document(document.Receive()); |
160 EXPECT_TRUE(document != NULL); | 160 EXPECT_TRUE(document != NULL); |
161 if (document) { | 161 if (document) { |
162 DISPPARAMS params = { 0 }; | 162 DISPPARAMS params = { 0 }; |
163 ScopedVariant result; | 163 base::win::ScopedVariant result; |
164 EXPECT_HRESULT_SUCCEEDED(document->Invoke(DISPID_READYSTATE, IID_NULL, | 164 EXPECT_HRESULT_SUCCEEDED(document->Invoke(DISPID_READYSTATE, IID_NULL, |
165 LOCALE_USER_DEFAULT, DISPATCH_PROPERTYGET, ¶ms, | 165 LOCALE_USER_DEFAULT, DISPATCH_PROPERTYGET, ¶ms, |
166 result.Receive(), NULL, NULL)); | 166 result.Receive(), NULL, NULL)); |
167 EXPECT_EQ(VT_I4, result.type()); | 167 EXPECT_EQ(VT_I4, result.type()); |
168 if (result.type() == VT_I4) { | 168 if (result.type() == VT_I4) { |
169 EXPECT_EQ(ready_state, static_cast<int>(V_I4(&result))); | 169 EXPECT_EQ(ready_state, static_cast<int>(V_I4(&result))); |
170 } | 170 } |
171 } | 171 } |
172 } | 172 } |
173 } | 173 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 const std::wstring& relative_path) { | 207 const std::wstring& relative_path) { |
208 return server_mock_.root_dir().Append(relative_path); | 208 return server_mock_.root_dir().Append(relative_path); |
209 } | 209 } |
210 | 210 |
211 std::wstring MockIEEventSinkTest::GetTestUrl( | 211 std::wstring MockIEEventSinkTest::GetTestUrl( |
212 const std::wstring& relative_path) { | 212 const std::wstring& relative_path) { |
213 return server_mock_.Resolve(relative_path.c_str()); | 213 return server_mock_.Resolve(relative_path.c_str()); |
214 } | 214 } |
215 | 215 |
216 } // namespace chrome_frame_test | 216 } // namespace chrome_frame_test |
217 | |
OLD | NEW |