Chromium Code Reviews| 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; | |
| 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)) { |
|
rlarocque
2012/07/30 20:55:33
It's possible this entire if block could be remove
dcheng
2012/07/30 20:58:19
What would I need to do to verify that removing th
| |
| 122 ProfileSyncServiceTestHelper::CreateRoot( | 121 ProfileSyncServiceTestHelper::CreateRoot( |
| 123 syncer::NIGORI, user_share, &id_factory_); | 122 syncer::NIGORI, user_share, &id_factory_); |
| 124 | 123 |
| 125 // A side effect of adding the NIGORI mode (normally done by the | 124 // A side effect of adding the NIGORI mode (normally done by the |
| 126 // syncer) is a decryption attempt, which will fail the first time. | 125 // syncer) is a decryption attempt, which will fail the first time. |
| 127 send_passphrase_required = true; | |
| 128 } | 126 } |
| 129 | 127 |
| 130 SetInitialSyncEndedForAllTypes(); | 128 SetInitialSyncEndedForAllTypes(); |
| 131 restored_types = syncer::ModelTypeSet::All(); | 129 restored_types = syncer::ModelTypeSet::All(); |
| 132 } | 130 } |
| 133 } | 131 } |
| 134 | 132 |
| 135 SyncBackendHost::HandleSyncManagerInitializationOnFrontendLoop( | 133 SyncBackendHost::HandleSyncManagerInitializationOnFrontendLoop( |
| 136 js_backend, success, restored_types); | 134 js_backend, success, restored_types); |
| 137 } | 135 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 227 profile(), | 225 profile(), |
| 228 sync_prefs_.AsWeakPtr(), | 226 sync_prefs_.AsWeakPtr(), |
| 229 invalidator_storage_.AsWeakPtr(), | 227 invalidator_storage_.AsWeakPtr(), |
| 230 id_factory_, | 228 id_factory_, |
| 231 callback_, | 229 callback_, |
| 232 set_initial_sync_ended_on_init_, | 230 set_initial_sync_ended_on_init_, |
| 233 synchronous_backend_initialization_, | 231 synchronous_backend_initialization_, |
| 234 fail_initial_download_, | 232 fail_initial_download_, |
| 235 use_real_database_)); | 233 use_real_database_)); |
| 236 } | 234 } |
| OLD | NEW |