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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 i != enabled_types.end(); ++i) { | 68 i != enabled_types.end(); ++i) { |
69 sync_ended.set(i->first); | 69 sync_ended.set(i->first); |
70 } | 70 } |
71 | 71 |
72 if (fail_initial_download_) | 72 if (fail_initial_download_) |
73 sync_ended.reset(); | 73 sync_ended.reset(); |
74 | 74 |
75 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot( | 75 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot( |
76 SyncerStatus(), ErrorCounters(), 0, false, | 76 SyncerStatus(), ErrorCounters(), 0, false, |
77 sync_ended, download_progress_markers, false, false, 0, 0, 0, false, | 77 sync_ended, download_progress_markers, false, false, 0, 0, 0, false, |
78 SyncSourceInfo(), 0)); | 78 SyncSourceInfo(), 0, base::Time::Now())); |
79 } | 79 } |
80 | 80 |
81 sync_api::HttpPostProviderFactory* | 81 sync_api::HttpPostProviderFactory* |
82 SyncBackendHostForProfileSyncTest::MakeHttpBridgeFactory( | 82 SyncBackendHostForProfileSyncTest::MakeHttpBridgeFactory( |
83 const scoped_refptr<net::URLRequestContextGetter>& getter) { | 83 const scoped_refptr<net::URLRequestContextGetter>& getter) { |
84 return new browser_sync::TestHttpBridgeFactory; | 84 return new browser_sync::TestHttpBridgeFactory; |
85 } | 85 } |
86 | 86 |
87 void SyncBackendHostForProfileSyncTest::InitCore( | 87 void SyncBackendHostForProfileSyncTest::InitCore( |
88 const Core::DoInitializeOptions& options) { | 88 const Core::DoInitializeOptions& options) { |
(...skipping 20 matching lines...) Expand all Loading... |
109 SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop(); | 109 SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop(); |
110 if (initialization_state_ == DOWNLOADING_NIGORI) { | 110 if (initialization_state_ == DOWNLOADING_NIGORI) { |
111 syncable::ModelTypeBitSet sync_ended; | 111 syncable::ModelTypeBitSet sync_ended; |
112 | 112 |
113 if (!fail_initial_download_) | 113 if (!fail_initial_download_) |
114 sync_ended.set(syncable::NIGORI); | 114 sync_ended.set(syncable::NIGORI); |
115 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; | 115 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; |
116 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot( | 116 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot( |
117 SyncerStatus(), ErrorCounters(), 0, false, | 117 SyncerStatus(), ErrorCounters(), 0, false, |
118 sync_ended, download_progress_markers, false, false, 0, 0, 0, false, | 118 sync_ended, download_progress_markers, false, false, 0, 0, 0, false, |
119 SyncSourceInfo(), 0)); | 119 SyncSourceInfo(), 0, base::Time::Now())); |
120 } | 120 } |
121 } | 121 } |
122 | 122 |
123 void SyncBackendHostForProfileSyncTest:: | 123 void SyncBackendHostForProfileSyncTest:: |
124 SetDefaultExpectationsForWorkerCreation(ProfileMock* profile) { | 124 SetDefaultExpectationsForWorkerCreation(ProfileMock* profile) { |
125 EXPECT_CALL(*profile, GetPasswordStore(testing::_)). | 125 EXPECT_CALL(*profile, GetPasswordStore(testing::_)). |
126 WillOnce(testing::Return((PasswordStore*)NULL)); | 126 WillOnce(testing::Return((PasswordStore*)NULL)); |
127 } | 127 } |
128 | 128 |
129 void SyncBackendHostForProfileSyncTest::SetHistoryServiceExpectations( | 129 void SyncBackendHostForProfileSyncTest::SetHistoryServiceExpectations( |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 fail_initial_download_ = true; | 247 fail_initial_download_ = true; |
248 } | 248 } |
249 | 249 |
250 void TestProfileSyncService::CreateBackend() { | 250 void TestProfileSyncService::CreateBackend() { |
251 backend_.reset(new browser_sync::SyncBackendHostForProfileSyncTest( | 251 backend_.reset(new browser_sync::SyncBackendHostForProfileSyncTest( |
252 profile(), | 252 profile(), |
253 set_initial_sync_ended_on_init_, | 253 set_initial_sync_ended_on_init_, |
254 synchronous_backend_initialization_, | 254 synchronous_backend_initialization_, |
255 fail_initial_download_)); | 255 fail_initial_download_)); |
256 } | 256 } |
OLD | NEW |