| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_worker.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/sync_worker.h" |
| 6 | 6 |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 extension_service_.reset(new MockExtensionService); | 106 extension_service_.reset(new MockExtensionService); |
| 107 scoped_ptr<drive::DriveServiceInterface> | 107 scoped_ptr<drive::DriveServiceInterface> |
| 108 fake_drive_service(new drive::FakeDriveService); | 108 fake_drive_service(new drive::FakeDriveService); |
| 109 | 109 |
| 110 scoped_ptr<SyncEngineContext> | 110 scoped_ptr<SyncEngineContext> |
| 111 sync_engine_context(new SyncEngineContext( | 111 sync_engine_context(new SyncEngineContext( |
| 112 fake_drive_service.Pass(), | 112 fake_drive_service.Pass(), |
| 113 nullptr /* drive_uploader */, | 113 nullptr /* drive_uploader */, |
| 114 nullptr /* task_logger */, | 114 nullptr /* task_logger */, |
| 115 base::ThreadTaskRunnerHandle::Get() /* ui_task_runner */, | 115 base::ThreadTaskRunnerHandle::Get() /* ui_task_runner */, |
| 116 base::ThreadTaskRunnerHandle::Get() /* worker_task_runner */)); | 116 base::ThreadTaskRunnerHandle::Get() /* worker_task_runner */, |
| 117 nullptr /* worker_pool */)); |
| 117 | 118 |
| 118 sync_worker_.reset(new SyncWorker( | 119 sync_worker_.reset(new SyncWorker( |
| 119 profile_dir_.path(), | 120 profile_dir_.path(), |
| 120 extension_service_->AsWeakPtr(), | 121 extension_service_->AsWeakPtr(), |
| 121 in_memory_env_.get())); | 122 in_memory_env_.get())); |
| 122 sync_worker_->Initialize(sync_engine_context.Pass()); | 123 sync_worker_->Initialize(sync_engine_context.Pass()); |
| 123 | 124 |
| 124 sync_worker_->SetSyncEnabled(true); | 125 sync_worker_->SetSyncEnabled(true); |
| 125 base::RunLoop().RunUntilIdle(); | 126 base::RunLoop().RunUntilIdle(); |
| 126 } | 127 } |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 base::Bind(&SyncWorkerTest::CheckServiceState, | 377 base::Bind(&SyncWorkerTest::CheckServiceState, |
| 377 AsWeakPtr(), | 378 AsWeakPtr(), |
| 378 SYNC_STATUS_OK, | 379 SYNC_STATUS_OK, |
| 379 REMOTE_SERVICE_OK)); | 380 REMOTE_SERVICE_OK)); |
| 380 | 381 |
| 381 base::RunLoop().RunUntilIdle(); | 382 base::RunLoop().RunUntilIdle(); |
| 382 } | 383 } |
| 383 | 384 |
| 384 } // namespace drive_backend | 385 } // namespace drive_backend |
| 385 } // namespace sync_file_system | 386 } // namespace sync_file_system |
| OLD | NEW |