| 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.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/sync_engine.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 "chrome/browser/drive/drive_uploader.h" | 10 #include "chrome/browser/drive/drive_uploader.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 scoped_ptr<drive::DriveServiceInterface> | 111 scoped_ptr<drive::DriveServiceInterface> |
| 112 fake_drive_service(new drive::FakeDriveService); | 112 fake_drive_service(new drive::FakeDriveService); |
| 113 | 113 |
| 114 sync_engine_.reset(new drive_backend::SyncEngine( | 114 sync_engine_.reset(new drive_backend::SyncEngine( |
| 115 fake_drive_service.Pass(), | 115 fake_drive_service.Pass(), |
| 116 scoped_ptr<drive::DriveUploaderInterface>(), | 116 scoped_ptr<drive::DriveUploaderInterface>(), |
| 117 base::MessageLoopProxy::current(), | 117 base::MessageLoopProxy::current(), |
| 118 NULL /* notification_manager */, | 118 NULL /* notification_manager */, |
| 119 extension_service_.get(), | 119 extension_service_.get(), |
| 120 NULL /* signin_manager */)); | 120 NULL /* signin_manager */)); |
| 121 |
| 122 base::RunLoop run_loop; |
| 121 sync_engine_->Initialize(profile_dir_.path(), | 123 sync_engine_->Initialize(profile_dir_.path(), |
| 122 base::MessageLoopProxy::current(), | 124 base::MessageLoopProxy::current(), |
| 125 run_loop.QuitClosure(), |
| 123 in_memory_env_.get()); | 126 in_memory_env_.get()); |
| 127 run_loop.Run(); |
| 124 sync_engine_->SetSyncEnabled(true); | 128 sync_engine_->SetSyncEnabled(true); |
| 125 base::RunLoop().RunUntilIdle(); | 129 base::RunLoop().RunUntilIdle(); |
| 126 } | 130 } |
| 127 | 131 |
| 128 virtual void TearDown() OVERRIDE { | 132 virtual void TearDown() OVERRIDE { |
| 129 sync_engine_.reset(); | 133 sync_engine_.reset(); |
| 130 extension_service_.reset(); | 134 extension_service_.reset(); |
| 131 base::RunLoop().RunUntilIdle(); | 135 base::RunLoop().RunUntilIdle(); |
| 132 } | 136 } |
| 133 | 137 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 base::Bind(&SyncEngineTest::CheckServiceState, | 378 base::Bind(&SyncEngineTest::CheckServiceState, |
| 375 AsWeakPtr(), | 379 AsWeakPtr(), |
| 376 SYNC_STATUS_OK, | 380 SYNC_STATUS_OK, |
| 377 REMOTE_SERVICE_OK)); | 381 REMOTE_SERVICE_OK)); |
| 378 | 382 |
| 379 base::RunLoop().RunUntilIdle(); | 383 base::RunLoop().RunUntilIdle(); |
| 380 } | 384 } |
| 381 | 385 |
| 382 } // namespace drive_backend | 386 } // namespace drive_backend |
| 383 } // namespace sync_file_system | 387 } // namespace sync_file_system |
| OLD | NEW |