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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/fake_drive_service_helper.cc

Issue 449763002: Remove DriveServiceInterface::RenameResource (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/sync_file_system/drive_backend/fake_drive_service_helpe r.h" 5 #include "chrome/browser/sync_file_system/drive_backend/fake_drive_service_helpe r.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 modification_time, entry->last_viewed_by_me_date(), 172 modification_time, entry->last_viewed_by_me_date(),
173 CreateResultReceiver(&error, &entry)); 173 CreateResultReceiver(&error, &entry));
174 base::RunLoop().RunUntilIdle(); 174 base::RunLoop().RunUntilIdle();
175 return error; 175 return error;
176 } 176 }
177 177
178 GDataErrorCode FakeDriveServiceHelper::RenameResource( 178 GDataErrorCode FakeDriveServiceHelper::RenameResource(
179 const std::string& file_id, 179 const std::string& file_id,
180 const std::string& new_title) { 180 const std::string& new_title) {
181 GDataErrorCode error = google_apis::GDATA_OTHER_ERROR; 181 GDataErrorCode error = google_apis::GDATA_OTHER_ERROR;
182 fake_drive_service_->RenameResource( 182 scoped_ptr<FileResource> entry;
183 file_id, new_title, 183 fake_drive_service_->UpdateResource(
184 CreateResultReceiver(&error)); 184 file_id, std::string(), new_title, base::Time(), base::Time(),
185 CreateResultReceiver(&error, &entry));
185 base::RunLoop().RunUntilIdle(); 186 base::RunLoop().RunUntilIdle();
186 return error; 187 return error;
187 } 188 }
188 189
189 GDataErrorCode FakeDriveServiceHelper::AddResourceToDirectory( 190 GDataErrorCode FakeDriveServiceHelper::AddResourceToDirectory(
190 const std::string& parent_folder_id, 191 const std::string& parent_folder_id,
191 const std::string& file_id) { 192 const std::string& file_id) {
192 GDataErrorCode error = google_apis::GDATA_OTHER_ERROR; 193 GDataErrorCode error = google_apis::GDATA_OTHER_ERROR;
193 fake_drive_service_->AddResourceToDirectory( 194 fake_drive_service_->AddResourceToDirectory(
194 parent_folder_id, file_id, 195 parent_folder_id, file_id,
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 const std::string& content) { 345 const std::string& content) {
345 base::FilePath temp_file; 346 base::FilePath temp_file;
346 EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_dir_, &temp_file)); 347 EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_dir_, &temp_file));
347 EXPECT_EQ(static_cast<int>(content.size()), 348 EXPECT_EQ(static_cast<int>(content.size()),
348 base::WriteFile(temp_file, content.data(), content.size())); 349 base::WriteFile(temp_file, content.data(), content.size()));
349 return temp_file; 350 return temp_file;
350 } 351 }
351 352
352 } // namespace drive_backend 353 } // namespace drive_backend
353 } // namespace sync_file_system 354 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698