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

Side by Side Diff: google_apis/drive/drive_api_requests_unittest.cc

Issue 1547593002: Introducing a net::GenerateMimeMultipartBoundary helper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing... Created 4 years, 11 months 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
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « google_apis/drive/base_requests.cc ('k') | net/base/mime_util.h » ('j') | net/base/mime_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698