| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shlobj.h> | 9 #include <shlobj.h> |
| 10 #endif | 10 #endif |
| (...skipping 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1947 marker = 'a'; | 1947 marker = 'a'; |
| 1948 } | 1948 } |
| 1949 } | 1949 } |
| 1950 uploadBytes[kMsgSize] = '\0'; | 1950 uploadBytes[kMsgSize] = '\0'; |
| 1951 | 1951 |
| 1952 for (int i = 0; i < kIterations; ++i) { | 1952 for (int i = 0; i < kIterations; ++i) { |
| 1953 TestDelegate d; | 1953 TestDelegate d; |
| 1954 URLRequest r(test_server_.GetURL("echo"), &d, &default_context_); | 1954 URLRequest r(test_server_.GetURL("echo"), &d, &default_context_); |
| 1955 r.set_method(method.c_str()); | 1955 r.set_method(method.c_str()); |
| 1956 | 1956 |
| 1957 r.AppendBytesToUpload(uploadBytes, kMsgSize); | 1957 scoped_refptr<UploadData> upload_data(new UploadData()); |
| 1958 upload_data->AppendBytes(uploadBytes, kMsgSize); |
| 1959 r.set_upload(upload_data); |
| 1958 | 1960 |
| 1959 r.Start(); | 1961 r.Start(); |
| 1960 EXPECT_TRUE(r.is_pending()); | 1962 EXPECT_TRUE(r.is_pending()); |
| 1961 | 1963 |
| 1962 MessageLoop::current()->Run(); | 1964 MessageLoop::current()->Run(); |
| 1963 | 1965 |
| 1964 ASSERT_EQ(1, d.response_started_count()) | 1966 ASSERT_EQ(1, d.response_started_count()) |
| 1965 << "request failed: " << r.status().status() | 1967 << "request failed: " << r.status().status() |
| 1966 << ", os error: " << r.status().error(); | 1968 << ", os error: " << r.status().error(); |
| 1967 | 1969 |
| (...skipping 3145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5113 | 5115 |
| 5114 EXPECT_FALSE(r.is_pending()); | 5116 EXPECT_FALSE(r.is_pending()); |
| 5115 EXPECT_EQ(1, d->response_started_count()); | 5117 EXPECT_EQ(1, d->response_started_count()); |
| 5116 EXPECT_FALSE(d->received_data_before_response()); | 5118 EXPECT_FALSE(d->received_data_before_response()); |
| 5117 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); | 5119 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); |
| 5118 } | 5120 } |
| 5119 } | 5121 } |
| 5120 #endif // !defined(DISABLE_FTP_SUPPORT) | 5122 #endif // !defined(DISABLE_FTP_SUPPORT) |
| 5121 | 5123 |
| 5122 } // namespace net | 5124 } // namespace net |
| OLD | NEW |