OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/chromeos/drive/file_system/create_directory_operation.h
" | 5 #include "chrome/browser/chromeos/drive/file_system/create_directory_operation.h
" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/threading/sequenced_worker_pool.h" | 8 #include "base/threading/sequenced_worker_pool.h" |
9 #include "chrome/browser/chromeos/drive/change_list_loader.h" | 9 #include "chrome/browser/chromeos/drive/change_list_loader.h" |
10 #include "chrome/browser/chromeos/drive/drive_cache.h" | 10 #include "chrome/browser/chromeos/drive/drive_cache.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 fake_drive_service_->LoadAppListForDriveApi("chromeos/drive/applist.json"); | 47 fake_drive_service_->LoadAppListForDriveApi("chromeos/drive/applist.json"); |
48 | 48 |
49 fake_free_disk_space_getter_.reset(new FakeFreeDiskSpaceGetter); | 49 fake_free_disk_space_getter_.reset(new FakeFreeDiskSpaceGetter); |
50 cache_.reset(new DriveCache(DriveCache::GetCacheRootPath(profile_.get()), | 50 cache_.reset(new DriveCache(DriveCache::GetCacheRootPath(profile_.get()), |
51 blocking_task_runner_, | 51 blocking_task_runner_, |
52 fake_free_disk_space_getter_.get())); | 52 fake_free_disk_space_getter_.get())); |
53 cache_->RequestInitializeForTesting(); | 53 cache_->RequestInitializeForTesting(); |
54 google_apis::test_util::RunBlockingPoolTask(); | 54 google_apis::test_util::RunBlockingPoolTask(); |
55 | 55 |
56 metadata_.reset(new DriveResourceMetadata( | 56 metadata_.reset(new DriveResourceMetadata( |
57 fake_drive_service_->GetRootResourceId(), | |
58 cache_->GetCacheDirectoryPath(DriveCache::CACHE_TYPE_META), | 57 cache_->GetCacheDirectoryPath(DriveCache::CACHE_TYPE_META), |
59 blocking_task_runner_)); | 58 blocking_task_runner_)); |
60 | 59 |
61 DriveFileError error = DRIVE_FILE_ERROR_FAILED; | 60 DriveFileError error = DRIVE_FILE_ERROR_FAILED; |
62 metadata_->Initialize( | 61 metadata_->Initialize( |
63 google_apis::test_util::CreateCopyResultCallback(&error)); | 62 google_apis::test_util::CreateCopyResultCallback(&error)); |
64 google_apis::test_util::RunBlockingPoolTask(); | 63 google_apis::test_util::RunBlockingPoolTask(); |
65 ASSERT_EQ(DRIVE_FILE_OK, error); | 64 ASSERT_EQ(DRIVE_FILE_OK, error); |
66 | 65 |
67 scheduler_.reset( | 66 scheduler_.reset( |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 operation()->FindFirstMissingParentDirectory( | 186 operation()->FindFirstMissingParentDirectory( |
188 base::FilePath(FILE_PATH_LITERAL("drive/root/Directory 1")), | 187 base::FilePath(FILE_PATH_LITERAL("drive/root/Directory 1")), |
189 google_apis::test_util::CreateCopyResultCallback(&result)); | 188 google_apis::test_util::CreateCopyResultCallback(&result)); |
190 google_apis::test_util::RunBlockingPoolTask(); | 189 google_apis::test_util::RunBlockingPoolTask(); |
191 EXPECT_EQ(CreateDirectoryOperation::FIND_FIRST_DIRECTORY_ALREADY_PRESENT, | 190 EXPECT_EQ(CreateDirectoryOperation::FIND_FIRST_DIRECTORY_ALREADY_PRESENT, |
192 result.error); | 191 result.error); |
193 } | 192 } |
194 | 193 |
195 } // namespace file_system | 194 } // namespace file_system |
196 } // namespace drive | 195 } // namespace drive |
OLD | NEW |