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_apps_sync_test.h" | 7 #include "chrome/test/live_sync/live_apps_sync_test.h" |
8 | 8 |
9 class TwoClientLiveAppsSyncTest : public LiveAppsSyncTest { | 9 class TwoClientLiveAppsSyncTest : public LiveAppsSyncTest { |
10 public: | 10 public: |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 InstallAppsPendingForSync(GetProfile(0)); | 140 InstallAppsPendingForSync(GetProfile(0)); |
141 InstallAppsPendingForSync(GetProfile(1)); | 141 InstallAppsPendingForSync(GetProfile(1)); |
142 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); | 142 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
143 | 143 |
144 UninstallApp(GetProfile(0), 0); | 144 UninstallApp(GetProfile(0), 0); |
145 UninstallApp(verifier(), 0); | 145 UninstallApp(verifier(), 0); |
146 ASSERT_TRUE(AwaitQuiescence()); | 146 ASSERT_TRUE(AwaitQuiescence()); |
147 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); | 147 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
148 } | 148 } |
149 | 149 |
| 150 // TCM ID - 3699295. |
| 151 IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, Merge) { |
| 152 ASSERT_TRUE(SetupSync()); |
| 153 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 154 |
| 155 InstallApp(GetProfile(0), 0); |
| 156 InstallApp(GetProfile(1), 0); |
| 157 ASSERT_TRUE(AwaitQuiescence()); |
| 158 |
| 159 UninstallApp(GetProfile(0), 0); |
| 160 InstallApp(GetProfile(0), 1); |
| 161 InstallApp(verifier(), 1); |
| 162 |
| 163 InstallApp(GetProfile(0), 2); |
| 164 InstallApp(GetProfile(1), 2); |
| 165 InstallApp(verifier(), 2); |
| 166 |
| 167 InstallApp(GetProfile(1), 3); |
| 168 InstallApp(verifier(), 3); |
| 169 |
| 170 ASSERT_TRUE(AwaitQuiescence()); |
| 171 InstallAppsPendingForSync(GetProfile(0)); |
| 172 InstallAppsPendingForSync(GetProfile(1)); |
| 173 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 174 } |
| 175 |
| 176 // TCM ID - 7723126. |
| 177 IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, UpdateEnableDisableApp) { |
| 178 ASSERT_TRUE(SetupSync()); |
| 179 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 180 |
| 181 InstallApp(GetProfile(0), 0); |
| 182 InstallApp(GetProfile(1), 0); |
| 183 InstallApp(verifier(), 0); |
| 184 ASSERT_TRUE(AwaitQuiescence()); |
| 185 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 186 |
| 187 DisableApp(GetProfile(0), 0); |
| 188 DisableApp(verifier(), 0); |
| 189 ASSERT_TRUE(HasSameAppsAsVerifier(0)); |
| 190 ASSERT_FALSE(HasSameAppsAsVerifier(1)); |
| 191 |
| 192 ASSERT_TRUE(AwaitQuiescence()); |
| 193 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 194 |
| 195 EnableApp(GetProfile(1), 0); |
| 196 EnableApp(verifier(), 0); |
| 197 ASSERT_TRUE(HasSameAppsAsVerifier(1)); |
| 198 ASSERT_FALSE(HasSameAppsAsVerifier(0)); |
| 199 |
| 200 ASSERT_TRUE(AwaitQuiescence()); |
| 201 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 202 } |
| 203 |
| 204 // TCM ID - 7706637. |
| 205 IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, |
| 206 UpdateIncognitoEnableDisable) { |
| 207 ASSERT_TRUE(SetupSync()); |
| 208 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 209 |
| 210 InstallApp(GetProfile(0), 0); |
| 211 InstallApp(GetProfile(1), 0); |
| 212 InstallApp(verifier(), 0); |
| 213 ASSERT_TRUE(AwaitQuiescence()); |
| 214 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 215 |
| 216 IncognitoEnableApp(GetProfile(0), 0); |
| 217 IncognitoEnableApp(verifier(), 0); |
| 218 ASSERT_TRUE(HasSameAppsAsVerifier(0)); |
| 219 ASSERT_FALSE(HasSameAppsAsVerifier(1)); |
| 220 |
| 221 ASSERT_TRUE(AwaitQuiescence()); |
| 222 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 223 |
| 224 IncognitoDisableApp(GetProfile(1), 0); |
| 225 IncognitoDisableApp(verifier(), 0); |
| 226 ASSERT_TRUE(HasSameAppsAsVerifier(1)); |
| 227 ASSERT_FALSE(HasSameAppsAsVerifier(0)); |
| 228 |
| 229 ASSERT_TRUE(AwaitQuiescence()); |
| 230 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 231 } |
| 232 |
150 // TCM ID - 3718276. | 233 // TCM ID - 3718276. |
151 IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, DisableApps) { | 234 IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, DisableApps) { |
152 ASSERT_TRUE(SetupSync()); | 235 ASSERT_TRUE(SetupSync()); |
153 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); | 236 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
154 | 237 |
155 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncable::APPS)); | 238 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncable::APPS)); |
156 InstallApp(GetProfile(0), 0); | 239 InstallApp(GetProfile(0), 0); |
157 InstallApp(verifier(), 0); | 240 InstallApp(verifier(), 0); |
158 ASSERT_TRUE(AwaitQuiescence()); | 241 ASSERT_TRUE(AwaitQuiescence()); |
159 ASSERT_TRUE(HasSameAppsAsVerifier(0)); | 242 ASSERT_TRUE(HasSameAppsAsVerifier(0)); |
(...skipping 23 matching lines...) Expand all Loading... |
183 ASSERT_TRUE(AwaitQuiescence()); | 266 ASSERT_TRUE(AwaitQuiescence()); |
184 | 267 |
185 InstallAppsPendingForSync(GetProfile(0)); | 268 InstallAppsPendingForSync(GetProfile(0)); |
186 InstallAppsPendingForSync(GetProfile(1)); | 269 InstallAppsPendingForSync(GetProfile(1)); |
187 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); | 270 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
188 } | 271 } |
189 | 272 |
190 // TODO(akalin): Add tests exercising: | 273 // TODO(akalin): Add tests exercising: |
191 // - Offline installation/uninstallation behavior | 274 // - Offline installation/uninstallation behavior |
192 // - App-specific properties | 275 // - App-specific properties |
OLD | NEW |