| 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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 next_feed, | 336 next_feed, |
| 337 CreateResultReceiver(&error, &list)); | 337 CreateResultReceiver(&error, &list)); |
| 338 base::RunLoop().RunUntilIdle(); | 338 base::RunLoop().RunUntilIdle(); |
| 339 if (error != google_apis::HTTP_SUCCESS) | 339 if (error != google_apis::HTTP_SUCCESS) |
| 340 return error; | 340 return error; |
| 341 } | 341 } |
| 342 } | 342 } |
| 343 | 343 |
| 344 void FakeDriveServiceHelper::Initialize() { | 344 void FakeDriveServiceHelper::Initialize() { |
| 345 ASSERT_TRUE(base_dir_.CreateUniqueTempDir()); | 345 ASSERT_TRUE(base_dir_.CreateUniqueTempDir()); |
| 346 temp_dir_ = base_dir_.path().Append(FPL("tmp")); | 346 temp_dir_ = base_dir_.GetPath().Append(FPL("tmp")); |
| 347 ASSERT_TRUE(base::CreateDirectory(temp_dir_)); | 347 ASSERT_TRUE(base::CreateDirectory(temp_dir_)); |
| 348 } | 348 } |
| 349 | 349 |
| 350 base::FilePath FakeDriveServiceHelper::WriteToTempFile( | 350 base::FilePath FakeDriveServiceHelper::WriteToTempFile( |
| 351 const std::string& content) { | 351 const std::string& content) { |
| 352 base::FilePath temp_file; | 352 base::FilePath temp_file; |
| 353 EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_dir_, &temp_file)); | 353 EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_dir_, &temp_file)); |
| 354 EXPECT_EQ(static_cast<int>(content.size()), | 354 EXPECT_EQ(static_cast<int>(content.size()), |
| 355 base::WriteFile(temp_file, content.data(), content.size())); | 355 base::WriteFile(temp_file, content.data(), content.size())); |
| 356 return temp_file; | 356 return temp_file; |
| 357 } | 357 } |
| 358 | 358 |
| 359 } // namespace drive_backend | 359 } // namespace drive_backend |
| 360 } // namespace sync_file_system | 360 } // namespace sync_file_system |
| OLD | NEW |