diff options
author | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-03 23:01:26 +0000 |
---|---|---|
committer | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-03 23:01:26 +0000 |
commit | 16667be8a31e03529c3b0c996565faad8193a26b (patch) | |
tree | 06611f1b53e52af7320a489d0acae6edd6a3af35 /sync | |
parent | a283d31f5111e513328c3fa4707728419188f7a3 (diff) | |
download | chromium_src-16667be8a31e03529c3b0c996565faad8193a26b.zip chromium_src-16667be8a31e03529c3b0c996565faad8193a26b.tar.gz chromium_src-16667be8a31e03529c3b0c996565faad8193a26b.tar.bz2 |
[Sync] Fix gu source generation when downloading control types
We now properly set either NEW_CLIENT (if !HasSyncSetupCompleted) or
NEWLY_SUPPORTED_DATATYPE otherwise.
BUG=none
Review URL: https://chromiumcodereview.appspot.com/14884006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198220 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync')
-rw-r--r-- | sync/internal_api/public/test/fake_sync_manager.h | 7 | ||||
-rw-r--r-- | sync/internal_api/test/fake_sync_manager.cc | 10 |
2 files changed, 16 insertions, 1 deletions
diff --git a/sync/internal_api/public/test/fake_sync_manager.h b/sync/internal_api/public/test/fake_sync_manager.h index c03b4f5..25b28f6 100644 --- a/sync/internal_api/public/test/fake_sync_manager.h +++ b/sync/internal_api/public/test/fake_sync_manager.h @@ -57,6 +57,10 @@ class FakeSyncManager : public SyncManager { // Returns the types that have most recently received a refresh request. ModelTypeSet GetLastRefreshRequestTypes(); + // Returns the most recent configuration reason since the last call to + // GetAndResetConfigureReason, or since startup if never called. + ConfigureReason GetAndResetConfigureReason(); + // Posts a method to invalidate the given IDs on the sync thread. void Invalidate(const ObjectIdInvalidationMap& invalidation_map); @@ -158,6 +162,9 @@ class FakeSyncManager : public SyncManager { // The types for which a refresh was most recently requested. ModelTypeSet last_refresh_request_types_; + // The most recent configure reason. + ConfigureReason last_configure_reason_; + scoped_ptr<FakeSyncEncryptionHandler> fake_encryption_handler_; TestUserShare test_user_share_; diff --git a/sync/internal_api/test/fake_sync_manager.cc b/sync/internal_api/test/fake_sync_manager.cc index 09ee239..674c5be 100644 --- a/sync/internal_api/test/fake_sync_manager.cc +++ b/sync/internal_api/test/fake_sync_manager.cc @@ -30,7 +30,8 @@ FakeSyncManager::FakeSyncManager(ModelTypeSet initial_sync_ended_types, ModelTypeSet configure_fail_types) : initial_sync_ended_types_(initial_sync_ended_types), progress_marker_types_(progress_marker_types), - configure_fail_types_(configure_fail_types) { + configure_fail_types_(configure_fail_types), + last_configure_reason_(CONFIGURE_REASON_UNKNOWN) { fake_encryption_handler_.reset(new FakeSyncEncryptionHandler()); } @@ -54,6 +55,12 @@ ModelTypeSet FakeSyncManager::GetAndResetEnabledTypes() { return enabled_types; } +ConfigureReason FakeSyncManager::GetAndResetConfigureReason() { + ConfigureReason reason = last_configure_reason_; + last_configure_reason_ = CONFIGURE_REASON_UNKNOWN; + return reason; +} + void FakeSyncManager::Invalidate( const ObjectIdInvalidationMap& invalidation_map) { if (!sync_task_runner_->PostTask( @@ -190,6 +197,7 @@ void FakeSyncManager::ConfigureSyncer( const ModelSafeRoutingInfo& new_routing_info, const base::Closure& ready_task, const base::Closure& retry_task) { + last_configure_reason_ = reason; ModelTypeSet enabled_types = GetRoutingInfoTypes(new_routing_info); ModelTypeSet disabled_types = Difference( ModelTypeSet::All(), enabled_types); |