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

Side by Side Diff: chrome/test/live_sync/two_client_live_apps_sync_test.cc

Issue 7104072: Adding new extension sync integration tests. Also modified the way that profile (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Review changes Created 9 years, 6 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) 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
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) {
anna 2011/06/09 21:37:58 It would be great to test the merge of a delete as
braffert 2011/06/09 23:09:35 Done.
152 ASSERT_TRUE(SetupSync());
153 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
154
155 InstallApp(GetProfile(0), 0);
156 InstallApp(verifier(), 0);
157
158 InstallApp(GetProfile(0), 1);
159 InstallApp(GetProfile(1), 1);
160 InstallApp(verifier(), 1);
161
162 InstallApp(GetProfile(1), 2);
163 InstallApp(verifier(), 2);
164
165 ASSERT_TRUE(AwaitQuiescence());
166 InstallAppsPendingForSync(GetProfile(0));
167 InstallAppsPendingForSync(GetProfile(1));
168 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
169 }
170
171 IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, UpdateEnableDisableApp) {
braffert 2011/06/09 18:20:42 Couldn't find TCM ids for these two cases.
akalin 2011/06/09 20:35:37 Not sure if they're needed -- ask Anna?
anna 2011/06/09 21:37:58 TCM ID: 7723126
braffert 2011/06/09 23:09:35 Done.
172 ASSERT_TRUE(SetupSync());
173 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
174
175 InstallApp(GetProfile(0), 0);
176 InstallApp(GetProfile(1), 0);
177 InstallApp(verifier(), 0);
178 ASSERT_TRUE(AwaitQuiescence());
179 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
180
181 DisableApp(GetProfile(0), 0);
182 DisableApp(verifier(), 0);
183 ASSERT_TRUE(HasSameAppsAsVerifier(0));
184 ASSERT_FALSE(HasSameAppsAsVerifier(1));
185
186 ASSERT_TRUE(AwaitQuiescence());
187 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
188
189 EnableApp(GetProfile(1), 0);
190 EnableApp(verifier(), 0);
191 ASSERT_TRUE(HasSameAppsAsVerifier(1));
192 ASSERT_FALSE(HasSameAppsAsVerifier(0));
193
194 ASSERT_TRUE(AwaitQuiescence());
195 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
196 }
197
198 IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest,
199 UpdateIncognitoEnableDisable) {
anna 2011/06/09 21:37:58 TCM ID: 7706637
braffert 2011/06/09 23:09:35 Done.
200 ASSERT_TRUE(SetupSync());
201 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
202
203 InstallApp(GetProfile(0), 0);
204 InstallApp(GetProfile(1), 0);
205 InstallApp(verifier(), 0);
206 ASSERT_TRUE(AwaitQuiescence());
207 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
208
209 IncognitoEnableApp(GetProfile(0), 0);
210 IncognitoEnableApp(verifier(), 0);
211 ASSERT_TRUE(HasSameAppsAsVerifier(0));
212 ASSERT_FALSE(HasSameAppsAsVerifier(1));
213
214 ASSERT_TRUE(AwaitQuiescence());
215 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
216
217 IncognitoDisableApp(GetProfile(1), 0);
218 IncognitoDisableApp(verifier(), 0);
219 ASSERT_TRUE(HasSameAppsAsVerifier(1));
220 ASSERT_FALSE(HasSameAppsAsVerifier(0));
221
222 ASSERT_TRUE(AwaitQuiescence());
223 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
224 }
225
150 // TCM ID - 3718276. 226 // TCM ID - 3718276.
151 IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, DisableApps) { 227 IN_PROC_BROWSER_TEST_F(TwoClientLiveAppsSyncTest, DisableApps) {
152 ASSERT_TRUE(SetupSync()); 228 ASSERT_TRUE(SetupSync());
153 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); 229 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
154 230
155 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncable::APPS)); 231 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncable::APPS));
156 InstallApp(GetProfile(0), 0); 232 InstallApp(GetProfile(0), 0);
157 InstallApp(verifier(), 0); 233 InstallApp(verifier(), 0);
158 ASSERT_TRUE(AwaitQuiescence()); 234 ASSERT_TRUE(AwaitQuiescence());
159 ASSERT_TRUE(HasSameAppsAsVerifier(0)); 235 ASSERT_TRUE(HasSameAppsAsVerifier(0));
(...skipping 23 matching lines...) Expand all
183 ASSERT_TRUE(AwaitQuiescence()); 259 ASSERT_TRUE(AwaitQuiescence());
184 260
185 InstallAppsPendingForSync(GetProfile(0)); 261 InstallAppsPendingForSync(GetProfile(0));
186 InstallAppsPendingForSync(GetProfile(1)); 262 InstallAppsPendingForSync(GetProfile(1));
187 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); 263 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
188 } 264 }
189 265
190 // TODO(akalin): Add tests exercising: 266 // TODO(akalin): Add tests exercising:
191 // - Offline installation/uninstallation behavior 267 // - Offline installation/uninstallation behavior
192 // - App-specific properties 268 // - App-specific properties
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698