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

Side by Side Diff: chrome/browser/sync/test/integration/two_client_themes_sync_test.cc

Issue 148723002: [sync] Eliminate Await*SyncCompletion methods in integration tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address feedback Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" 6 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
7 #include "chrome/browser/sync/test/integration/sync_test.h" 7 #include "chrome/browser/sync/test/integration/sync_test.h"
8 #include "chrome/browser/sync/test/integration/themes_helper.h" 8 #include "chrome/browser/sync/test/integration/themes_helper.h"
9 9
10 using themes_helper::GetCustomTheme; 10 using themes_helper::GetCustomTheme;
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, DisableThemes) { 197 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, DisableThemes) {
198 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 198 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
199 199
200 ASSERT_FALSE(UsingCustomTheme(GetProfile(0))); 200 ASSERT_FALSE(UsingCustomTheme(GetProfile(0)));
201 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); 201 ASSERT_FALSE(UsingCustomTheme(GetProfile(1)));
202 ASSERT_FALSE(UsingCustomTheme(verifier())); 202 ASSERT_FALSE(UsingCustomTheme(verifier()));
203 203
204 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncer::THEMES)); 204 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncer::THEMES));
205 UseCustomTheme(GetProfile(0), 0); 205 UseCustomTheme(GetProfile(0), 0);
206 UseCustomTheme(verifier(), 0); 206 UseCustomTheme(verifier(), 0);
207 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion()); 207 ASSERT_TRUE(GetClient(0)->AwaitCommitActivityCompletion());
208 208
209 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); 209 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0)));
210 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); 210 ASSERT_FALSE(UsingCustomTheme(GetProfile(1)));
211 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); 211 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier()));
212 212
213 ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncer::THEMES)); 213 ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncer::THEMES));
214 ASSERT_TRUE(AwaitQuiescence()); 214 ASSERT_TRUE(AwaitQuiescence());
215 215
216 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); 216 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0)));
217 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); 217 ASSERT_FALSE(UsingCustomTheme(GetProfile(1)));
218 ASSERT_TRUE(ThemeIsPendingInstall(GetProfile(1), GetCustomTheme(0))); 218 ASSERT_TRUE(ThemeIsPendingInstall(GetProfile(1), GetCustomTheme(0)));
219 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); 219 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier()));
220 } 220 }
221 221
222 // TCM ID - 3687288. 222 // TCM ID - 3687288.
223 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, DisableSync) { 223 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, DisableSync) {
224 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 224 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
225 225
226 ASSERT_FALSE(UsingCustomTheme(GetProfile(0))); 226 ASSERT_FALSE(UsingCustomTheme(GetProfile(0)));
227 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); 227 ASSERT_FALSE(UsingCustomTheme(GetProfile(1)));
228 ASSERT_FALSE(UsingCustomTheme(verifier())); 228 ASSERT_FALSE(UsingCustomTheme(verifier()));
229 229
230 ASSERT_TRUE(GetClient(1)->DisableSyncForAllDatatypes()); 230 ASSERT_TRUE(GetClient(1)->DisableSyncForAllDatatypes());
231 UseCustomTheme(GetProfile(0), 0); 231 UseCustomTheme(GetProfile(0), 0);
232 UseCustomTheme(verifier(), 0); 232 UseCustomTheme(verifier(), 0);
233 ASSERT_TRUE( 233 ASSERT_TRUE(
234 GetClient(0)->AwaitFullSyncCompletion()); 234 GetClient(0)->AwaitCommitActivityCompletion());
235 235
236 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); 236 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0)));
237 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); 237 ASSERT_FALSE(UsingCustomTheme(GetProfile(1)));
238 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); 238 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier()));
239 239
240 ASSERT_TRUE(GetClient(1)->EnableSyncForAllDatatypes()); 240 ASSERT_TRUE(GetClient(1)->EnableSyncForAllDatatypes());
241 ASSERT_TRUE(AwaitQuiescence()); 241 ASSERT_TRUE(AwaitQuiescence());
242 242
243 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); 243 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0)));
244 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); 244 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier()));
245 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); 245 ASSERT_FALSE(UsingCustomTheme(GetProfile(1)));
246 ASSERT_TRUE(ThemeIsPendingInstall(GetProfile(1), GetCustomTheme(0))); 246 ASSERT_TRUE(ThemeIsPendingInstall(GetProfile(1), GetCustomTheme(0)));
247 } 247 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698