| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |