| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 // MockIEEventSinkTest methods | 180 // MockIEEventSinkTest methods |
| 181 MockIEEventSinkTest::MockIEEventSinkTest() | 181 MockIEEventSinkTest::MockIEEventSinkTest() |
| 182 : server_mock_(1337, ASCIIToWide(chrome_frame_test::GetLocalIPv4Address()), | 182 : server_mock_(1337, ASCIIToWide(chrome_frame_test::GetLocalIPv4Address()), |
| 183 GetTestDataFolder()) { | 183 GetTestDataFolder()) { |
| 184 loop_.set_snapshot_on_timeout(true); | 184 loop_.set_snapshot_on_timeout(true); |
| 185 EXPECT_CALL(server_mock_, Get(_, StrCaseEq(L"/favicon.ico"), _)) | 185 EXPECT_CALL(server_mock_, Get(_, StrCaseEq(L"/favicon.ico"), _)) |
| 186 .WillRepeatedly(SendFast("HTTP/1.1 404 Not Found", "")); | 186 .WillRepeatedly(SendFast("HTTP/1.1 404 Not Found", "")); |
| 187 } | 187 } |
| 188 | 188 |
| 189 MockIEEventSinkTest::MockIEEventSinkTest(int port, const std::wstring& address, | 189 MockIEEventSinkTest::MockIEEventSinkTest(int port, const std::wstring& address, |
| 190 const FilePath& root_dir) | 190 const base::FilePath& root_dir) |
| 191 : server_mock_(port, address, root_dir) { | 191 : server_mock_(port, address, root_dir) { |
| 192 loop_.set_snapshot_on_timeout(true); | 192 loop_.set_snapshot_on_timeout(true); |
| 193 EXPECT_CALL(server_mock_, Get(_, StrCaseEq(L"/favicon.ico"), _)) | 193 EXPECT_CALL(server_mock_, Get(_, StrCaseEq(L"/favicon.ico"), _)) |
| 194 .WillRepeatedly(SendFast("HTTP/1.1 404 Not Found", "")); | 194 .WillRepeatedly(SendFast("HTTP/1.1 404 Not Found", "")); |
| 195 } | 195 } |
| 196 | 196 |
| 197 void MockIEEventSinkTest::LaunchIEAndNavigate(const std::wstring& url) { | 197 void MockIEEventSinkTest::LaunchIEAndNavigate(const std::wstring& url) { |
| 198 LaunchIENavigateAndLoop(url, kChromeFrameLongNavigationTimeout); | 198 LaunchIENavigateAndLoop(url, kChromeFrameLongNavigationTimeout); |
| 199 } | 199 } |
| 200 | 200 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 217 ASSERT_TRUE(ie_mock_.event_sink()->web_browser2() != NULL); | 217 ASSERT_TRUE(ie_mock_.event_sink()->web_browser2() != NULL); |
| 218 loop_.RunFor(timeout); | 218 loop_.RunFor(timeout); |
| 219 } | 219 } |
| 220 | 220 |
| 221 if (hung_call_detector_) { | 221 if (hung_call_detector_) { |
| 222 IEEventSink::SetAbnormalShutdown(hung_call_detector_->is_hung()); | 222 IEEventSink::SetAbnormalShutdown(hung_call_detector_->is_hung()); |
| 223 hung_call_detector_->TearDown(); | 223 hung_call_detector_->TearDown(); |
| 224 } | 224 } |
| 225 } | 225 } |
| 226 | 226 |
| 227 FilePath MockIEEventSinkTest::GetTestFilePath( | 227 base::FilePath MockIEEventSinkTest::GetTestFilePath( |
| 228 const std::wstring& relative_path) { | 228 const std::wstring& relative_path) { |
| 229 return server_mock_.root_dir().Append(relative_path); | 229 return server_mock_.root_dir().Append(relative_path); |
| 230 } | 230 } |
| 231 | 231 |
| 232 std::wstring MockIEEventSinkTest::GetTestUrl( | 232 std::wstring MockIEEventSinkTest::GetTestUrl( |
| 233 const std::wstring& relative_path) { | 233 const std::wstring& relative_path) { |
| 234 return server_mock_.Resolve(relative_path.c_str()); | 234 return server_mock_.Resolve(relative_path.c_str()); |
| 235 } | 235 } |
| 236 | 236 |
| 237 } // namespace chrome_frame_test | 237 } // namespace chrome_frame_test |
| OLD | NEW |