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

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

Issue 8862009: Revert 110505 - Report ERR_CONTENT_LENGTH_MISMATCH when the count of bytes received doesn't match... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/963/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 6074 matching lines...) Expand 10 before | Expand all | Expand 10 after
6085 EXPECT_EQ(OK, callback.WaitForResult()); 6085 EXPECT_EQ(OK, callback.WaitForResult());
6086 6086
6087 const HttpResponseInfo* response = trans->GetResponseInfo(); 6087 const HttpResponseInfo* response = trans->GetResponseInfo();
6088 ASSERT_TRUE(response != NULL); 6088 ASSERT_TRUE(response != NULL);
6089 6089
6090 EXPECT_TRUE(response->headers != NULL); 6090 EXPECT_TRUE(response->headers != NULL);
6091 EXPECT_EQ("HTTP/1.0 200 OK", response->headers->GetStatusLine()); 6091 EXPECT_EQ("HTTP/1.0 200 OK", response->headers->GetStatusLine());
6092 6092
6093 std::string response_data; 6093 std::string response_data;
6094 rv = ReadTransaction(trans.get(), &response_data); 6094 rv = ReadTransaction(trans.get(), &response_data);
6095 EXPECT_EQ(ERR_CONTENT_LENGTH_MISMATCH, rv); 6095 EXPECT_EQ(ERR_CONNECTION_CLOSED, rv);
6096 } 6096 }
6097 6097
6098 TEST_F(HttpNetworkTransactionTest, UploadFileSmallerThanLength) { 6098 TEST_F(HttpNetworkTransactionTest, UploadFileSmallerThanLength) {
6099 HttpRequestInfo request; 6099 HttpRequestInfo request;
6100 request.method = "POST"; 6100 request.method = "POST";
6101 request.url = GURL("http://www.google.com/upload"); 6101 request.url = GURL("http://www.google.com/upload");
6102 request.upload_data = new UploadData; 6102 request.upload_data = new UploadData;
6103 request.load_flags = 0; 6103 request.load_flags = 0;
6104 6104
6105 SessionDependencies session_deps; 6105 SessionDependencies session_deps;
(...skipping 3134 matching lines...) Expand 10 before | Expand all | Expand 10 after
9240 StaticSocketDataProvider* data[] = { &data1, &data2 }; 9240 StaticSocketDataProvider* data[] = { &data1, &data2 };
9241 9241
9242 SimpleGetHelperResult out = SimpleGetHelperForData(data, arraysize(data)); 9242 SimpleGetHelperResult out = SimpleGetHelperForData(data, arraysize(data));
9243 9243
9244 EXPECT_EQ(OK, out.rv); 9244 EXPECT_EQ(OK, out.rv);
9245 EXPECT_EQ("HTTP/1.0 200 OK", out.status_line); 9245 EXPECT_EQ("HTTP/1.0 200 OK", out.status_line);
9246 EXPECT_EQ("hello world", out.response_data); 9246 EXPECT_EQ("hello world", out.response_data);
9247 } 9247 }
9248 9248
9249 } // namespace net 9249 } // 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