| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/test_profile_sync_service.h" | 5 #include "chrome/browser/sync/test_profile_sync_service.h" |
| 6 | 6 |
| 7 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" | 7 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" |
| 8 #include "chrome/browser/sync/engine/syncapi.h" | 8 #include "chrome/browser/sync/engine/syncapi.h" |
| 9 #include "chrome/browser/sync/glue/data_type_controller.h" | 9 #include "chrome/browser/sync/glue/data_type_controller.h" |
| 10 #include "chrome/browser/sync/glue/sync_backend_host.h" | 10 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 i != enabled_types.end(); ++i) { | 78 i != enabled_types.end(); ++i) { |
| 79 sync_ended.set(i->first); | 79 sync_ended.set(i->first); |
| 80 } | 80 } |
| 81 | 81 |
| 82 if (fail_initial_download_) | 82 if (fail_initial_download_) |
| 83 sync_ended.reset(); | 83 sync_ended.reset(); |
| 84 | 84 |
| 85 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot( | 85 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot( |
| 86 SyncerStatus(), ErrorCounters(), 0, false, | 86 SyncerStatus(), ErrorCounters(), 0, false, |
| 87 sync_ended, download_progress_markers, false, false, 0, 0, 0, false, | 87 sync_ended, download_progress_markers, false, false, 0, 0, 0, false, |
| 88 SyncSourceInfo(), 0)); | 88 SyncSourceInfo(), 0, base::Time::Now())); |
| 89 } | 89 } |
| 90 | 90 |
| 91 sync_api::HttpPostProviderFactory* | 91 sync_api::HttpPostProviderFactory* |
| 92 SyncBackendHostForProfileSyncTest::MakeHttpBridgeFactory( | 92 SyncBackendHostForProfileSyncTest::MakeHttpBridgeFactory( |
| 93 const scoped_refptr<net::URLRequestContextGetter>& getter) { | 93 const scoped_refptr<net::URLRequestContextGetter>& getter) { |
| 94 return new browser_sync::TestHttpBridgeFactory; | 94 return new browser_sync::TestHttpBridgeFactory; |
| 95 } | 95 } |
| 96 | 96 |
| 97 void SyncBackendHostForProfileSyncTest::InitCore( | 97 void SyncBackendHostForProfileSyncTest::InitCore( |
| 98 const Core::DoInitializeOptions& options) { | 98 const Core::DoInitializeOptions& options) { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop(); | 153 SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop(); |
| 154 if (initialization_state_ == DOWNLOADING_NIGORI) { | 154 if (initialization_state_ == DOWNLOADING_NIGORI) { |
| 155 syncable::ModelTypeBitSet sync_ended; | 155 syncable::ModelTypeBitSet sync_ended; |
| 156 | 156 |
| 157 if (!fail_initial_download_) | 157 if (!fail_initial_download_) |
| 158 sync_ended.set(syncable::NIGORI); | 158 sync_ended.set(syncable::NIGORI); |
| 159 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; | 159 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; |
| 160 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot( | 160 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot( |
| 161 SyncerStatus(), ErrorCounters(), 0, false, | 161 SyncerStatus(), ErrorCounters(), 0, false, |
| 162 sync_ended, download_progress_markers, false, false, 0, 0, 0, false, | 162 sync_ended, download_progress_markers, false, false, 0, 0, 0, false, |
| 163 SyncSourceInfo(), 0)); | 163 SyncSourceInfo(), 0, base::Time::Now())); |
| 164 } | 164 } |
| 165 } | 165 } |
| 166 | 166 |
| 167 void SyncBackendHostForProfileSyncTest:: | 167 void SyncBackendHostForProfileSyncTest:: |
| 168 SetDefaultExpectationsForWorkerCreation(ProfileMock* profile) { | 168 SetDefaultExpectationsForWorkerCreation(ProfileMock* profile) { |
| 169 EXPECT_CALL(*profile, GetPasswordStore(testing::_)). | 169 EXPECT_CALL(*profile, GetPasswordStore(testing::_)). |
| 170 WillOnce(testing::Return((PasswordStore*)NULL)); | 170 WillOnce(testing::Return((PasswordStore*)NULL)); |
| 171 } | 171 } |
| 172 | 172 |
| 173 void SyncBackendHostForProfileSyncTest::SetHistoryServiceExpectations( | 173 void SyncBackendHostForProfileSyncTest::SetHistoryServiceExpectations( |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 backend_.reset(new browser_sync::SyncBackendHostForProfileSyncTest( | 293 backend_.reset(new browser_sync::SyncBackendHostForProfileSyncTest( |
| 294 profile(), | 294 profile(), |
| 295 set_initial_sync_ended_on_init_, | 295 set_initial_sync_ended_on_init_, |
| 296 synchronous_backend_initialization_, | 296 synchronous_backend_initialization_, |
| 297 fail_initial_download_)); | 297 fail_initial_download_)); |
| 298 } | 298 } |
| 299 | 299 |
| 300 std::string TestProfileSyncService::GetLsidForAuthBootstraping() { | 300 std::string TestProfileSyncService::GetLsidForAuthBootstraping() { |
| 301 return "foo"; | 301 return "foo"; |
| 302 } | 302 } |
| OLD | NEW |