Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Side by Side Diff: sync/engine/sync_scheduler_unittest.cc

Issue 13743003: sync: Finish the SyncScheduler refactor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix ModelNeutralState forward decl Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/test/test_timeouts.h" 10 #include "base/test/test_timeouts.h"
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 717
718 EXPECT_CALL(*syncer(), SyncShare(_,_,_)) 718 EXPECT_CALL(*syncer(), SyncShare(_,_,_))
719 .WillOnce(DoAll( 719 .WillOnce(DoAll(
720 WithArg<0>(sessions::test_util::SimulateThrottled(throttle)), 720 WithArg<0>(sessions::test_util::SimulateThrottled(throttle)),
721 Return(true))) 721 Return(true)))
722 .WillRepeatedly(AddFailureAndQuitLoopNow()); 722 .WillRepeatedly(AddFailureAndQuitLoopNow());
723 723
724 StartSyncScheduler(SyncScheduler::NORMAL_MODE); 724 StartSyncScheduler(SyncScheduler::NORMAL_MODE);
725 725
726 scheduler()->ScheduleNudgeAsync( 726 scheduler()->ScheduleNudgeAsync(
727 zero(), NUDGE_SOURCE_LOCAL, types, FROM_HERE); 727 TimeDelta::FromMicroseconds(1), NUDGE_SOURCE_LOCAL, types, FROM_HERE);
728 PumpLoop(); 728 PumpLoop();
729 729
730 StartSyncScheduler(SyncScheduler::CONFIGURATION_MODE); 730 StartSyncScheduler(SyncScheduler::CONFIGURATION_MODE);
731 731
732 CallbackCounter counter; 732 CallbackCounter counter;
733 ConfigurationParams params( 733 ConfigurationParams params(
734 GetUpdatesCallerInfo::RECONFIGURATION, 734 GetUpdatesCallerInfo::RECONFIGURATION,
735 types, 735 types,
736 TypesToRoutingInfo(types), 736 TypesToRoutingInfo(types),
737 base::Bind(&CallbackCounter::Callback, base::Unretained(&counter))); 737 base::Bind(&CallbackCounter::Callback, base::Unretained(&counter)));
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
1288 base::Bind(&CallbackCounter::Callback, base::Unretained(&counter))); 1288 base::Bind(&CallbackCounter::Callback, base::Unretained(&counter)));
1289 scheduler()->ScheduleConfiguration(params); 1289 scheduler()->ScheduleConfiguration(params);
1290 1290
1291 scheduler()->OnConnectionStatusChange(); 1291 scheduler()->OnConnectionStatusChange();
1292 scheduler()->OnConnectionStatusChange(); 1292 scheduler()->OnConnectionStatusChange();
1293 1293
1294 PumpLoop(); // Run the nudge, that will fail and schedule a quick retry. 1294 PumpLoop(); // Run the nudge, that will fail and schedule a quick retry.
1295 } 1295 }
1296 1296
1297 } // namespace syncer 1297 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698