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

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: Fixed whitespace 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
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..e9744cd4580c012d798678891b7e2d53af765381 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
@@ -21,9 +21,9 @@ class TwoClientLiveThemesSyncTest : public LiveThemesSyncTest {
// SetupSync()).
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomTheme) {
- ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+ ASSERT_TRUE(SetupSync());
- scoped_refptr<Extension> theme = GetTheme(0);
+ scoped_refptr<Extension> theme = MakeTheme();
ASSERT_EQ(NULL, GetCustomTheme(GetProfile(0)));
ASSERT_EQ(NULL, GetCustomTheme(GetProfile(1)));
ASSERT_EQ(NULL, GetCustomTheme(verifier()));
@@ -45,9 +45,9 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomTheme) {
}
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, NativeTheme) {
- ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+ ASSERT_TRUE(SetupSync());
- scoped_refptr<Extension> theme = GetTheme(0);
+ scoped_refptr<Extension> theme = MakeTheme();
SetTheme(GetProfile(0), theme);
SetTheme(GetProfile(1), theme);
SetTheme(verifier(), theme);
@@ -68,9 +68,9 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, NativeTheme) {
}
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, DefaultTheme) {
- ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+ ASSERT_TRUE(SetupSync());
- scoped_refptr<Extension> theme = GetTheme(0);
+ scoped_refptr<Extension> theme = MakeTheme();
SetTheme(GetProfile(0), theme);
SetTheme(GetProfile(1), theme);
SetTheme(verifier(), theme);
@@ -91,7 +91,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, DefaultTheme) {
}
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, NativeDefaultRace) {
- ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+ ASSERT_TRUE(SetupSync());
GetProfile(0)->SetNativeTheme();
GetProfile(1)->ClearTheme();
@@ -110,9 +110,9 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, NativeDefaultRace) {
}
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomNativeRace) {
- ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+ ASSERT_TRUE(SetupSync());
- scoped_refptr<Extension> theme = GetTheme(0);
+ scoped_refptr<Extension> theme = MakeTheme();
SetTheme(GetProfile(0), theme);
GetProfile(1)->SetNativeTheme();
ASSERT_EQ(theme, GetCustomTheme(GetProfile(0)));
@@ -128,9 +128,9 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomNativeRace) {
}
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomDefaultRace) {
- ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+ ASSERT_TRUE(SetupSync());
- scoped_refptr<Extension> theme = GetTheme(0);
+ scoped_refptr<Extension> theme = MakeTheme();
SetTheme(GetProfile(0), theme);
GetProfile(1)->ClearTheme();
ASSERT_EQ(theme, GetCustomTheme(GetProfile(0)));
@@ -143,21 +143,26 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomDefaultRace) {
}
IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomCustomRace) {
- ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+ ASSERT_TRUE(SetupSync());
- SetTheme(GetProfile(0), GetTheme(0));
- SetTheme(GetProfile(1), GetTheme(1));
- ASSERT_EQ(GetTheme(0), GetCustomTheme(GetProfile(0)));
- ASSERT_EQ(GetTheme(1), GetCustomTheme(GetProfile(1)));
+ // TODO(akalin): Generalize this to n clients.
+
+ scoped_refptr<Extension> theme_0 = MakeTheme();
+ scoped_refptr<Extension> theme_1 = MakeTheme();
+
+ SetTheme(GetProfile(0), theme_0);
+ SetTheme(GetProfile(1), theme_1);
+ ASSERT_EQ(theme_0, GetCustomTheme(GetProfile(0)));
+ ASSERT_EQ(theme_1, GetCustomTheme(GetProfile(1)));
ASSERT_TRUE(AwaitQuiescence());
bool using_theme_0 =
- (GetCustomTheme(GetProfile(0)) == GetTheme(0)) &&
- HasOrWillHaveCustomTheme(GetProfile(1), GetTheme(0));
+ (GetCustomTheme(GetProfile(0)) == theme_0) &&
+ HasOrWillHaveCustomTheme(GetProfile(1), theme_0);
bool using_theme_1 =
- HasOrWillHaveCustomTheme(GetProfile(0), GetTheme(1)) &&
- (GetCustomTheme(GetProfile(1)) == GetTheme(1));
+ HasOrWillHaveCustomTheme(GetProfile(0), theme_1) &&
+ (GetCustomTheme(GetProfile(1)) == theme_1);
// Equivalent to using_theme_0 xor using_theme_1.
ASSERT_NE(using_theme_0, using_theme_1);

Powered by Google App Engine
This is Rietveld 408576698