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

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: Self-review. Created 4 years, 12 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 2115 matching lines...) Expand 10 before | Expand all | Expand 10 after
2126 TestBatchableDelegate* requests[] = { 2126 TestBatchableDelegate* requests[] = {
2127 new TestBatchableDelegate(GURL("http://example.com/test"), 2127 new TestBatchableDelegate(GURL("http://example.com/test"),
2128 "application/binary", std::string(100, 'a'), 2128 "application/binary", std::string(100, 'a'),
2129 base::Bind(&EmptyClosure)), 2129 base::Bind(&EmptyClosure)),
2130 new TestBatchableDelegate(GURL("http://example.com/test"), 2130 new TestBatchableDelegate(GURL("http://example.com/test"),
2131 "application/binary", std::string(50, 'b'), 2131 "application/binary", std::string(50, 'b'),
2132 base::Bind(&EmptyClosure)), 2132 base::Bind(&EmptyClosure)),
2133 new TestBatchableDelegate(GURL("http://example.com/test"), 2133 new TestBatchableDelegate(GURL("http://example.com/test"),
2134 "application/binary", std::string(0, 'c'), 2134 "application/binary", std::string(0, 'c'),
2135 base::Bind(&EmptyClosure))}; 2135 base::Bind(&EmptyClosure))};
2136 const size_t kExpectedUploadDataPosition[] = {208, 517, 776}; 2136 const size_t kExpectedUploadDataPosition[] = {205, 511, 767};
2137 const size_t kExpectedUploadDataSize = 851; 2137 const size_t kExpectedUploadDataSize = 851;
2138 request->AddRequest(requests[0]); 2138 request->AddRequest(requests[0]);
2139 request->AddRequest(requests[1]); 2139 request->AddRequest(requests[1]);
2140 request->AddRequest(requests[2]); 2140 request->AddRequest(requests[2]);
2141 request->Commit(); 2141 request->Commit();
2142 request->Prepare(base::Bind(&EmptyPreapreCallback)); 2142 request->Prepare(base::Bind(&EmptyPreapreCallback));
2143 2143
2144 request->OnURLFetchUploadProgress(nullptr, 0, kExpectedUploadDataSize); 2144 request->OnURLFetchUploadProgress(nullptr, 0, kExpectedUploadDataSize);
2145 request->OnURLFetchUploadProgress(nullptr, 150, kExpectedUploadDataSize); 2145 request->OnURLFetchUploadProgress(nullptr, 150, kExpectedUploadDataSize);
2146 EXPECT_EQ(0u, requests[0]->progress_values().size()); 2146 EXPECT_EQ(0u, requests[0]->progress_values().size());
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
2282 "Header: value\r\n" 2282 "Header: value\r\n"
2283 "\r\n" 2283 "\r\n"
2284 "BODY\r\n" 2284 "BODY\r\n"
2285 "--BOUNDARY-- \t", 2285 "--BOUNDARY-- \t",
2286 &parts)); 2286 &parts));
2287 ASSERT_EQ(1u, parts.size()); 2287 ASSERT_EQ(1u, parts.size());
2288 EXPECT_EQ(HTTP_SUCCESS, parts[0].code); 2288 EXPECT_EQ(HTTP_SUCCESS, parts[0].code);
2289 EXPECT_EQ("BODY", parts[0].body); 2289 EXPECT_EQ("BODY", parts[0].body);
2290 } 2290 }
2291 } // namespace google_apis 2291 } // namespace google_apis
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698