| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "google_apis/drive/drive_api_requests.h" | 5 #include "google_apis/drive/drive_api_requests.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 2123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2134 TestBatchableDelegate* requests[] = { | 2134 TestBatchableDelegate* requests[] = { |
| 2135 new TestBatchableDelegate(GURL("http://example.com/test"), | 2135 new TestBatchableDelegate(GURL("http://example.com/test"), |
| 2136 "application/binary", std::string(100, 'a'), | 2136 "application/binary", std::string(100, 'a'), |
| 2137 base::Bind(&EmptyClosure)), | 2137 base::Bind(&EmptyClosure)), |
| 2138 new TestBatchableDelegate(GURL("http://example.com/test"), | 2138 new TestBatchableDelegate(GURL("http://example.com/test"), |
| 2139 "application/binary", std::string(50, 'b'), | 2139 "application/binary", std::string(50, 'b'), |
| 2140 base::Bind(&EmptyClosure)), | 2140 base::Bind(&EmptyClosure)), |
| 2141 new TestBatchableDelegate(GURL("http://example.com/test"), | 2141 new TestBatchableDelegate(GURL("http://example.com/test"), |
| 2142 "application/binary", std::string(0, 'c'), | 2142 "application/binary", std::string(0, 'c'), |
| 2143 base::Bind(&EmptyClosure))}; | 2143 base::Bind(&EmptyClosure))}; |
| 2144 const size_t kExpectedUploadDataPosition[] = {208, 517, 776}; | 2144 const size_t kExpectedUploadDataPosition[] = {207, 515, 773}; |
| 2145 const size_t kExpectedUploadDataSize = 851; | 2145 const size_t kExpectedUploadDataSize = 851; |
| 2146 request->AddRequest(requests[0]); | 2146 request->AddRequest(requests[0]); |
| 2147 request->AddRequest(requests[1]); | 2147 request->AddRequest(requests[1]); |
| 2148 request->AddRequest(requests[2]); | 2148 request->AddRequest(requests[2]); |
| 2149 request->Commit(); | 2149 request->Commit(); |
| 2150 request->Prepare(base::Bind(&EmptyPreapreCallback)); | 2150 request->Prepare(base::Bind(&EmptyPreapreCallback)); |
| 2151 | 2151 |
| 2152 request->OnURLFetchUploadProgress(nullptr, 0, kExpectedUploadDataSize); | 2152 request->OnURLFetchUploadProgress(nullptr, 0, kExpectedUploadDataSize); |
| 2153 request->OnURLFetchUploadProgress(nullptr, 150, kExpectedUploadDataSize); | 2153 request->OnURLFetchUploadProgress(nullptr, 150, kExpectedUploadDataSize); |
| 2154 EXPECT_EQ(0u, requests[0]->progress_values().size()); | 2154 EXPECT_EQ(0u, requests[0]->progress_values().size()); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2290 "Header: value\r\n" | 2290 "Header: value\r\n" |
| 2291 "\r\n" | 2291 "\r\n" |
| 2292 "BODY\r\n" | 2292 "BODY\r\n" |
| 2293 "--BOUNDARY-- \t", | 2293 "--BOUNDARY-- \t", |
| 2294 &parts)); | 2294 &parts)); |
| 2295 ASSERT_EQ(1u, parts.size()); | 2295 ASSERT_EQ(1u, parts.size()); |
| 2296 EXPECT_EQ(HTTP_SUCCESS, parts[0].code); | 2296 EXPECT_EQ(HTTP_SUCCESS, parts[0].code); |
| 2297 EXPECT_EQ("BODY", parts[0].body); | 2297 EXPECT_EQ("BODY", parts[0].body); |
| 2298 } | 2298 } |
| 2299 } // namespace google_apis | 2299 } // namespace google_apis |
| OLD | NEW |