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

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

Issue 140513008: drive: Allow setting modified/accessed date with AddNewDirectory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 GDataErrorCode FakeDriveServiceHelper::AddFolder( 86 GDataErrorCode FakeDriveServiceHelper::AddFolder(
87 const std::string& parent_folder_id, 87 const std::string& parent_folder_id,
88 const std::string& title, 88 const std::string& title,
89 std::string* folder_id) { 89 std::string* folder_id) {
90 EXPECT_TRUE(folder_id); 90 EXPECT_TRUE(folder_id);
91 91
92 GDataErrorCode error = google_apis::GDATA_OTHER_ERROR; 92 GDataErrorCode error = google_apis::GDATA_OTHER_ERROR;
93 scoped_ptr<ResourceEntry> folder; 93 scoped_ptr<ResourceEntry> folder;
94 fake_drive_service_->AddNewDirectory( 94 fake_drive_service_->AddNewDirectory(
95 parent_folder_id, title, 95 parent_folder_id, title,
96 drive::DriveServiceInterface::AddNewDirectoryOptions(),
96 CreateResultReceiver(&error, &folder)); 97 CreateResultReceiver(&error, &folder));
97 base::RunLoop().RunUntilIdle(); 98 base::RunLoop().RunUntilIdle();
98 99
99 if (error == google_apis::HTTP_CREATED) 100 if (error == google_apis::HTTP_CREATED)
100 *folder_id = folder->resource_id(); 101 *folder_id = folder->resource_id();
101 return error; 102 return error;
102 } 103 }
103 104
104 GDataErrorCode FakeDriveServiceHelper::AddFile( 105 GDataErrorCode FakeDriveServiceHelper::AddFile(
105 const std::string& parent_folder_id, 106 const std::string& parent_folder_id,
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 const std::string& content) { 332 const std::string& content) {
332 base::FilePath temp_file; 333 base::FilePath temp_file;
333 EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_dir_, &temp_file)); 334 EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_dir_, &temp_file));
334 EXPECT_EQ(static_cast<int>(content.size()), 335 EXPECT_EQ(static_cast<int>(content.size()),
335 file_util::WriteFile(temp_file, content.data(), content.size())); 336 file_util::WriteFile(temp_file, content.data(), content.size()));
336 return temp_file; 337 return temp_file;
337 } 338 }
338 339
339 } // namespace drive_backend 340 } // namespace drive_backend
340 } // namespace sync_file_system 341 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698