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 6139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6150 EXPECT_EQ(OK, callback.WaitForResult()); | 6150 EXPECT_EQ(OK, callback.WaitForResult()); |
6151 | 6151 |
6152 const HttpResponseInfo* response = trans->GetResponseInfo(); | 6152 const HttpResponseInfo* response = trans->GetResponseInfo(); |
6153 ASSERT_TRUE(response != NULL); | 6153 ASSERT_TRUE(response != NULL); |
6154 | 6154 |
6155 EXPECT_TRUE(response->headers != NULL); | 6155 EXPECT_TRUE(response->headers != NULL); |
6156 EXPECT_EQ("HTTP/1.0 200 OK", response->headers->GetStatusLine()); | 6156 EXPECT_EQ("HTTP/1.0 200 OK", response->headers->GetStatusLine()); |
6157 | 6157 |
6158 std::string response_data; | 6158 std::string response_data; |
6159 rv = ReadTransaction(trans.get(), &response_data); | 6159 rv = ReadTransaction(trans.get(), &response_data); |
6160 EXPECT_EQ(ERR_CONNECTION_CLOSED, rv); | 6160 EXPECT_EQ(ERR_CONTENT_LENGTH_MISMATCH, rv); |
6161 } | 6161 } |
6162 | 6162 |
6163 TEST_F(HttpNetworkTransactionTest, UploadFileSmallerThanLength) { | 6163 TEST_F(HttpNetworkTransactionTest, UploadFileSmallerThanLength) { |
6164 HttpRequestInfo request; | 6164 HttpRequestInfo request; |
6165 request.method = "POST"; | 6165 request.method = "POST"; |
6166 request.url = GURL("http://www.google.com/upload"); | 6166 request.url = GURL("http://www.google.com/upload"); |
6167 request.upload_data = new UploadData; | 6167 request.upload_data = new UploadData; |
6168 request.load_flags = 0; | 6168 request.load_flags = 0; |
6169 | 6169 |
6170 SessionDependencies session_deps; | 6170 SessionDependencies session_deps; |
(...skipping 3126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9297 StaticSocketDataProvider* data[] = { &data1, &data2 }; | 9297 StaticSocketDataProvider* data[] = { &data1, &data2 }; |
9298 | 9298 |
9299 SimpleGetHelperResult out = SimpleGetHelperForData(data, arraysize(data)); | 9299 SimpleGetHelperResult out = SimpleGetHelperForData(data, arraysize(data)); |
9300 | 9300 |
9301 EXPECT_EQ(OK, out.rv); | 9301 EXPECT_EQ(OK, out.rv); |
9302 EXPECT_EQ("HTTP/1.0 200 OK", out.status_line); | 9302 EXPECT_EQ("HTTP/1.0 200 OK", out.status_line); |
9303 EXPECT_EQ("hello world", out.response_data); | 9303 EXPECT_EQ("hello world", out.response_data); |
9304 } | 9304 } |
9305 | 9305 |
9306 } // namespace net | 9306 } // namespace net |
OLD | NEW |