diff options
author | pavely@chromium.org <pavely@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-17 17:44:47 +0000 |
---|---|---|
committer | pavely@chromium.org <pavely@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-17 17:44:47 +0000 |
commit | 331604491f2c1f7106551162209dfff2f1628c84 (patch) | |
tree | 8891be64027809bb25b77fe256c4688838d03fe8 /sync/internal_api/sync_manager_impl_unittest.cc | |
parent | 29e13ba3426f3f938dd0de1c473dd381c0ac224c (diff) | |
download | chromium_src-331604491f2c1f7106551162209dfff2f1628c84.zip chromium_src-331604491f2c1f7106551162209dfff2f1628c84.tar.gz chromium_src-331604491f2c1f7106551162209dfff2f1628c84.tar.bz2 |
Pass retry_task to SyncScheduler::ScheduleConfiguration
Pass retry_task through ConfigurationParams to
SyncScheduler::ScheduleConfiguration. We might in the future do
configuration asynchronously and passing retry_task through asynchronous
calls will be handy.
SyncManagerTestWithMockScheduler.ConfigurationRetry is no longer needed,
SyncSchedulerTest.ConfigWithBackingOff tests this functionality.
BUG=259913
Review URL: https://codereview.chromium.org/62283011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235541 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/sync_manager_impl_unittest.cc')
-rw-r--r-- | sync/internal_api/sync_manager_impl_unittest.cc | 38 |
1 files changed, 3 insertions, 35 deletions
diff --git a/sync/internal_api/sync_manager_impl_unittest.cc b/sync/internal_api/sync_manager_impl_unittest.cc index 542b082..d2ca734 100644 --- a/sync/internal_api/sync_manager_impl_unittest.cc +++ b/sync/internal_api/sync_manager_impl_unittest.cc @@ -2780,7 +2780,7 @@ class MockSyncScheduler : public FakeSyncScheduler { virtual ~MockSyncScheduler() {} MOCK_METHOD1(Start, void(SyncScheduler::Mode)); - MOCK_METHOD1(ScheduleConfiguration, bool(const ConfigurationParams&)); + MOCK_METHOD1(ScheduleConfiguration, void(const ConfigurationParams&)); }; class ComponentsFactory : public TestInternalComponentsFactory { @@ -2838,7 +2838,7 @@ TEST_F(SyncManagerTestWithMockScheduler, BasicConfiguration) { ConfigurationParams params; EXPECT_CALL(*scheduler(), Start(SyncScheduler::CONFIGURATION_MODE)); EXPECT_CALL(*scheduler(), ScheduleConfiguration(_)). - WillOnce(DoAll(SaveArg<0>(¶ms), Return(true))); + WillOnce(SaveArg<0>(¶ms)); // Set data for all types. ModelTypeSet protocol_types = ProtocolTypes(); @@ -2890,7 +2890,7 @@ TEST_F(SyncManagerTestWithMockScheduler, ReConfiguration) { ConfigurationParams params; EXPECT_CALL(*scheduler(), Start(SyncScheduler::CONFIGURATION_MODE)); EXPECT_CALL(*scheduler(), ScheduleConfiguration(_)). - WillOnce(DoAll(SaveArg<0>(¶ms), Return(true))); + WillOnce(SaveArg<0>(¶ms)); // Set data for all types except those recently disabled (so we can verify // only those recently disabled are purged) . @@ -2931,38 +2931,6 @@ TEST_F(SyncManagerTestWithMockScheduler, ReConfiguration) { ProtocolTypes()).Equals(disabled_types)); } -// Test that the retry callback is invoked on configuration failure. -TEST_F(SyncManagerTestWithMockScheduler, ConfigurationRetry) { - ConfigureReason reason = CONFIGURE_REASON_RECONFIGURATION; - ModelTypeSet types_to_download(BOOKMARKS, PREFERENCES); - ModelSafeRoutingInfo new_routing_info; - GetModelSafeRoutingInfo(&new_routing_info); - - ConfigurationParams params; - EXPECT_CALL(*scheduler(), Start(SyncScheduler::CONFIGURATION_MODE)); - EXPECT_CALL(*scheduler(), ScheduleConfiguration(_)). - WillOnce(DoAll(SaveArg<0>(¶ms), Return(false))); - - CallbackCounter ready_task_counter, retry_task_counter; - sync_manager_.ConfigureSyncer( - reason, - types_to_download, - ModelTypeSet(), - ModelTypeSet(), - ModelTypeSet(), - new_routing_info, - base::Bind(&CallbackCounter::Callback, - base::Unretained(&ready_task_counter)), - base::Bind(&CallbackCounter::Callback, - base::Unretained(&retry_task_counter))); - EXPECT_EQ(0, ready_task_counter.times_called()); - EXPECT_EQ(1, retry_task_counter.times_called()); - EXPECT_EQ(sync_pb::GetUpdatesCallerInfo::RECONFIGURATION, - params.source); - EXPECT_TRUE(types_to_download.Equals(params.types_to_download)); - EXPECT_EQ(new_routing_info, params.routing_info); -} - // Test that PurgePartiallySyncedTypes purges only those types that have not // fully completed their initial download and apply. TEST_F(SyncManagerTest, PurgePartiallySyncedTypes) { |