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

Unified Diff: components/sync_driver/startup_controller_unittest.cc

Issue 2159453002: [Sync] Don't start up sync when FirstSetupCompleted is false and no setup in progress (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android fix attempt Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/sync_driver/startup_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync_driver/startup_controller_unittest.cc
diff --git a/components/sync_driver/startup_controller_unittest.cc b/components/sync_driver/startup_controller_unittest.cc
index eb83d9da3b686dcf14de54525797a69cdf5ee6c5..cb6ac3ed0843c5e9789dfa44cf630c9390fa84cf 100644
--- a/components/sync_driver/startup_controller_unittest.cc
+++ b/components/sync_driver/startup_controller_unittest.cc
@@ -86,14 +86,14 @@ class StartupControllerTest : public testing::Test {
std::unique_ptr<StartupController> controller_;
};
-// Test that sync doesn't start until all conditions are met.
-TEST_F(StartupControllerTest, Basic) {
+// Test that sync doesn't start if setup is not in progress or complete.
+TEST_F(StartupControllerTest, NoSetupComplete) {
controller()->TryStart();
ExpectNotStarted();
SetCanStart(true);
controller()->TryStart();
- ExpectStarted();
+ ExpectNotStarted();
}
// Test that sync defers if first setup is complete.
@@ -189,17 +189,11 @@ TEST_F(StartupControllerTest, SetupInProgressTriggerInterruptsDeferral) {
ExpectStarted();
}
-// Test that start isn't deferred on the first start but is on restarts.
-TEST_F(StartupControllerTest, DeferralOnRestart) {
+// Test that immediate startup can be forced.
+TEST_F(StartupControllerTest, ForceImmediateStartup) {
SetCanStart(true);
- controller()->TryStart();
+ controller()->TryStartImmediately();
ExpectStarted();
-
- clear_started();
- controller()->Reset(syncer::UserTypes());
- ExpectNotStarted();
- controller()->TryStart();
- ExpectStartDeferred();
}
// Test that setup-in-progress tracking is persistent across a Reset.
« no previous file with comments | « components/sync_driver/startup_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698