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

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

Issue 1135353004: Revert of Drive: Let DriveUploader use batch request API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « google_apis/drive/drive_api_requests.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1997 matching lines...) Expand 10 before | Expand all | Expand 10 after
2008 "--OUTERBOUNDARY--", 2008 "--OUTERBOUNDARY--",
2009 http_request_.content); 2009 http_request_.content);
2010 EXPECT_EQ(HTTP_SUCCESS, errors[0]); 2010 EXPECT_EQ(HTTP_SUCCESS, errors[0]);
2011 ASSERT_TRUE(file_resources[0]); 2011 ASSERT_TRUE(file_resources[0]);
2012 EXPECT_EQ("file_id_1", file_resources[0]->file_id()); 2012 EXPECT_EQ("file_id_1", file_resources[0]->file_id());
2013 ASSERT_FALSE(file_resources[1]); 2013 ASSERT_FALSE(file_resources[1]);
2014 EXPECT_EQ(DRIVE_PARSE_ERROR, errors[1]); 2014 EXPECT_EQ(DRIVE_PARSE_ERROR, errors[1]);
2015 } 2015 }
2016 2016
2017 TEST_F(DriveApiRequestsTest, EmptyBatchUploadRequest) { 2017 TEST_F(DriveApiRequestsTest, EmptyBatchUploadRequest) {
2018 drive::BatchUploadRequest* const request = 2018 scoped_ptr<drive::BatchUploadRequest> request(new drive::BatchUploadRequest(
2019 new drive::BatchUploadRequest(request_sender_.get(), *url_generator_); 2019 request_sender_.get(), *url_generator_));
2020 base::WeakPtr<drive::BatchUploadRequest> weak_ptr = 2020 EXPECT_DEATH(request->Commit(), "");
2021 request->GetWeakPtrAsBatchUploadRequest();
2022 request->Commit();
2023 ASSERT_FALSE(weak_ptr.get());
2024 } 2021 }
2025 2022
2026 TEST(ParseMultipartResponseTest, Empty) { 2023 TEST(ParseMultipartResponseTest, Empty) {
2027 std::vector<drive::MultipartHttpResponse> parts; 2024 std::vector<drive::MultipartHttpResponse> parts;
2028 EXPECT_FALSE(drive::ParseMultipartResponse( 2025 EXPECT_FALSE(drive::ParseMultipartResponse(
2029 "multipart/mixed; boundary=BOUNDARY", "", &parts)); 2026 "multipart/mixed; boundary=BOUNDARY", "", &parts));
2030 EXPECT_FALSE(drive::ParseMultipartResponse("multipart/mixed; boundary=", 2027 EXPECT_FALSE(drive::ParseMultipartResponse("multipart/mixed; boundary=",
2031 "CONTENT", &parts)); 2028 "CONTENT", &parts));
2032 } 2029 }
2033 2030
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
2124 "Header: value\r\n" 2121 "Header: value\r\n"
2125 "\r\n" 2122 "\r\n"
2126 "BODY\r\n" 2123 "BODY\r\n"
2127 "--BOUNDARY-- \t", 2124 "--BOUNDARY-- \t",
2128 &parts)); 2125 &parts));
2129 ASSERT_EQ(1u, parts.size()); 2126 ASSERT_EQ(1u, parts.size());
2130 EXPECT_EQ(HTTP_SUCCESS, parts[0].code); 2127 EXPECT_EQ(HTTP_SUCCESS, parts[0].code);
2131 EXPECT_EQ("BODY", parts[0].body); 2128 EXPECT_EQ("BODY", parts[0].body);
2132 } 2129 }
2133 } // namespace google_apis 2130 } // namespace google_apis
OLDNEW
« no previous file with comments | « google_apis/drive/drive_api_requests.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698