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

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

Issue 418035: A large Content-Length header followed by a connection close could trigger an... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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/io_buffer.cc ('k') | net/http/http_stream.h » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 <math.h> // ceil 5 #include <math.h> // ceil
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "net/base/completion_callback.h" 8 #include "net/base/completion_callback.h"
9 #include "net/base/mock_host_resolver.h" 9 #include "net/base/mock_host_resolver.h"
10 #include "net/base/ssl_config_service_defaults.h" 10 #include "net/base/ssl_config_service_defaults.h"
(...skipping 3858 matching lines...) Expand 10 before | Expand all | Expand 10 after
3869 scoped_ptr<HttpTransaction> trans( 3869 scoped_ptr<HttpTransaction> trans(
3870 new HttpNetworkTransaction(CreateSession(&session_deps))); 3870 new HttpNetworkTransaction(CreateSession(&session_deps)));
3871 3871
3872 int rv = trans->Start(&request, &callback, NULL); 3872 int rv = trans->Start(&request, &callback, NULL);
3873 EXPECT_EQ(ERR_IO_PENDING, rv); 3873 EXPECT_EQ(ERR_IO_PENDING, rv);
3874 3874
3875 rv = callback.WaitForResult(); 3875 rv = callback.WaitForResult();
3876 EXPECT_EQ(ERR_TUNNEL_CONNECTION_FAILED, rv); 3876 EXPECT_EQ(ERR_TUNNEL_CONNECTION_FAILED, rv);
3877 } 3877 }
3878 3878
3879 TEST_F(HttpNetworkTransactionTest, LargeContentLengthThenClose) {
3880 MockRead data_reads[] = {
3881 MockRead("HTTP/1.0 200 OK\r\nContent-Length:6719476739\r\n\r\n"),
3882 MockRead(false, OK),
3883 };
3884 SimpleGetHelperResult out = SimpleGetHelper(data_reads);
3885 EXPECT_EQ(OK, out.rv);
3886 EXPECT_EQ("HTTP/1.0 200 OK", out.status_line);
3887 EXPECT_EQ("", out.response_data);
3888 }
3889
3879 } // namespace net 3890 } // namespace net
OLDNEW
« no previous file with comments | « net/base/io_buffer.cc ('k') | net/http/http_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698