OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/operation_test_base.h" | 5 #include "chrome/browser/chromeos/drive/file_system/operation_test_base.h" |
6 | 6 |
7 #include "base/prefs/testing_pref_service.h" | 7 #include "base/prefs/testing_pref_service.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_processor.h" | 9 #include "chrome/browser/chromeos/drive/change_list_loader.h" |
10 #include "chrome/browser/chromeos/drive/fake_free_disk_space_getter.h" | 10 #include "chrome/browser/chromeos/drive/fake_free_disk_space_getter.h" |
11 #include "chrome/browser/chromeos/drive/file_cache.h" | 11 #include "chrome/browser/chromeos/drive/file_cache.h" |
12 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h" | 12 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h" |
13 #include "chrome/browser/chromeos/drive/job_scheduler.h" | 13 #include "chrome/browser/chromeos/drive/job_scheduler.h" |
14 #include "chrome/browser/chromeos/drive/resource_metadata.h" | 14 #include "chrome/browser/chromeos/drive/resource_metadata.h" |
15 #include "chrome/browser/chromeos/drive/test_util.h" | 15 #include "chrome/browser/chromeos/drive/test_util.h" |
16 #include "chrome/browser/drive/fake_drive_service.h" | 16 #include "chrome/browser/drive/fake_drive_service.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 #include "google_apis/drive/test_util.h" | 18 #include "google_apis/drive/test_util.h" |
19 | 19 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 google_apis::test_util::CreateCopyResultCallback(&success)); | 112 google_apis::test_util::CreateCopyResultCallback(&success)); |
113 test_util::RunBlockingPoolTask(); | 113 test_util::RunBlockingPoolTask(); |
114 ASSERT_TRUE(success); | 114 ASSERT_TRUE(success); |
115 | 115 |
116 // Makes sure the FakeDriveService's content is loaded to the metadata_. | 116 // Makes sure the FakeDriveService's content is loaded to the metadata_. |
117 change_list_loader_.reset(new internal::ChangeListLoader( | 117 change_list_loader_.reset(new internal::ChangeListLoader( |
118 blocking_task_runner_.get(), | 118 blocking_task_runner_.get(), |
119 metadata_.get(), | 119 metadata_.get(), |
120 scheduler_.get(), | 120 scheduler_.get(), |
121 fake_drive_service_.get())); | 121 fake_drive_service_.get())); |
122 change_list_loader_->LoadIfNeeded( | 122 change_list_loader_->LoadForTesting( |
123 internal::DirectoryFetchInfo(), | |
124 google_apis::test_util::CreateCopyResultCallback(&error)); | 123 google_apis::test_util::CreateCopyResultCallback(&error)); |
125 test_util::RunBlockingPoolTask(); | 124 test_util::RunBlockingPoolTask(); |
126 ASSERT_EQ(FILE_ERROR_OK, error); | 125 ASSERT_EQ(FILE_ERROR_OK, error); |
127 } | 126 } |
128 | 127 |
129 FileError OperationTestBase::GetLocalResourceEntry(const base::FilePath& path, | 128 FileError OperationTestBase::GetLocalResourceEntry(const base::FilePath& path, |
130 ResourceEntry* entry) { | 129 ResourceEntry* entry) { |
131 FileError error = FILE_ERROR_FAILED; | 130 FileError error = FILE_ERROR_FAILED; |
132 base::PostTaskAndReplyWithResult( | 131 base::PostTaskAndReplyWithResult( |
133 blocking_task_runner(), | 132 blocking_task_runner(), |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 FileError OperationTestBase::CheckForUpdates() { | 169 FileError OperationTestBase::CheckForUpdates() { |
171 FileError error = FILE_ERROR_FAILED; | 170 FileError error = FILE_ERROR_FAILED; |
172 change_list_loader_->CheckForUpdates( | 171 change_list_loader_->CheckForUpdates( |
173 google_apis::test_util::CreateCopyResultCallback(&error)); | 172 google_apis::test_util::CreateCopyResultCallback(&error)); |
174 test_util::RunBlockingPoolTask(); | 173 test_util::RunBlockingPoolTask(); |
175 return error; | 174 return error; |
176 } | 175 } |
177 | 176 |
178 } // namespace file_system | 177 } // namespace file_system |
179 } // namespace drive | 178 } // namespace drive |
OLD | NEW |