| 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/test_with_web_server.h" | 5 #include "chrome_frame/test/test_with_web_server.h" |
| 6 | 6 |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/file_version_info.h" | 8 #include "base/file_version_info.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 EXPECT_CALL(*this, Post(_, testing::HasSubstr(post_suffix), _)) | 299 EXPECT_CALL(*this, Post(_, testing::HasSubstr(post_suffix), _)) |
| 300 .WillRepeatedly(HandlePostedResponseHelper(this, invocation)); | 300 .WillRepeatedly(HandlePostedResponseHelper(this, invocation)); |
| 301 } | 301 } |
| 302 | 302 |
| 303 void MockWebServer::HandlePostedResponse( | 303 void MockWebServer::HandlePostedResponse( |
| 304 test_server::ConfigurableConnection* connection, | 304 test_server::ConfigurableConnection* connection, |
| 305 const test_server::Request& request) { | 305 const test_server::Request& request) { |
| 306 posted_result_ = request.content(); | 306 posted_result_ = request.content(); |
| 307 if (posted_result_ == expected_result_) { | 307 if (posted_result_ == expected_result_) { |
| 308 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 308 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 309 MessageLoop::QuitClosure(), | 309 MessageLoop::QuitClosure(), base::TimeDelta::FromMilliseconds(100)); |
| 310 100); | |
| 311 } | 310 } |
| 312 connection->Send("HTTP/1.1 200 OK\r\n", ""); | 311 connection->Send("HTTP/1.1 200 OK\r\n", ""); |
| 313 } | 312 } |
| 314 | 313 |
| 315 void MockWebServer::SendResponseHelper( | 314 void MockWebServer::SendResponseHelper( |
| 316 test_server::ConfigurableConnection* connection, | 315 test_server::ConfigurableConnection* connection, |
| 317 const std::wstring& request_uri, | 316 const std::wstring& request_uri, |
| 318 const test_server::Request& request, | 317 const test_server::Request& request, |
| 319 CFInvocation invocation, | 318 CFInvocation invocation, |
| 320 bool add_no_cache_header) { | 319 bool add_no_cache_header) { |
| (...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 server.web_server()->AddResponse(response); | 1016 server.web_server()->AddResponse(response); |
| 1018 | 1017 |
| 1019 std::wstring url(server.FormatHttpPath(L"form.html")); | 1018 std::wstring url(server.FormatHttpPath(L"form.html")); |
| 1020 | 1019 |
| 1021 ASSERT_TRUE(LaunchBrowser(IE, url.c_str())); | 1020 ASSERT_TRUE(LaunchBrowser(IE, url.c_str())); |
| 1022 loop_.RunFor(kChromeFrameLongNavigationTimeoutInSeconds); | 1021 loop_.RunFor(kChromeFrameLongNavigationTimeoutInSeconds); |
| 1023 | 1022 |
| 1024 EXPECT_EQ(1, response->get_request_count()); | 1023 EXPECT_EQ(1, response->get_request_count()); |
| 1025 EXPECT_EQ(1, response->post_request_count()); | 1024 EXPECT_EQ(1, response->post_request_count()); |
| 1026 } | 1025 } |
| OLD | NEW |