OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/sync_client.h" | 5 #include "chrome/browser/chromeos/drive/sync_client.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 cache_->Store(resource_ids_["dirty"], md5_dirty, | 179 cache_->Store(resource_ids_["dirty"], md5_dirty, |
180 temp_file, FileCache::FILE_OPERATION_COPY)); | 180 temp_file, FileCache::FILE_OPERATION_COPY)); |
181 EXPECT_EQ(FILE_ERROR_OK, cache_->Pin(resource_ids_["dirty"])); | 181 EXPECT_EQ(FILE_ERROR_OK, cache_->Pin(resource_ids_["dirty"])); |
182 EXPECT_EQ(FILE_ERROR_OK, cache_->MarkDirty(resource_ids_["dirty"])); | 182 EXPECT_EQ(FILE_ERROR_OK, cache_->MarkDirty(resource_ids_["dirty"])); |
183 | 183 |
184 // Load data from the service to the metadata. | 184 // Load data from the service to the metadata. |
185 FileError error = FILE_ERROR_FAILED; | 185 FileError error = FILE_ERROR_FAILED; |
186 internal::ChangeListLoader change_list_loader( | 186 internal::ChangeListLoader change_list_loader( |
187 base::MessageLoopProxy::current().get(), | 187 base::MessageLoopProxy::current().get(), |
188 metadata_.get(), | 188 metadata_.get(), |
189 scheduler_.get()); | 189 scheduler_.get(), |
| 190 drive_service_.get()); |
190 change_list_loader.LoadIfNeeded( | 191 change_list_loader.LoadIfNeeded( |
191 DirectoryFetchInfo(), | 192 DirectoryFetchInfo(), |
192 google_apis::test_util::CreateCopyResultCallback(&error)); | 193 google_apis::test_util::CreateCopyResultCallback(&error)); |
193 base::RunLoop().RunUntilIdle(); | 194 base::RunLoop().RunUntilIdle(); |
194 EXPECT_EQ(FILE_ERROR_OK, error); | 195 EXPECT_EQ(FILE_ERROR_OK, error); |
195 } | 196 } |
196 | 197 |
197 protected: | 198 protected: |
198 content::TestBrowserThreadBundle thread_bundle_; | 199 content::TestBrowserThreadBundle thread_bundle_; |
199 base::ScopedTempDir temp_dir_; | 200 base::ScopedTempDir temp_dir_; |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 331 |
331 // Fetched and uploaded. | 332 // Fetched and uploaded. |
332 EXPECT_TRUE(cache_->GetCacheEntry(resource_ids_["foo"], &cache_entry)); | 333 EXPECT_TRUE(cache_->GetCacheEntry(resource_ids_["foo"], &cache_entry)); |
333 EXPECT_TRUE(cache_entry.is_present()); | 334 EXPECT_TRUE(cache_entry.is_present()); |
334 EXPECT_TRUE(cache_->GetCacheEntry(resource_ids_["dirty"], &cache_entry)); | 335 EXPECT_TRUE(cache_->GetCacheEntry(resource_ids_["dirty"], &cache_entry)); |
335 EXPECT_FALSE(cache_entry.is_dirty()); | 336 EXPECT_FALSE(cache_entry.is_dirty()); |
336 } | 337 } |
337 | 338 |
338 } // namespace internal | 339 } // namespace internal |
339 } // namespace drive | 340 } // namespace drive |
OLD | NEW |