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

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

Issue 65983002: Revert 231221 - "Remove enabled/disabled state from extension and app sync." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 234
233 InstallApp(GetProfile(1), 3); 235 InstallApp(GetProfile(1), 3);
234 InstallApp(verifier(), 3); 236 InstallApp(verifier(), 3);
235 237
236 ASSERT_TRUE(AwaitQuiescence()); 238 ASSERT_TRUE(AwaitQuiescence());
237 InstallAppsPendingForSync(GetProfile(0)); 239 InstallAppsPendingForSync(GetProfile(0));
238 InstallAppsPendingForSync(GetProfile(1)); 240 InstallAppsPendingForSync(GetProfile(1));
239 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); 241 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
240 } 242 }
241 243
244 // TCM ID - 7723126.
245 IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, UpdateEnableDisableApp) {
246 ASSERT_TRUE(SetupSync());
247 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
248
249 InstallApp(GetProfile(0), 0);
250 InstallApp(GetProfile(1), 0);
251 InstallApp(verifier(), 0);
252 ASSERT_TRUE(AwaitQuiescence());
253 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
254
255 DisableApp(GetProfile(0), 0);
256 DisableApp(verifier(), 0);
257 ASSERT_TRUE(HasSameAppsAsVerifier(0));
258 ASSERT_FALSE(HasSameAppsAsVerifier(1));
259
260 ASSERT_TRUE(AwaitQuiescence());
261 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
262
263 EnableApp(GetProfile(1), 0);
264 EnableApp(verifier(), 0);
265 ASSERT_TRUE(HasSameAppsAsVerifier(1));
266 ASSERT_FALSE(HasSameAppsAsVerifier(0));
267
268 ASSERT_TRUE(AwaitQuiescence());
269 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
270 }
271
242 // TCM ID - 7706637. 272 // TCM ID - 7706637.
243 IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, UpdateIncognitoEnableDisable) { 273 IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, UpdateIncognitoEnableDisable) {
244 ASSERT_TRUE(SetupSync()); 274 ASSERT_TRUE(SetupSync());
245 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); 275 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
246 276
247 InstallApp(GetProfile(0), 0); 277 InstallApp(GetProfile(0), 0);
248 InstallApp(GetProfile(1), 0); 278 InstallApp(GetProfile(1), 0);
249 InstallApp(verifier(), 0); 279 InstallApp(verifier(), 0);
250 ASSERT_TRUE(AwaitQuiescence()); 280 ASSERT_TRUE(AwaitQuiescence());
251 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); 281 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 verifier()->GetExtensionService()->extension_prefs()-> 417 verifier()->GetExtensionService()->extension_prefs()->
388 extension_sorting()->SetPageOrdinal(extension_misc::kWebStoreAppId, 418 extension_sorting()->SetPageOrdinal(extension_misc::kWebStoreAppId,
389 cws_page_ordinal.CreateAfter()); 419 cws_page_ordinal.CreateAfter());
390 ASSERT_TRUE(AwaitQuiescence()); 420 ASSERT_TRUE(AwaitQuiescence());
391 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); 421 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
392 } 422 }
393 423
394 // TODO(akalin): Add tests exercising: 424 // TODO(akalin): Add tests exercising:
395 // - Offline installation/uninstallation behavior 425 // - Offline installation/uninstallation behavior
396 // - App-specific properties 426 // - App-specific properties
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698