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

Side by Side Diff: chrome/browser/sync/test/integration/two_client_apps_sync_test.cc

Issue 69683002: Merge 233885 "Revert 231221 - "Remove enabled/disabled state fro..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1700/src/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extensions/extension_service.h" 6 #include "chrome/browser/extensions/extension_service.h"
7 #include "chrome/browser/extensions/extension_sorting.h" 7 #include "chrome/browser/extensions/extension_sorting.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/sync/profile_sync_service_harness.h" 9 #include "chrome/browser/sync/profile_sync_service_harness.h"
10 #include "chrome/browser/sync/test/integration/apps_helper.h" 10 #include "chrome/browser/sync/test/integration/apps_helper.h"
11 #include "chrome/browser/sync/test/integration/sync_app_helper.h" 11 #include "chrome/browser/sync/test/integration/sync_app_helper.h"
12 #include "chrome/browser/sync/test/integration/sync_test.h" 12 #include "chrome/browser/sync/test/integration/sync_test.h"
13 #include "chrome/common/extensions/extension_constants.h" 13 #include "chrome/common/extensions/extension_constants.h"
14 #include "sync/api/string_ordinal.h" 14 #include "sync/api/string_ordinal.h"
15 15
16 using apps_helper::AllProfilesHaveSameAppsAsVerifier; 16 using apps_helper::AllProfilesHaveSameAppsAsVerifier;
17 using apps_helper::CopyNTPOrdinals; 17 using apps_helper::CopyNTPOrdinals;
18 using apps_helper::DisableApp;
19 using apps_helper::EnableApp;
18 using apps_helper::FixNTPOrdinalCollisions; 20 using apps_helper::FixNTPOrdinalCollisions;
19 using apps_helper::GetAppLaunchOrdinalForApp; 21 using apps_helper::GetAppLaunchOrdinalForApp;
20 using apps_helper::HasSameAppsAsVerifier; 22 using apps_helper::HasSameAppsAsVerifier;
21 using apps_helper::IncognitoDisableApp; 23 using apps_helper::IncognitoDisableApp;
22 using apps_helper::IncognitoEnableApp; 24 using apps_helper::IncognitoEnableApp;
23 using apps_helper::InstallApp; 25 using apps_helper::InstallApp;
24 using apps_helper::InstallAppsPendingForSync; 26 using apps_helper::InstallAppsPendingForSync;
25 using apps_helper::InstallPlatformApp; 27 using apps_helper::InstallPlatformApp;
26 using apps_helper::SetAppLaunchOrdinalForApp; 28 using apps_helper::SetAppLaunchOrdinalForApp;
27 using apps_helper::SetPageOrdinalForApp; 29 using apps_helper::SetPageOrdinalForApp;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 235
234 InstallApp(GetProfile(1), 3); 236 InstallApp(GetProfile(1), 3);
235 InstallApp(verifier(), 3); 237 InstallApp(verifier(), 3);
236 238
237 ASSERT_TRUE(AwaitQuiescence()); 239 ASSERT_TRUE(AwaitQuiescence());
238 InstallAppsPendingForSync(GetProfile(0)); 240 InstallAppsPendingForSync(GetProfile(0));
239 InstallAppsPendingForSync(GetProfile(1)); 241 InstallAppsPendingForSync(GetProfile(1));
240 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); 242 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
241 } 243 }
242 244
245 // TCM ID - 7723126.
246 IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, UpdateEnableDisableApp) {
247 ASSERT_TRUE(SetupSync());
248 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
249
250 InstallApp(GetProfile(0), 0);
251 InstallApp(GetProfile(1), 0);
252 InstallApp(verifier(), 0);
253 ASSERT_TRUE(AwaitQuiescence());
254 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
255
256 DisableApp(GetProfile(0), 0);
257 DisableApp(verifier(), 0);
258 ASSERT_TRUE(HasSameAppsAsVerifier(0));
259 ASSERT_FALSE(HasSameAppsAsVerifier(1));
260
261 ASSERT_TRUE(AwaitQuiescence());
262 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
263
264 EnableApp(GetProfile(1), 0);
265 EnableApp(verifier(), 0);
266 ASSERT_TRUE(HasSameAppsAsVerifier(1));
267 ASSERT_FALSE(HasSameAppsAsVerifier(0));
268
269 ASSERT_TRUE(AwaitQuiescence());
270 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
271 }
272
243 // TCM ID - 7706637. 273 // TCM ID - 7706637.
244 IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, UpdateIncognitoEnableDisable) { 274 IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, UpdateIncognitoEnableDisable) {
245 ASSERT_TRUE(SetupSync()); 275 ASSERT_TRUE(SetupSync());
246 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); 276 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
247 277
248 InstallApp(GetProfile(0), 0); 278 InstallApp(GetProfile(0), 0);
249 InstallApp(GetProfile(1), 0); 279 InstallApp(GetProfile(1), 0);
250 InstallApp(verifier(), 0); 280 InstallApp(verifier(), 0);
251 ASSERT_TRUE(AwaitQuiescence()); 281 ASSERT_TRUE(AwaitQuiescence());
252 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); 282 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 verifier()->GetExtensionService()->extension_prefs()-> 418 verifier()->GetExtensionService()->extension_prefs()->
389 extension_sorting()->SetPageOrdinal(extension_misc::kWebStoreAppId, 419 extension_sorting()->SetPageOrdinal(extension_misc::kWebStoreAppId,
390 cws_page_ordinal.CreateAfter()); 420 cws_page_ordinal.CreateAfter());
391 ASSERT_TRUE(AwaitQuiescence()); 421 ASSERT_TRUE(AwaitQuiescence());
392 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); 422 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
393 } 423 }
394 424
395 // TODO(akalin): Add tests exercising: 425 // TODO(akalin): Add tests exercising:
396 // - Offline installation/uninstallation behavior 426 // - Offline installation/uninstallation behavior
397 // - App-specific properties 427 // - App-specific properties
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698