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/sync_file_system/drive_backend/sync_engine_initializer.
h" | 5 #include "chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.
h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 metadata_database_ = initializer->PassMetadataDatabase(); | 102 metadata_database_ = initializer->PassMetadataDatabase(); |
103 } | 103 } |
104 | 104 |
105 SyncStatusCode PopulateDatabase( | 105 SyncStatusCode PopulateDatabase( |
106 const google_apis::FileResource& sync_root, | 106 const google_apis::FileResource& sync_root, |
107 const google_apis::FileResource** app_roots, | 107 const google_apis::FileResource** app_roots, |
108 size_t app_roots_count) { | 108 size_t app_roots_count) { |
109 SyncStatusCode status = SYNC_STATUS_UNKNOWN; | 109 SyncStatusCode status = SYNC_STATUS_UNKNOWN; |
110 scoped_ptr<MetadataDatabase> database; | 110 scoped_ptr<MetadataDatabase> database; |
111 MetadataDatabase::Create( | 111 MetadataDatabase::Create( |
112 base::ThreadTaskRunnerHandle::Get(), | |
113 database_path(), | 112 database_path(), |
114 in_memory_env_.get(), | 113 in_memory_env_.get(), |
115 CreateResultReceiver(&status, &database)); | 114 CreateResultReceiver(&status, &database)); |
116 base::RunLoop().RunUntilIdle(); | 115 base::RunLoop().RunUntilIdle(); |
117 if (status != SYNC_STATUS_OK) | 116 if (status != SYNC_STATUS_OK) |
118 return status; | 117 return status; |
119 | 118 |
120 // |app_root_list| must not own the resources here. Be sure to call | 119 // |app_root_list| must not own the resources here. Be sure to call |
121 // weak_clear later. | 120 // weak_clear later. |
122 ScopedVector<google_apis::FileResource> app_root_list; | 121 ScopedVector<google_apis::FileResource> app_root_list; |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 | 349 |
351 EXPECT_EQ(0u, CountTrackersForFile(sync_root->file_id())); | 350 EXPECT_EQ(0u, CountTrackersForFile(sync_root->file_id())); |
352 EXPECT_FALSE(HasNoParent(sync_root->file_id())); | 351 EXPECT_FALSE(HasNoParent(sync_root->file_id())); |
353 | 352 |
354 EXPECT_EQ(1u, CountFileMetadata()); | 353 EXPECT_EQ(1u, CountFileMetadata()); |
355 EXPECT_EQ(1u, CountFileTracker()); | 354 EXPECT_EQ(1u, CountFileTracker()); |
356 } | 355 } |
357 | 356 |
358 } // namespace drive_backend | 357 } // namespace drive_backend |
359 } // namespace sync_file_system | 358 } // namespace sync_file_system |
OLD | NEW |