OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/signin/signin_manager.h" | 7 #include "chrome/browser/signin/signin_manager.h" |
8 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" | 8 #include "chrome/browser/sync/abstract_profile_sync_service_test.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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
98 FinishConfigureDataTypesOnFrontendLoop(failed_configuration_types, | 98 FinishConfigureDataTypesOnFrontendLoop(failed_configuration_types, |
99 ready_task); | 99 ready_task); |
100 } | 100 } |
101 | 101 |
102 void SyncBackendHostForProfileSyncTest | 102 void SyncBackendHostForProfileSyncTest |
103 ::HandleSyncManagerInitializationOnFrontendLoop( | 103 ::HandleSyncManagerInitializationOnFrontendLoop( |
104 const syncer::WeakHandle<syncer::JsBackend>& js_backend, bool success, | 104 const syncer::WeakHandle<syncer::JsBackend>& js_backend, bool success, |
105 syncer::ModelTypeSet restored_types) { | 105 syncer::ModelTypeSet restored_types) { |
106 // Here's our opportunity to pretend to do things that the SyncManager would | 106 // Here's our opportunity to pretend to do things that the SyncManager would |
107 // normally do during initialization, but can't because this is a test. | 107 // normally do during initialization, but can't because this is a test. |
108 bool send_passphrase_required = false; | |
not at google - send to devlin
2012/07/31 06:53:09
what's this change?
chebert
2012/08/02 23:56:40
Whoops. This was so unittests would compile (this
| |
109 if (success) { | 108 if (success) { |
110 // Set up any nodes the test wants around before model association. | 109 // Set up any nodes the test wants around before model association. |
111 if (!callback_.is_null()) { | 110 if (!callback_.is_null()) { |
112 callback_.Run(); | 111 callback_.Run(); |
113 } | 112 } |
114 | 113 |
115 // Pretend we downloaded initial updates and set initial sync ended bits | 114 // Pretend we downloaded initial updates and set initial sync ended bits |
116 // if we were asked to. | 115 // if we were asked to. |
117 if (set_initial_sync_ended_on_init_) { | 116 if (set_initial_sync_ended_on_init_) { |
118 UserShare* user_share = GetUserShare(); | 117 UserShare* user_share = GetUserShare(); |
119 Directory* directory = user_share->directory.get(); | 118 Directory* directory = user_share->directory.get(); |
120 | 119 |
121 if (!directory->initial_sync_ended_for_type(syncer::NIGORI)) { | 120 if (!directory->initial_sync_ended_for_type(syncer::NIGORI)) { |
122 ProfileSyncServiceTestHelper::CreateRoot( | 121 ProfileSyncServiceTestHelper::CreateRoot( |
123 syncer::NIGORI, user_share, &id_factory_); | 122 syncer::NIGORI, user_share, &id_factory_); |
124 | |
125 // A side effect of adding the NIGORI mode (normally done by the | |
126 // syncer) is a decryption attempt, which will fail the first time. | |
127 send_passphrase_required = true; | |
128 } | 123 } |
129 | 124 |
130 SetInitialSyncEndedForAllTypes(); | 125 SetInitialSyncEndedForAllTypes(); |
131 restored_types = syncer::ModelTypeSet::All(); | 126 restored_types = syncer::ModelTypeSet::All(); |
132 } | 127 } |
133 } | 128 } |
134 | 129 |
135 SyncBackendHost::HandleSyncManagerInitializationOnFrontendLoop( | 130 SyncBackendHost::HandleSyncManagerInitializationOnFrontendLoop( |
136 js_backend, success, restored_types); | 131 js_backend, success, restored_types); |
137 } | 132 } |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
227 profile(), | 222 profile(), |
228 sync_prefs_.AsWeakPtr(), | 223 sync_prefs_.AsWeakPtr(), |
229 invalidator_storage_.AsWeakPtr(), | 224 invalidator_storage_.AsWeakPtr(), |
230 id_factory_, | 225 id_factory_, |
231 callback_, | 226 callback_, |
232 set_initial_sync_ended_on_init_, | 227 set_initial_sync_ended_on_init_, |
233 synchronous_backend_initialization_, | 228 synchronous_backend_initialization_, |
234 fail_initial_download_, | 229 fail_initial_download_, |
235 use_real_database_)); | 230 use_real_database_)); |
236 } | 231 } |
OLD | NEW |