Commit c43ef308 authored by Mikel Astiz's avatar Mikel Astiz Committed by Commit Bot

[sync] Fix E2E tests crashing with search engines

Starting with http://crrev.com/c/2434329, which actually landed some
time ago now, TwoClientSearchEnginesSyncTest::SetupClients() incorrectly
assumed that there always exist two clients.

The caveat is, for E2E tests, ResetSyncForPrimaryAccount() sets up
exactly one client as a convenient way to reset sync.

Change-Id: Ie7967694e13090a5317de4d2422ba2fadecd7aa9
Bug: 1147195
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2527203Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825742}
parent b0ac69e5
...@@ -41,10 +41,13 @@ class TwoClientSearchEnginesSyncTest : public SyncTest { ...@@ -41,10 +41,13 @@ class TwoClientSearchEnginesSyncTest : public SyncTest {
return false; return false;
} }
search_test_utils::WaitForTemplateURLServiceToLoad( // In most cases this codepath should have exactly two clients, but there is
TemplateURLServiceFactory::GetForProfile(GetProfile(0))); // an exception for E2E tests, where ResetSyncForPrimaryAccount()
search_test_utils::WaitForTemplateURLServiceToLoad( // temporarily sets up one only.
TemplateURLServiceFactory::GetForProfile(GetProfile(1))); for (int i = 0; i < num_clients(); ++i) {
search_test_utils::WaitForTemplateURLServiceToLoad(
TemplateURLServiceFactory::GetForProfile(GetProfile(i)));
}
return true; return true;
} }
......
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