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 "chrome/browser/drive/drive_api_util.h" | 10 #include "chrome/browser/drive/drive_api_util.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 sync_context_.reset(); | 70 sync_context_.reset(); |
71 base::RunLoop().RunUntilIdle(); | 71 base::RunLoop().RunUntilIdle(); |
72 } | 72 } |
73 | 73 |
74 base::FilePath database_path() { | 74 base::FilePath database_path() { |
75 return database_dir_.path(); | 75 return database_dir_.path(); |
76 } | 76 } |
77 | 77 |
78 SyncStatusCode RunInitializer() { | 78 SyncStatusCode RunInitializer() { |
79 SyncEngineInitializer* initializer = | 79 SyncEngineInitializer* initializer = |
80 new SyncEngineInitializer( | 80 new SyncEngineInitializer(sync_context_.get(), |
81 sync_context_.get(), | 81 database_path(), |
82 base::MessageLoopProxy::current(), | 82 in_memory_env_.get()); |
83 database_path(), | |
84 in_memory_env_.get()); | |
85 SyncStatusCode status = SYNC_STATUS_UNKNOWN; | 83 SyncStatusCode status = SYNC_STATUS_UNKNOWN; |
86 | 84 |
87 sync_task_manager_->ScheduleSyncTask( | 85 sync_task_manager_->ScheduleSyncTask( |
88 FROM_HERE, | 86 FROM_HERE, |
89 scoped_ptr<SyncTask>(initializer), | 87 scoped_ptr<SyncTask>(initializer), |
90 SyncTaskManager::PRIORITY_MED, | 88 SyncTaskManager::PRIORITY_MED, |
91 base::Bind(&SyncEngineInitializerTest::DidRunInitializer, | 89 base::Bind(&SyncEngineInitializerTest::DidRunInitializer, |
92 base::Unretained(this), initializer, &status)); | 90 base::Unretained(this), initializer, &status)); |
93 | 91 |
94 base::RunLoop().RunUntilIdle(); | 92 base::RunLoop().RunUntilIdle(); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 | 351 |
354 EXPECT_EQ(0u, CountTrackersForFile(sync_root->file_id())); | 352 EXPECT_EQ(0u, CountTrackersForFile(sync_root->file_id())); |
355 EXPECT_FALSE(HasNoParent(sync_root->file_id())); | 353 EXPECT_FALSE(HasNoParent(sync_root->file_id())); |
356 | 354 |
357 EXPECT_EQ(1u, CountFileMetadata()); | 355 EXPECT_EQ(1u, CountFileMetadata()); |
358 EXPECT_EQ(1u, CountFileTracker()); | 356 EXPECT_EQ(1u, CountFileTracker()); |
359 } | 357 } |
360 | 358 |
361 } // namespace drive_backend | 359 } // namespace drive_backend |
362 } // namespace sync_file_system | 360 } // namespace sync_file_system |
OLD | NEW |