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 "net/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
6 | 6 |
7 #include <math.h> // ceil | 7 #include <math.h> // ceil |
8 #include <stdarg.h> | 8 #include <stdarg.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 6443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6454 EXPECT_EQ(OK, callback.WaitForResult()); | 6454 EXPECT_EQ(OK, callback.WaitForResult()); |
6455 | 6455 |
6456 const HttpResponseInfo* response = trans->GetResponseInfo(); | 6456 const HttpResponseInfo* response = trans->GetResponseInfo(); |
6457 ASSERT_TRUE(response != NULL); | 6457 ASSERT_TRUE(response != NULL); |
6458 | 6458 |
6459 EXPECT_TRUE(response->headers != NULL); | 6459 EXPECT_TRUE(response->headers != NULL); |
6460 EXPECT_EQ("HTTP/1.0 200 OK", response->headers->GetStatusLine()); | 6460 EXPECT_EQ("HTTP/1.0 200 OK", response->headers->GetStatusLine()); |
6461 | 6461 |
6462 std::string response_data; | 6462 std::string response_data; |
6463 rv = ReadTransaction(trans.get(), &response_data); | 6463 rv = ReadTransaction(trans.get(), &response_data); |
6464 EXPECT_EQ(ERR_CONTENT_LENGTH_MISMATCH, rv); | 6464 EXPECT_EQ(ERR_CONNECTION_CLOSED, rv); |
6465 } | 6465 } |
6466 | 6466 |
6467 TEST_F(HttpNetworkTransactionTest, UploadFileSmallerThanLength) { | 6467 TEST_F(HttpNetworkTransactionTest, UploadFileSmallerThanLength) { |
6468 HttpRequestInfo request; | 6468 HttpRequestInfo request; |
6469 request.method = "POST"; | 6469 request.method = "POST"; |
6470 request.url = GURL("http://www.google.com/upload"); | 6470 request.url = GURL("http://www.google.com/upload"); |
6471 request.upload_data = new UploadData; | 6471 request.upload_data = new UploadData; |
6472 request.load_flags = 0; | 6472 request.load_flags = 0; |
6473 | 6473 |
6474 SessionDependencies session_deps; | 6474 SessionDependencies session_deps; |
(...skipping 3339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9814 session->spdy_session_pool()->HasSession(host_port_proxy_pair_b)); | 9814 session->spdy_session_pool()->HasSession(host_port_proxy_pair_b)); |
9815 | 9815 |
9816 HttpStreamFactory::set_next_protos(std::vector<std::string>()); | 9816 HttpStreamFactory::set_next_protos(std::vector<std::string>()); |
9817 ClientSocketPoolManager::set_max_sockets_per_pool(old_max_sockets_per_pool); | 9817 ClientSocketPoolManager::set_max_sockets_per_pool(old_max_sockets_per_pool); |
9818 ClientSocketPoolManager::set_max_sockets_per_proxy_server( | 9818 ClientSocketPoolManager::set_max_sockets_per_proxy_server( |
9819 old_max_sockets_per_proxy_server); | 9819 old_max_sockets_per_proxy_server); |
9820 ClientSocketPoolManager::set_max_sockets_per_group(old_max_sockets_per_group); | 9820 ClientSocketPoolManager::set_max_sockets_per_group(old_max_sockets_per_group); |
9821 } | 9821 } |
9822 | 9822 |
9823 } // namespace net | 9823 } // namespace net |
OLD | NEW |