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

Unified Diff: chrome/browser/sync/test/integration/two_client_uss_sync_test.cc

Issue 2694503002: [USS] Fix USS in sync_integration_tests in chromeos (Closed)
Patch Set: modified comments Created 3 years, 10 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 | « chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/test/integration/two_client_uss_sync_test.cc
diff --git a/chrome/browser/sync/test/integration/two_client_uss_sync_test.cc b/chrome/browser/sync/test/integration/two_client_uss_sync_test.cc
index bbc32048e76ec01eb85f7fee2756d7c854d81dcd..7457bc1f231b251a598854ff6f96f05adef2e0f2 100644
--- a/chrome/browser/sync/test/integration/two_client_uss_sync_test.cc
+++ b/chrome/browser/sync/test/integration/two_client_uss_sync_test.cc
@@ -201,6 +201,13 @@ class TwoClientUssSyncTest : public SyncTest {
ProfileSyncServiceFactory::SetSyncClientFactoryForTest(
&sync_client_factory_);
ProfileSyncComponentsFactoryImpl::OverridePrefsForUssTest(true);
+ // The test infra creates a profile before the two made for sync tests.
+ number_of_clients_ignored_ = 1;
+#if defined(OS_CHROMEOS)
+ // ChromeOS will force loading a signin profile, so we need to ingore one
+ // more client.
+ ++number_of_clients_ignored_;
+#endif
}
~TwoClientUssSyncTest() override {
@@ -216,9 +223,8 @@ class TwoClientUssSyncTest : public SyncTest {
protected:
std::unique_ptr<syncer::SyncClient> CreateSyncClient(Profile* profile) {
- if (!first_client_ignored_) {
- // The test infra creates a profile before the two made for sync tests.
- first_client_ignored_ = true;
+ if (number_of_clients_ignored_ > 0) {
+ --number_of_clients_ignored_;
return base::MakeUnique<ChromeSyncClient>(profile);
}
auto bridge = base::MakeUnique<TestModelTypeSyncBridge>();
@@ -231,7 +237,7 @@ class TwoClientUssSyncTest : public SyncTest {
ProfileSyncServiceFactory::SyncClientFactory sync_client_factory_;
std::vector<std::unique_ptr<TestModelTypeSyncBridge>> bridges_;
std::vector<TestSyncClient*> clients_;
- bool first_client_ignored_ = false;
+ size_t number_of_clients_ignored_;
private:
DISALLOW_COPY_AND_ASSIGN(TwoClientUssSyncTest);
« no previous file with comments | « chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698