Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(655)

Side by Side Diff: net/http/http_network_transaction_unittest.cc

Issue 8863002: Revert 110505 - Report ERR_CONTENT_LENGTH_MISMATCH when the count of bytes received doesn't match... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/base/net_error_list.h ('k') | net/http/http_stream_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/base/net_error_list.h ('k') | net/http/http_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698