OLD | NEW |
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/common/extensions/extension_constants.h" |
| 7 #include "chrome/browser/extensions/extension_service.h" |
| 8 #include "chrome/browser/profiles/profile.h" |
6 #include "chrome/browser/sync/profile_sync_service_harness.h" | 9 #include "chrome/browser/sync/profile_sync_service_harness.h" |
7 #include "chrome/browser/sync/test/integration/apps_helper.h" | 10 #include "chrome/browser/sync/test/integration/apps_helper.h" |
8 #include "chrome/browser/sync/test/integration/sync_app_helper.h" | 11 #include "chrome/browser/sync/test/integration/sync_app_helper.h" |
9 #include "chrome/browser/sync/test/integration/sync_test.h" | 12 #include "chrome/browser/sync/test/integration/sync_test.h" |
10 | 13 |
11 using apps_helper::AllProfilesHaveSameAppsAsVerifier; | 14 using apps_helper::AllProfilesHaveSameAppsAsVerifier; |
12 using apps_helper::CopyNTPOrdinals; | 15 using apps_helper::CopyNTPOrdinals; |
13 using apps_helper::DisableApp; | 16 using apps_helper::DisableApp; |
14 using apps_helper::EnableApp; | 17 using apps_helper::EnableApp; |
15 using apps_helper::FixNTPOrdinalCollisions; | 18 using apps_helper::FixNTPOrdinalCollisions; |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 ASSERT_TRUE(AwaitQuiescence()); | 364 ASSERT_TRUE(AwaitQuiescence()); |
362 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); | 365 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
363 | 366 |
364 StringOrdinal second_position = initial_position.CreateAfter(); | 367 StringOrdinal second_position = initial_position.CreateAfter(); |
365 SetAppLaunchOrdinalForApp(GetProfile(0), 0, second_position); | 368 SetAppLaunchOrdinalForApp(GetProfile(0), 0, second_position); |
366 SetAppLaunchOrdinalForApp(verifier(), 0, second_position); | 369 SetAppLaunchOrdinalForApp(verifier(), 0, second_position); |
367 ASSERT_TRUE(AwaitQuiescence()); | 370 ASSERT_TRUE(AwaitQuiescence()); |
368 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); | 371 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
369 } | 372 } |
370 | 373 |
| 374 // Adjust the CWS location within a page on the first client and sync. Adjust |
| 375 // which page the CWS appears on and sync. Both clients should have the same |
| 376 // page and app launch ordinal values for the CWS. |
| 377 IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, UpdateCWSOrdinals) { |
| 378 ASSERT_TRUE(SetupSync()); |
| 379 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 380 |
| 381 // Change the app launch ordinal. |
| 382 StringOrdinal cws_app_launch_ordinal = |
| 383 GetProfile(0)->GetExtensionService()->GetAppLaunchOrdinal( |
| 384 extension_misc::kWebStoreAppId); |
| 385 GetProfile(0)->GetExtensionService()->SetAppLaunchOrdinal( |
| 386 extension_misc::kWebStoreAppId, cws_app_launch_ordinal.CreateAfter()); |
| 387 verifier()->GetExtensionService()->SetAppLaunchOrdinal( |
| 388 extension_misc::kWebStoreAppId, cws_app_launch_ordinal.CreateAfter()); |
| 389 ASSERT_TRUE(AwaitQuiescence()); |
| 390 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 391 |
| 392 // Change the page ordinal. |
| 393 StringOrdinal cws_page_ordinal = |
| 394 GetProfile(1)->GetExtensionService()->GetPageOrdinal( |
| 395 extension_misc::kWebStoreAppId); |
| 396 GetProfile(1)->GetExtensionService()->SetPageOrdinal( |
| 397 extension_misc::kWebStoreAppId, cws_page_ordinal.CreateAfter()); |
| 398 verifier()->GetExtensionService()->SetPageOrdinal( |
| 399 extension_misc::kWebStoreAppId, cws_page_ordinal.CreateAfter()); |
| 400 ASSERT_TRUE(AwaitQuiescence()); |
| 401 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 402 } |
| 403 |
371 // TODO(akalin): Add tests exercising: | 404 // TODO(akalin): Add tests exercising: |
372 // - Offline installation/uninstallation behavior | 405 // - Offline installation/uninstallation behavior |
373 // - App-specific properties | 406 // - App-specific properties |
OLD | NEW |