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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 } | 227 } |
228 return google_apis::HTTP_NOT_FOUND; | 228 return google_apis::HTTP_NOT_FOUND; |
229 } | 229 } |
230 | 230 |
231 DriveApiErrorCode FakeDriveServiceHelper::ListFilesInFolder( | 231 DriveApiErrorCode FakeDriveServiceHelper::ListFilesInFolder( |
232 const std::string& folder_id, | 232 const std::string& folder_id, |
233 std::vector<std::unique_ptr<FileResource>>* entries) { | 233 std::vector<std::unique_ptr<FileResource>>* entries) { |
234 DriveApiErrorCode error = google_apis::DRIVE_OTHER_ERROR; | 234 DriveApiErrorCode error = google_apis::DRIVE_OTHER_ERROR; |
235 std::unique_ptr<FileList> list; | 235 std::unique_ptr<FileList> list; |
236 fake_drive_service_->GetFileListInDirectory( | 236 fake_drive_service_->GetFileListInDirectory( |
237 folder_id, | 237 folder_id, "" /* team_drive_id */, CreateResultReceiver(&error, &list)); |
238 CreateResultReceiver(&error, &list)); | |
239 base::RunLoop().RunUntilIdle(); | 238 base::RunLoop().RunUntilIdle(); |
240 if (error != google_apis::HTTP_SUCCESS) | 239 if (error != google_apis::HTTP_SUCCESS) |
241 return error; | 240 return error; |
242 | 241 |
243 return CompleteListing(std::move(list), entries); | 242 return CompleteListing(std::move(list), entries); |
244 } | 243 } |
245 | 244 |
246 DriveApiErrorCode FakeDriveServiceHelper::SearchByTitle( | 245 DriveApiErrorCode FakeDriveServiceHelper::SearchByTitle( |
247 const std::string& folder_id, | 246 const std::string& folder_id, |
248 const std::string& title, | 247 const std::string& title, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 const std::string& content) { | 346 const std::string& content) { |
348 base::FilePath temp_file; | 347 base::FilePath temp_file; |
349 EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_dir_, &temp_file)); | 348 EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_dir_, &temp_file)); |
350 EXPECT_EQ(static_cast<int>(content.size()), | 349 EXPECT_EQ(static_cast<int>(content.size()), |
351 base::WriteFile(temp_file, content.data(), content.size())); | 350 base::WriteFile(temp_file, content.data(), content.size())); |
352 return temp_file; | 351 return temp_file; |
353 } | 352 } |
354 | 353 |
355 } // namespace drive_backend | 354 } // namespace drive_backend |
356 } // namespace sync_file_system | 355 } // namespace sync_file_system |
OLD | NEW |