| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |