Commit dfb96619 authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

Sync: Clean up remaining site of unnecessary deferred startup

Followup to https://crrev.com/c/1989533

Sync supports delaying the engine startup by 10 seconds. This is meant
for avoiding contention during browser startup.
Before this CL, the 10-second delay would also apply in one other
(rare) situation, for no good reason other than some tests depending on
this behavior. Two of these tests were recently fixed (in
crrev.com/c/2339986), and the one remaining one is fixed in this CL.
With that, the delayed startup can now go away!

Bug: 1035874
Change-Id: I865d0bc3caac4d8f0712489ccbad526f912ccdce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2343036Reviewed-by: default avatarMaksim Moskvitin <mmoskvitin@google.com>
Commit-Queue: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796819}
parent d0411fc9
...@@ -442,10 +442,14 @@ IN_PROC_BROWSER_TEST_F(EnableDisableSingleClientTest, ClearsPrefsIfClearData) { ...@@ -442,10 +442,14 @@ IN_PROC_BROWSER_TEST_F(EnableDisableSingleClientTest, ClearsPrefsIfClearData) {
SetupTest(/*all_types_enabled=*/true); SetupTest(/*all_types_enabled=*/true);
SyncPrefs prefs(GetProfile(0)->GetPrefs()); SyncPrefs prefs(GetProfile(0)->GetPrefs());
ASSERT_NE("", prefs.GetCacheGuid()); const std::string initial_cache_guid = prefs.GetCacheGuid();
ASSERT_NE("", initial_cache_guid);
GetClient(0)->StopSyncServiceAndClearData(); GetClient(0)->StopSyncServiceAndClearData();
EXPECT_EQ("", prefs.GetCacheGuid()); // After "stop and clear", the SyncService may immediately start up again in
// transport-only mode, creating a new cache GUID. So the cache GUID may be
// non-empty now, but it must be different from the previous one.
EXPECT_NE(initial_cache_guid, prefs.GetCacheGuid());
} }
IN_PROC_BROWSER_TEST_F(EnableDisableSingleClientTest, IN_PROC_BROWSER_TEST_F(EnableDisableSingleClientTest,
......
...@@ -1567,12 +1567,7 @@ void ProfileSyncService::OnSyncRequestedPrefChange(bool is_sync_requested) { ...@@ -1567,12 +1567,7 @@ void ProfileSyncService::OnSyncRequestedPrefChange(bool is_sync_requested) {
} }
// Try to start up again (in transport-only mode). // Try to start up again (in transport-only mode).
// TODO(crbug.com/1035874): There's no real need to delay the startup here, startup_controller_->TryStart(/*force_immediate=*/true);
// i.e. it should be fine to set force_immediate to true. However currently
// some tests depend on the startup *not* happening immediately (because
// they want to check that Sync (the feature) got disabled, which is hard to
// do if the engine starts up again immediately).
startup_controller_->TryStart(/*force_immediate=*/false);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment