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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 RemoteServiceState expected_service_status, | 150 RemoteServiceState expected_service_status, |
151 SyncStatusCode sync_status) { | 151 SyncStatusCode sync_status) { |
152 EXPECT_EQ(expected_sync_status, sync_status); | 152 EXPECT_EQ(expected_sync_status, sync_status); |
153 EXPECT_EQ(expected_service_status, sync_engine_->GetCurrentState()); | 153 EXPECT_EQ(expected_service_status, sync_engine_->GetCurrentState()); |
154 } | 154 } |
155 | 155 |
156 MetadataDatabase* metadata_database() { | 156 MetadataDatabase* metadata_database() { |
157 return sync_engine_->sync_worker_->GetMetadataDatabase(); | 157 return sync_engine_->sync_worker_->GetMetadataDatabase(); |
158 } | 158 } |
159 | 159 |
| 160 void SetHasRefreshToken(bool has_refresh_token) { |
| 161 sync_engine_->sync_worker_->SetHasRefreshToken(has_refresh_token); |
| 162 } |
| 163 |
160 private: | 164 private: |
161 content::TestBrowserThreadBundle browser_threads_; | 165 content::TestBrowserThreadBundle browser_threads_; |
162 base::ScopedTempDir profile_dir_; | 166 base::ScopedTempDir profile_dir_; |
163 scoped_ptr<leveldb::Env> in_memory_env_; | 167 scoped_ptr<leveldb::Env> in_memory_env_; |
164 | 168 |
165 scoped_ptr<MockExtensionService> extension_service_; | 169 scoped_ptr<MockExtensionService> extension_service_; |
166 scoped_ptr<drive_backend::SyncEngine> sync_engine_; | 170 scoped_ptr<drive_backend::SyncEngine> sync_engine_; |
167 | 171 |
168 DISALLOW_COPY_AND_ASSIGN(SyncEngineTest); | 172 DISALLOW_COPY_AND_ASSIGN(SyncEngineTest); |
169 }; | 173 }; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 base::Bind(&SyncEngineTest::CheckServiceState, | 341 base::Bind(&SyncEngineTest::CheckServiceState, |
338 AsWeakPtr(), | 342 AsWeakPtr(), |
339 SYNC_STATUS_OK, | 343 SYNC_STATUS_OK, |
340 REMOTE_SERVICE_OK)); | 344 REMOTE_SERVICE_OK)); |
341 | 345 |
342 base::RunLoop().RunUntilIdle(); | 346 base::RunLoop().RunUntilIdle(); |
343 } | 347 } |
344 | 348 |
345 } // namespace drive_backend | 349 } // namespace drive_backend |
346 } // namespace sync_file_system | 350 } // namespace sync_file_system |
OLD | NEW |