| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/profile_sync_service_harness.h" | 6 #include "chrome/browser/sync/profile_sync_service_harness.h" |
| 7 #include "chrome/test/live_sync/live_themes_sync_test.h" | 7 #include "chrome/test/live_sync/themes_helper.h" |
| 8 #include "chrome/test/live_sync/live_sync_test.h" |
| 8 | 9 |
| 9 class TwoClientLiveThemesSyncTest : public LiveThemesSyncTest { | 10 using themes_helper::GetCustomTheme; |
| 11 using themes_helper::GetThemeID; |
| 12 using themes_helper::HasOrWillHaveCustomTheme; |
| 13 using themes_helper::ThemeIsPendingInstall; |
| 14 using themes_helper::UseCustomTheme; |
| 15 using themes_helper::UseDefaultTheme; |
| 16 using themes_helper::UseNativeTheme; |
| 17 using themes_helper::UsingCustomTheme; |
| 18 using themes_helper::UsingDefaultTheme; |
| 19 using themes_helper::UsingNativeTheme; |
| 20 |
| 21 class TwoClientThemesSyncTest : public LiveSyncTest { |
| 10 public: | 22 public: |
| 11 TwoClientLiveThemesSyncTest() : LiveThemesSyncTest(TWO_CLIENT) {} | 23 TwoClientThemesSyncTest() : LiveSyncTest(TWO_CLIENT) {} |
| 12 virtual ~TwoClientLiveThemesSyncTest() {} | 24 virtual ~TwoClientThemesSyncTest() {} |
| 13 | 25 |
| 14 private: | 26 private: |
| 15 DISALLOW_COPY_AND_ASSIGN(TwoClientLiveThemesSyncTest); | 27 DISALLOW_COPY_AND_ASSIGN(TwoClientThemesSyncTest); |
| 16 }; | 28 }; |
| 17 | 29 |
| 18 // TODO(akalin): Add tests for model association (i.e., tests that | 30 // TODO(akalin): Add tests for model association (i.e., tests that |
| 19 // start with SetupClients(), change the theme state, then call | 31 // start with SetupClients(), change the theme state, then call |
| 20 // SetupSync()). | 32 // SetupSync()). |
| 21 | 33 |
| 22 // TCM ID - 3667311. | 34 // TCM ID - 3667311. |
| 23 IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomTheme) { | 35 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, CustomTheme) { |
| 24 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 36 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 25 | 37 |
| 26 ASSERT_FALSE(UsingCustomTheme(GetProfile(0))); | 38 ASSERT_FALSE(UsingCustomTheme(GetProfile(0))); |
| 27 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); | 39 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); |
| 28 ASSERT_FALSE(UsingCustomTheme(verifier())); | 40 ASSERT_FALSE(UsingCustomTheme(verifier())); |
| 29 | 41 |
| 30 UseCustomTheme(GetProfile(0), 0); | 42 UseCustomTheme(GetProfile(0), 0); |
| 31 UseCustomTheme(verifier(), 0); | 43 UseCustomTheme(verifier(), 0); |
| 32 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); | 44 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); |
| 33 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); | 45 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); |
| 34 | 46 |
| 35 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 47 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 36 | 48 |
| 37 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); | 49 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); |
| 38 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); | 50 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); |
| 39 // TODO(akalin): Add functions to simulate when a pending extension | 51 // TODO(akalin): Add functions to simulate when a pending extension |
| 40 // is installed as well as when a pending extension fails to | 52 // is installed as well as when a pending extension fails to |
| 41 // install. | 53 // install. |
| 42 ASSERT_TRUE(ThemeIsPendingInstall(GetProfile(1), GetCustomTheme(0))); | 54 ASSERT_TRUE(ThemeIsPendingInstall(GetProfile(1), GetCustomTheme(0))); |
| 43 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); | 55 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); |
| 44 } | 56 } |
| 45 | 57 |
| 46 // TCM ID - 3599303. | 58 // TCM ID - 3599303. |
| 47 // TODO(sync): Fails on Chrome OS. See http://crbug.com/84575. | 59 // TODO(sync): Fails on Chrome OS. See http://crbug.com/84575. |
| 48 #if defined(OS_CHROMEOS) | 60 #if defined(OS_CHROMEOS) |
| 49 IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, FAILS_NativeTheme) { | 61 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, FAILS_NativeTheme) { |
| 50 #else | 62 #else |
| 51 IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, NativeTheme) { | 63 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, NativeTheme) { |
| 52 #endif // OS_CHROMEOS | 64 #endif // OS_CHROMEOS |
| 53 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 65 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 54 | 66 |
| 55 UseCustomTheme(GetProfile(0), 0); | 67 UseCustomTheme(GetProfile(0), 0); |
| 56 UseCustomTheme(GetProfile(1), 0); | 68 UseCustomTheme(GetProfile(1), 0); |
| 57 UseCustomTheme(verifier(), 0); | 69 UseCustomTheme(verifier(), 0); |
| 58 | 70 |
| 59 ASSERT_TRUE(AwaitQuiescence()); | 71 ASSERT_TRUE(AwaitQuiescence()); |
| 60 | 72 |
| 61 UseNativeTheme(GetProfile(0)); | 73 UseNativeTheme(GetProfile(0)); |
| 62 UseNativeTheme(verifier()); | 74 UseNativeTheme(verifier()); |
| 63 ASSERT_TRUE(UsingNativeTheme(GetProfile(0))); | 75 ASSERT_TRUE(UsingNativeTheme(GetProfile(0))); |
| 64 ASSERT_TRUE(UsingNativeTheme(verifier())); | 76 ASSERT_TRUE(UsingNativeTheme(verifier())); |
| 65 | 77 |
| 66 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 78 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 67 | 79 |
| 68 ASSERT_TRUE(UsingNativeTheme(GetProfile(0))); | 80 ASSERT_TRUE(UsingNativeTheme(GetProfile(0))); |
| 69 ASSERT_TRUE(UsingNativeTheme(GetProfile(1))); | 81 ASSERT_TRUE(UsingNativeTheme(GetProfile(1))); |
| 70 ASSERT_TRUE(UsingNativeTheme(verifier())); | 82 ASSERT_TRUE(UsingNativeTheme(verifier())); |
| 71 } | 83 } |
| 72 | 84 |
| 73 // TCM ID - 7247455. | 85 // TCM ID - 7247455. |
| 74 IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, DefaultTheme) { | 86 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, DefaultTheme) { |
| 75 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 87 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 76 | 88 |
| 77 UseCustomTheme(GetProfile(0), 0); | 89 UseCustomTheme(GetProfile(0), 0); |
| 78 UseCustomTheme(GetProfile(1), 0); | 90 UseCustomTheme(GetProfile(1), 0); |
| 79 UseCustomTheme(verifier(), 0); | 91 UseCustomTheme(verifier(), 0); |
| 80 | 92 |
| 81 ASSERT_TRUE(AwaitQuiescence()); | 93 ASSERT_TRUE(AwaitQuiescence()); |
| 82 | 94 |
| 83 UseDefaultTheme(GetProfile(0)); | 95 UseDefaultTheme(GetProfile(0)); |
| 84 UseDefaultTheme(verifier()); | 96 UseDefaultTheme(verifier()); |
| 85 ASSERT_TRUE(UsingDefaultTheme(GetProfile(0))); | 97 ASSERT_TRUE(UsingDefaultTheme(GetProfile(0))); |
| 86 ASSERT_TRUE(UsingDefaultTheme(verifier())); | 98 ASSERT_TRUE(UsingDefaultTheme(verifier())); |
| 87 | 99 |
| 88 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 100 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 89 | 101 |
| 90 ASSERT_TRUE(UsingDefaultTheme(GetProfile(0))); | 102 ASSERT_TRUE(UsingDefaultTheme(GetProfile(0))); |
| 91 ASSERT_TRUE(UsingDefaultTheme(GetProfile(1))); | 103 ASSERT_TRUE(UsingDefaultTheme(GetProfile(1))); |
| 92 ASSERT_TRUE(UsingDefaultTheme(verifier())); | 104 ASSERT_TRUE(UsingDefaultTheme(verifier())); |
| 93 } | 105 } |
| 94 | 106 |
| 95 // TCM ID - 7292065. | 107 // TCM ID - 7292065. |
| 96 // TODO(sync): Fails on Chrome OS. See http://crbug.com/84575. | 108 // TODO(sync): Fails on Chrome OS. See http://crbug.com/84575. |
| 97 #if defined(OS_CHROMEOS) | 109 #if defined(OS_CHROMEOS) |
| 98 IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, FAILS_NativeDefaultRace) { | 110 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, FAILS_NativeDefaultRace) { |
| 99 #else | 111 #else |
| 100 IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, NativeDefaultRace) { | 112 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, NativeDefaultRace) { |
| 101 #endif // OS_CHROMEOS | 113 #endif // OS_CHROMEOS |
| 102 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 114 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 103 | 115 |
| 104 UseNativeTheme(GetProfile(0)); | 116 UseNativeTheme(GetProfile(0)); |
| 105 UseDefaultTheme(GetProfile(1)); | 117 UseDefaultTheme(GetProfile(1)); |
| 106 ASSERT_TRUE(UsingNativeTheme(GetProfile(0))); | 118 ASSERT_TRUE(UsingNativeTheme(GetProfile(0))); |
| 107 ASSERT_TRUE(UsingDefaultTheme(GetProfile(1))); | 119 ASSERT_TRUE(UsingDefaultTheme(GetProfile(1))); |
| 108 | 120 |
| 109 ASSERT_TRUE(AwaitQuiescence()); | 121 ASSERT_TRUE(AwaitQuiescence()); |
| 110 | 122 |
| 111 // TODO(akalin): Add function that compares two profiles to see if | 123 // TODO(akalin): Add function that compares two profiles to see if |
| 112 // they're at the same state. | 124 // they're at the same state. |
| 113 | 125 |
| 114 ASSERT_EQ(UsingNativeTheme(GetProfile(0)), | 126 ASSERT_EQ(UsingNativeTheme(GetProfile(0)), |
| 115 UsingNativeTheme(GetProfile(1))); | 127 UsingNativeTheme(GetProfile(1))); |
| 116 ASSERT_EQ(UsingDefaultTheme(GetProfile(0)), | 128 ASSERT_EQ(UsingDefaultTheme(GetProfile(0)), |
| 117 UsingDefaultTheme(GetProfile(1))); | 129 UsingDefaultTheme(GetProfile(1))); |
| 118 } | 130 } |
| 119 | 131 |
| 120 // TCM ID - 7294077. | 132 // TCM ID - 7294077. |
| 121 // TODO(sync): Fails on Chrome OS. See http://crbug.com/84575. | 133 // TODO(sync): Fails on Chrome OS. See http://crbug.com/84575. |
| 122 #if defined(OS_CHROMEOS) | 134 #if defined(OS_CHROMEOS) |
| 123 IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, FAILS_CustomNativeRace) { | 135 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, FAILS_CustomNativeRace) { |
| 124 #else | 136 #else |
| 125 IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomNativeRace) { | 137 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, CustomNativeRace) { |
| 126 #endif // OS_CHROMEOS | 138 #endif // OS_CHROMEOS |
| 127 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 139 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 128 | 140 |
| 129 UseCustomTheme(GetProfile(0), 0); | 141 UseCustomTheme(GetProfile(0), 0); |
| 130 UseNativeTheme(GetProfile(1)); | 142 UseNativeTheme(GetProfile(1)); |
| 131 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); | 143 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); |
| 132 ASSERT_TRUE(UsingNativeTheme(GetProfile(1))); | 144 ASSERT_TRUE(UsingNativeTheme(GetProfile(1))); |
| 133 | 145 |
| 134 ASSERT_TRUE(AwaitQuiescence()); | 146 ASSERT_TRUE(AwaitQuiescence()); |
| 135 | 147 |
| 136 // TODO(akalin): Add function to wait for pending extensions to be | 148 // TODO(akalin): Add function to wait for pending extensions to be |
| 137 // installed. | 149 // installed. |
| 138 | 150 |
| 139 ASSERT_EQ(HasOrWillHaveCustomTheme(GetProfile(0), GetCustomTheme(0)), | 151 ASSERT_EQ(HasOrWillHaveCustomTheme(GetProfile(0), GetCustomTheme(0)), |
| 140 HasOrWillHaveCustomTheme(GetProfile(1), GetCustomTheme(0))); | 152 HasOrWillHaveCustomTheme(GetProfile(1), GetCustomTheme(0))); |
| 141 } | 153 } |
| 142 | 154 |
| 143 // TCM ID - 7307225. | 155 // TCM ID - 7307225. |
| 144 IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomDefaultRace) { | 156 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, CustomDefaultRace) { |
| 145 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 157 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 146 | 158 |
| 147 UseCustomTheme(GetProfile(0), 0); | 159 UseCustomTheme(GetProfile(0), 0); |
| 148 UseDefaultTheme(GetProfile(1)); | 160 UseDefaultTheme(GetProfile(1)); |
| 149 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); | 161 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); |
| 150 ASSERT_TRUE(UsingDefaultTheme(GetProfile(1))); | 162 ASSERT_TRUE(UsingDefaultTheme(GetProfile(1))); |
| 151 | 163 |
| 152 ASSERT_TRUE(AwaitQuiescence()); | 164 ASSERT_TRUE(AwaitQuiescence()); |
| 153 | 165 |
| 154 ASSERT_EQ(HasOrWillHaveCustomTheme(GetProfile(0), GetCustomTheme(0)), | 166 ASSERT_EQ(HasOrWillHaveCustomTheme(GetProfile(0), GetCustomTheme(0)), |
| 155 HasOrWillHaveCustomTheme(GetProfile(1), GetCustomTheme(0))); | 167 HasOrWillHaveCustomTheme(GetProfile(1), GetCustomTheme(0))); |
| 156 } | 168 } |
| 157 | 169 |
| 158 // TCM ID - 7264758. | 170 // TCM ID - 7264758. |
| 159 IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, CustomCustomRace) { | 171 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, CustomCustomRace) { |
| 160 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 172 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 161 | 173 |
| 162 // TODO(akalin): Generalize this to n clients. | 174 // TODO(akalin): Generalize this to n clients. |
| 163 | 175 |
| 164 UseCustomTheme(GetProfile(0), 0); | 176 UseCustomTheme(GetProfile(0), 0); |
| 165 UseCustomTheme(GetProfile(1), 1); | 177 UseCustomTheme(GetProfile(1), 1); |
| 166 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); | 178 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); |
| 167 ASSERT_EQ(GetCustomTheme(1), GetThemeID(GetProfile(1))); | 179 ASSERT_EQ(GetCustomTheme(1), GetThemeID(GetProfile(1))); |
| 168 | 180 |
| 169 ASSERT_TRUE(AwaitQuiescence()); | 181 ASSERT_TRUE(AwaitQuiescence()); |
| 170 | 182 |
| 171 bool using_theme_0 = | 183 bool using_theme_0 = |
| 172 (GetThemeID(GetProfile(0)) == GetCustomTheme(0)) && | 184 (GetThemeID(GetProfile(0)) == GetCustomTheme(0)) && |
| 173 HasOrWillHaveCustomTheme(GetProfile(1), GetCustomTheme(0)); | 185 HasOrWillHaveCustomTheme(GetProfile(1), GetCustomTheme(0)); |
| 174 bool using_theme_1 = | 186 bool using_theme_1 = |
| 175 HasOrWillHaveCustomTheme(GetProfile(0), GetCustomTheme(1)) && | 187 HasOrWillHaveCustomTheme(GetProfile(0), GetCustomTheme(1)) && |
| 176 (GetThemeID(GetProfile(1)) == GetCustomTheme(1)); | 188 (GetThemeID(GetProfile(1)) == GetCustomTheme(1)); |
| 177 | 189 |
| 178 // Equivalent to using_theme_0 xor using_theme_1. | 190 // Equivalent to using_theme_0 xor using_theme_1. |
| 179 ASSERT_NE(using_theme_0, using_theme_1); | 191 ASSERT_NE(using_theme_0, using_theme_1); |
| 180 } | 192 } |
| 181 | 193 |
| 182 // TCM ID - 3723272. | 194 // TCM ID - 3723272. |
| 183 IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, DisableThemes) { | 195 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, DisableThemes) { |
| 184 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 196 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 185 | 197 |
| 186 ASSERT_FALSE(UsingCustomTheme(GetProfile(0))); | 198 ASSERT_FALSE(UsingCustomTheme(GetProfile(0))); |
| 187 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); | 199 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); |
| 188 ASSERT_FALSE(UsingCustomTheme(verifier())); | 200 ASSERT_FALSE(UsingCustomTheme(verifier())); |
| 189 | 201 |
| 190 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncable::THEMES)); | 202 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncable::THEMES)); |
| 191 UseCustomTheme(GetProfile(0), 0); | 203 UseCustomTheme(GetProfile(0), 0); |
| 192 UseCustomTheme(verifier(), 0); | 204 UseCustomTheme(verifier(), 0); |
| 193 ASSERT_TRUE(AwaitQuiescence()); | 205 ASSERT_TRUE(AwaitQuiescence()); |
| 194 | 206 |
| 195 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); | 207 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); |
| 196 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); | 208 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); |
| 197 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); | 209 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); |
| 198 | 210 |
| 199 ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncable::THEMES)); | 211 ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncable::THEMES)); |
| 200 ASSERT_TRUE(AwaitQuiescence()); | 212 ASSERT_TRUE(AwaitQuiescence()); |
| 201 | 213 |
| 202 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); | 214 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); |
| 203 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); | 215 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); |
| 204 ASSERT_TRUE(ThemeIsPendingInstall(GetProfile(1), GetCustomTheme(0))); | 216 ASSERT_TRUE(ThemeIsPendingInstall(GetProfile(1), GetCustomTheme(0))); |
| 205 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); | 217 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); |
| 206 } | 218 } |
| 207 | 219 |
| 208 // TCM ID - 3687288. | 220 // TCM ID - 3687288. |
| 209 IN_PROC_BROWSER_TEST_F(TwoClientLiveThemesSyncTest, DisableSync) { | 221 IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, DisableSync) { |
| 210 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 222 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 211 | 223 |
| 212 ASSERT_FALSE(UsingCustomTheme(GetProfile(0))); | 224 ASSERT_FALSE(UsingCustomTheme(GetProfile(0))); |
| 213 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); | 225 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); |
| 214 ASSERT_FALSE(UsingCustomTheme(verifier())); | 226 ASSERT_FALSE(UsingCustomTheme(verifier())); |
| 215 | 227 |
| 216 ASSERT_TRUE(GetClient(1)->DisableSyncForAllDatatypes()); | 228 ASSERT_TRUE(GetClient(1)->DisableSyncForAllDatatypes()); |
| 217 UseCustomTheme(GetProfile(0), 0); | 229 UseCustomTheme(GetProfile(0), 0); |
| 218 UseCustomTheme(verifier(), 0); | 230 UseCustomTheme(verifier(), 0); |
| 219 ASSERT_TRUE( | 231 ASSERT_TRUE( |
| 220 GetClient(0)->AwaitSyncCycleCompletion("Installed a custom theme.")); | 232 GetClient(0)->AwaitSyncCycleCompletion("Installed a custom theme.")); |
| 221 | 233 |
| 222 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); | 234 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); |
| 223 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); | 235 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); |
| 224 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); | 236 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); |
| 225 | 237 |
| 226 ASSERT_TRUE(GetClient(1)->EnableSyncForAllDatatypes()); | 238 ASSERT_TRUE(GetClient(1)->EnableSyncForAllDatatypes()); |
| 227 ASSERT_TRUE(AwaitQuiescence()); | 239 ASSERT_TRUE(AwaitQuiescence()); |
| 228 | 240 |
| 229 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); | 241 ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); |
| 230 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); | 242 ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); |
| 231 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); | 243 ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); |
| 232 ASSERT_TRUE(ThemeIsPendingInstall(GetProfile(1), GetCustomTheme(0))); | 244 ASSERT_TRUE(ThemeIsPendingInstall(GetProfile(1), GetCustomTheme(0))); |
| 233 } | 245 } |
| OLD | NEW |