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

Unified Diff: components/sync_driver/startup_controller_unittest.cc

Issue 1789433002: [Sync] Start up immediately when entering the sync setup UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setup
Patch Set: Created 4 years, 9 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
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 6fada804e5b236de484cc1829f40b0af00a5c00f..35ceaf96809a176c97e726485afa722e1e2f43fe 100644
--- a/components/sync_driver/startup_controller_unittest.cc
+++ b/components/sync_driver/startup_controller_unittest.cc
@@ -168,9 +168,18 @@ TEST_F(StartupControllerTest, DataTypeTriggered) {
sync_prefs()->SetFirstSetupComplete();
signin()->set_account_id(kTestUser);
token_service()->UpdateCredentials(kTestUser, kTestToken);
+
+ // Test a cold start.
+ controller()->OnDataTypeRequestsSyncStartup(syncer::SESSIONS);
+ ExpectStarted();
+
+ clear_started();
+ controller()->Reset(syncer::UserTypes());
+ ExpectNotStarted();
+
+ // Test interrupting a deferred start.
Nicolas Zea 2016/03/14 22:42:01 Maybe split this into two separate tests?
maxbogue 2016/03/15 17:41:01 Done.
controller()->TryStart();
ExpectStartDeferred();
-
controller()->OnDataTypeRequestsSyncStartup(syncer::SESSIONS);
ExpectStarted();
@@ -227,8 +236,20 @@ TEST_F(StartupControllerTest, NoDeferralWithSetupInProgress) {
sync_prefs()->SetFirstSetupComplete();
signin()->set_account_id(kTestUser);
token_service()->UpdateCredentials(kTestUser, kTestToken);
- controller()->set_setup_in_progress(true);
+
+ // Test a cold start.
+ controller()->SetSetupInProgress(true);
+ ExpectStarted();
+
+ clear_started();
+ controller()->Reset(syncer::UserTypes());
+ controller()->SetSetupInProgress(false);
+ ExpectNotStarted();
+
+ // Test interrupting a deferred start.
Nicolas Zea 2016/03/14 22:42:01 This also seems like it could be two different tes
maxbogue 2016/03/15 17:41:01 Done.
controller()->TryStart();
+ ExpectStartDeferred();
+ controller()->SetSetupInProgress(true);
ExpectStarted();
}
@@ -252,7 +273,7 @@ TEST_F(StartupControllerTest, ResetDuringSetup) {
token_service()->UpdateCredentials(kTestUser, kTestToken);
// Simulate UI telling us setup is in progress.
- controller()->set_setup_in_progress(true);
+ controller()->SetSetupInProgress(true);
// This could happen if the UI triggers a stop-syncing permanently call.
controller()->Reset(syncer::UserTypes());
« components/sync_driver/startup_controller.cc ('K') | « components/sync_driver/startup_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698