OLD | NEW |
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 #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/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "base/win/scoped_variant.h" | 10 #include "base/win/scoped_variant.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 result.Receive(), NULL, NULL)); | 171 result.Receive(), NULL, NULL)); |
172 EXPECT_EQ(VT_I4, result.type()); | 172 EXPECT_EQ(VT_I4, result.type()); |
173 if (result.type() == VT_I4) { | 173 if (result.type() == VT_I4) { |
174 EXPECT_EQ(ready_state, static_cast<int>(V_I4(&result))); | 174 EXPECT_EQ(ready_state, static_cast<int>(V_I4(&result))); |
175 } | 175 } |
176 } | 176 } |
177 } | 177 } |
178 } | 178 } |
179 | 179 |
180 // MockIEEventSinkTest methods | 180 // MockIEEventSinkTest methods |
181 MockIEEventSinkTest::MockIEEventSinkTest() : server_mock_(1337, L"127.0.0.1", | 181 MockIEEventSinkTest::MockIEEventSinkTest() |
182 GetTestDataFolder()) { | 182 : server_mock_(1337, ASCIIToWide(chrome_frame_test::GetLocalIPv4Address()), |
| 183 GetTestDataFolder()) { |
183 loop_.set_snapshot_on_timeout(true); | 184 loop_.set_snapshot_on_timeout(true); |
184 EXPECT_CALL(server_mock_, Get(_, StrCaseEq(L"/favicon.ico"), _)) | 185 EXPECT_CALL(server_mock_, Get(_, StrCaseEq(L"/favicon.ico"), _)) |
185 .WillRepeatedly(SendFast("HTTP/1.1 404 Not Found", "")); | 186 .WillRepeatedly(SendFast("HTTP/1.1 404 Not Found", "")); |
186 } | 187 } |
187 | 188 |
188 MockIEEventSinkTest::MockIEEventSinkTest(int port, const std::wstring& address, | 189 MockIEEventSinkTest::MockIEEventSinkTest(int port, const std::wstring& address, |
189 const FilePath& root_dir) | 190 const FilePath& root_dir) |
190 : server_mock_(port, address, root_dir) { | 191 : server_mock_(port, address, root_dir) { |
191 loop_.set_snapshot_on_timeout(true); | 192 loop_.set_snapshot_on_timeout(true); |
192 EXPECT_CALL(server_mock_, Get(_, StrCaseEq(L"/favicon.ico"), _)) | 193 EXPECT_CALL(server_mock_, Get(_, StrCaseEq(L"/favicon.ico"), _)) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 const std::wstring& relative_path) { | 228 const std::wstring& relative_path) { |
228 return server_mock_.root_dir().Append(relative_path); | 229 return server_mock_.root_dir().Append(relative_path); |
229 } | 230 } |
230 | 231 |
231 std::wstring MockIEEventSinkTest::GetTestUrl( | 232 std::wstring MockIEEventSinkTest::GetTestUrl( |
232 const std::wstring& relative_path) { | 233 const std::wstring& relative_path) { |
233 return server_mock_.Resolve(relative_path.c_str()); | 234 return server_mock_.Resolve(relative_path.c_str()); |
234 } | 235 } |
235 | 236 |
236 } // namespace chrome_frame_test | 237 } // namespace chrome_frame_test |
OLD | NEW |