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

Unified Diff: chrome/test/live_sync/two_client_live_themes_sync_test.cc

Issue 4732005: [Sync] Added some basic extension sync integration tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed rsimha's comments Created 10 years, 1 month 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/test/live_sync/two_client_live_extensions_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/test/live_sync/two_client_live_themes_sync_test.cc
diff --git a/chrome/test/live_sync/two_client_live_themes_sync_test.cc b/chrome/test/live_sync/two_client_live_themes_sync_test.cc
index c9db7b92535e3dc315d7cefe654d95ec6bcf0716..40ac41216908d21eb23a91cd8277a661d3d2a820 100644
--- a/chrome/test/live_sync/two_client_live_themes_sync_test.cc
+++ b/chrome/test/live_sync/two_client_live_themes_sync_test.cc
@@ -23,36 +23,34 @@ class TwoClientLiveThemesSyncTest : public LiveThemesSyncTest {
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomTheme) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
- scoped_refptr<Extension> theme = GetTheme(0);
ASSERT_EQ(NULL, GetCustomTheme(GetProfile(0)));
ASSERT_EQ(NULL, GetCustomTheme(GetProfile(1)));
ASSERT_EQ(NULL, GetCustomTheme(verifier()));
- SetTheme(GetProfile(0), theme);
- SetTheme(verifier(), theme);
- ASSERT_EQ(theme, GetCustomTheme(GetProfile(0)));
+ SetTheme(GetProfile(0), GetTheme(0));
+ SetTheme(verifier(), GetTheme(0));
+ ASSERT_EQ(GetTheme(0), GetCustomTheme(GetProfile(0)));
ASSERT_EQ(NULL, GetCustomTheme(GetProfile(1)));
- ASSERT_EQ(theme, GetCustomTheme(verifier()));
+ ASSERT_EQ(GetTheme(0), GetCustomTheme(verifier()));
ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
- ASSERT_EQ(theme, GetCustomTheme(GetProfile(0)));
+ ASSERT_EQ(GetTheme(0), GetCustomTheme(GetProfile(0)));
// TODO(akalin): Add functions to simulate when a pending extension
// is installed as well as when a pending extension fails to
// install.
- ASSERT_TRUE(ExtensionIsPendingInstall(GetProfile(1), theme));
- ASSERT_EQ(theme, GetCustomTheme(verifier()));
+ ASSERT_TRUE(ExtensionIsPendingInstall(GetProfile(1), GetTheme(0)));
+ ASSERT_EQ(GetTheme(0), GetCustomTheme(verifier()));
}
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, NativeTheme) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
- scoped_refptr<Extension> theme = GetTheme(0);
- SetTheme(GetProfile(0), theme);
- SetTheme(GetProfile(1), theme);
- SetTheme(verifier(), theme);
+ SetTheme(GetProfile(0), GetTheme(0));
+ SetTheme(GetProfile(1), GetTheme(0));
+ SetTheme(verifier(), GetTheme(0));
- ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
+ ASSERT_TRUE(AwaitQuiescence());
GetProfile(0)->SetNativeTheme();
verifier()->SetNativeTheme();
@@ -70,12 +68,11 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, NativeTheme) {
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, DefaultTheme) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
- scoped_refptr<Extension> theme = GetTheme(0);
- SetTheme(GetProfile(0), theme);
- SetTheme(GetProfile(1), theme);
- SetTheme(verifier(), theme);
+ SetTheme(GetProfile(0), GetTheme(0));
+ SetTheme(GetProfile(1), GetTheme(0));
+ SetTheme(verifier(), GetTheme(0));
- ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
+ ASSERT_TRUE(AwaitQuiescence());
GetProfile(0)->ClearTheme();
verifier()->ClearTheme();
@@ -112,10 +109,9 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, NativeDefaultRace) {
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomNativeRace) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
- scoped_refptr<Extension> theme = GetTheme(0);
- SetTheme(GetProfile(0), theme);
+ SetTheme(GetProfile(0), GetTheme(0));
GetProfile(1)->SetNativeTheme();
- ASSERT_EQ(theme, GetCustomTheme(GetProfile(0)));
+ ASSERT_EQ(GetTheme(0), GetCustomTheme(GetProfile(0)));
ASSERT_TRUE(UsingNativeTheme(GetProfile(1)));
ASSERT_TRUE(AwaitQuiescence());
@@ -123,28 +119,29 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomNativeRace) {
// TODO(akalin): Add function to wait for pending extensions to be
// installed.
- ASSERT_EQ(HasOrWillHaveCustomTheme(GetProfile(0), theme),
- HasOrWillHaveCustomTheme(GetProfile(1), theme));
+ ASSERT_EQ(HasOrWillHaveCustomTheme(GetProfile(0), GetTheme(0)),
+ HasOrWillHaveCustomTheme(GetProfile(1), GetTheme(0)));
}
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomDefaultRace) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
- scoped_refptr<Extension> theme = GetTheme(0);
- SetTheme(GetProfile(0), theme);
+ SetTheme(GetProfile(0), GetTheme(0));
GetProfile(1)->ClearTheme();
- ASSERT_EQ(theme, GetCustomTheme(GetProfile(0)));
+ ASSERT_EQ(GetTheme(0), GetCustomTheme(GetProfile(0)));
ASSERT_TRUE(UsingDefaultTheme(GetProfile(1)));
ASSERT_TRUE(AwaitQuiescence());
- ASSERT_EQ(HasOrWillHaveCustomTheme(GetProfile(0), theme),
- HasOrWillHaveCustomTheme(GetProfile(1), theme));
+ ASSERT_EQ(HasOrWillHaveCustomTheme(GetProfile(0), GetTheme(0)),
+ HasOrWillHaveCustomTheme(GetProfile(1), GetTheme(0)));
}
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomCustomRace) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+ // TODO(akalin): Generalize this to n clients.
+
SetTheme(GetProfile(0), GetTheme(0));
SetTheme(GetProfile(1), GetTheme(1));
ASSERT_EQ(GetTheme(0), GetCustomTheme(GetProfile(0)));
« no previous file with comments | « chrome/test/live_sync/two_client_live_extensions_sync_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698