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

Unified Diff: components/browser_sync/profile_sync_service_unittest.cc

Issue 2961673002: [sync] Fix IsSyncConfirmationNeeded crash when local backend is enabled (Closed)
Patch Set: Fix cros test Created 3 years, 6 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/browser_sync/profile_sync_service_startup_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/browser_sync/profile_sync_service_unittest.cc
diff --git a/components/browser_sync/profile_sync_service_unittest.cc b/components/browser_sync/profile_sync_service_unittest.cc
index 4d56b6d76b8fc9c020936a5cdbc63b58844f2f33..d5aa12bb29dc88ed2f8b3b9f59d93bce467aaea5 100644
--- a/components/browser_sync/profile_sync_service_unittest.cc
+++ b/components/browser_sync/profile_sync_service_unittest.cc
@@ -222,6 +222,7 @@ class ProfileSyncServiceTest : public ::testing::Test {
prefs()->SetBoolean(syncer::prefs::kEnableLocalSyncBackend, true);
init_params.oauth2_token_service = nullptr;
init_params.gaia_cookie_manager_service = nullptr;
+ init_params.signin_wrapper.reset();
service_ = base::MakeUnique<ProfileSyncService>(std::move(init_params));
service_->RegisterDataTypeController(
@@ -392,6 +393,7 @@ TEST_F(ProfileSyncServiceTest, SuccessfulLocalBackendInitialization) {
InitializeForNthSync();
EXPECT_FALSE(service()->IsManaged());
EXPECT_TRUE(service()->IsSyncActive());
+ EXPECT_FALSE(service()->IsSyncConfirmationNeeded());
}
// Verify that an initialization where first setup is not complete does not
@@ -401,12 +403,14 @@ TEST_F(ProfileSyncServiceTest, NeedsConfirmation) {
base::MakeUnique<base::Value>(false));
IssueTestTokens();
CreateService(ProfileSyncService::MANUAL_START);
+
syncer::SyncPrefs sync_prefs(prefs());
base::Time now = base::Time::Now();
sync_prefs.SetLastSyncedTime(now);
sync_prefs.SetKeepEverythingSynced(true);
service()->Initialize();
EXPECT_FALSE(service()->IsSyncActive());
+ EXPECT_TRUE(service()->IsSyncConfirmationNeeded());
// The last sync time shouldn't be cleared.
// TODO(zea): figure out a way to check that the directory itself wasn't
« no previous file with comments | « components/browser_sync/profile_sync_service_startup_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698