| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 EXPECT_CALL(*this, Post(_, testing::HasSubstr(post_suffix), _)) | 292 EXPECT_CALL(*this, Post(_, testing::HasSubstr(post_suffix), _)) |
| 293 .WillRepeatedly(HandlePostedResponseHelper(this, invocation)); | 293 .WillRepeatedly(HandlePostedResponseHelper(this, invocation)); |
| 294 } | 294 } |
| 295 | 295 |
| 296 void MockWebServer::HandlePostedResponse( | 296 void MockWebServer::HandlePostedResponse( |
| 297 test_server::ConfigurableConnection* connection, | 297 test_server::ConfigurableConnection* connection, |
| 298 const test_server::Request& request) { | 298 const test_server::Request& request) { |
| 299 posted_result_ = request.content(); | 299 posted_result_ = request.content(); |
| 300 if (posted_result_ == expected_result_) { | 300 if (posted_result_ == expected_result_) { |
| 301 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 301 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 302 new MessageLoop::QuitTask, | 302 MessageLoop::QuitClosure(), |
| 303 100); | 303 100); |
| 304 } | 304 } |
| 305 connection->Send("HTTP/1.1 200 OK\r\n", ""); | 305 connection->Send("HTTP/1.1 200 OK\r\n", ""); |
| 306 } | 306 } |
| 307 | 307 |
| 308 void MockWebServer::SendResponseHelper( | 308 void MockWebServer::SendResponseHelper( |
| 309 test_server::ConfigurableConnection* connection, | 309 test_server::ConfigurableConnection* connection, |
| 310 const std::wstring& request_uri, | 310 const std::wstring& request_uri, |
| 311 const test_server::Request& request, | 311 const test_server::Request& request, |
| 312 CFInvocation invocation, | 312 CFInvocation invocation, |
| (...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 server.web_server()->AddResponse(response); | 1002 server.web_server()->AddResponse(response); |
| 1003 | 1003 |
| 1004 std::wstring url(server.FormatHttpPath(L"form.html")); | 1004 std::wstring url(server.FormatHttpPath(L"form.html")); |
| 1005 | 1005 |
| 1006 ASSERT_TRUE(LaunchBrowser(IE, url.c_str())); | 1006 ASSERT_TRUE(LaunchBrowser(IE, url.c_str())); |
| 1007 loop_.RunFor(kChromeFrameLongNavigationTimeoutInSeconds); | 1007 loop_.RunFor(kChromeFrameLongNavigationTimeoutInSeconds); |
| 1008 | 1008 |
| 1009 EXPECT_EQ(1, response->get_request_count()); | 1009 EXPECT_EQ(1, response->get_request_count()); |
| 1010 EXPECT_EQ(1, response->post_request_count()); | 1010 EXPECT_EQ(1, response->post_request_count()); |
| 1011 } | 1011 } |
| OLD | NEW |