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/browser/extensions/extension_service.h" | 6 #include "chrome/browser/extensions/extension_service.h" |
| 7 #include "chrome/browser/extensions/launch_util.h" |
7 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/sync/test/integration/apps_helper.h" | 9 #include "chrome/browser/sync/test/integration/apps_helper.h" |
9 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" | 10 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" |
10 #include "chrome/browser/sync/test/integration/sync_app_helper.h" | 11 #include "chrome/browser/sync/test/integration/sync_app_helper.h" |
11 #include "chrome/browser/sync/test/integration/sync_test.h" | 12 #include "chrome/browser/sync/test/integration/sync_test.h" |
12 #include "chrome/common/extensions/extension_constants.h" | 13 #include "chrome/common/extensions/extension_constants.h" |
13 #include "extensions/browser/app_sorting.h" | 14 #include "extensions/browser/app_sorting.h" |
14 #include "sync/api/string_ordinal.h" | 15 #include "sync/api/string_ordinal.h" |
15 | 16 |
16 using apps_helper::AllProfilesHaveSameAppsAsVerifier; | 17 using apps_helper::AllProfilesHaveSameAppsAsVerifier; |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 GetProfile(1)->GetExtensionService()->extension_prefs()-> | 416 GetProfile(1)->GetExtensionService()->extension_prefs()-> |
416 app_sorting()->SetPageOrdinal(extension_misc::kWebStoreAppId, | 417 app_sorting()->SetPageOrdinal(extension_misc::kWebStoreAppId, |
417 cws_page_ordinal.CreateAfter()); | 418 cws_page_ordinal.CreateAfter()); |
418 verifier()->GetExtensionService()->extension_prefs()-> | 419 verifier()->GetExtensionService()->extension_prefs()-> |
419 app_sorting()->SetPageOrdinal(extension_misc::kWebStoreAppId, | 420 app_sorting()->SetPageOrdinal(extension_misc::kWebStoreAppId, |
420 cws_page_ordinal.CreateAfter()); | 421 cws_page_ordinal.CreateAfter()); |
421 ASSERT_TRUE(AwaitQuiescence()); | 422 ASSERT_TRUE(AwaitQuiescence()); |
422 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); | 423 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
423 } | 424 } |
424 | 425 |
| 426 // Adjust the launch type on the first client and sync. Both clients should |
| 427 // have the same launch type values for the CWS. |
| 428 IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, UpdateLaunchType) { |
| 429 ASSERT_TRUE(SetupSync()); |
| 430 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 431 |
| 432 // Change the launch type to window. |
| 433 extensions::SetLaunchType(GetProfile(1)->GetExtensionService(), |
| 434 extension_misc::kWebStoreAppId, |
| 435 extensions::LAUNCH_TYPE_WINDOW); |
| 436 extensions::SetLaunchType(verifier()->GetExtensionService(), |
| 437 extension_misc::kWebStoreAppId, |
| 438 extensions::LAUNCH_TYPE_WINDOW); |
| 439 ASSERT_TRUE(AwaitQuiescence()); |
| 440 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 441 |
| 442 // Change the launch type to regular tab. |
| 443 extensions::SetLaunchType(GetProfile(1)->GetExtensionService(), |
| 444 extension_misc::kWebStoreAppId, |
| 445 extensions::LAUNCH_TYPE_REGULAR); |
| 446 extensions::SetLaunchType(verifier()->GetExtensionService(), |
| 447 extension_misc::kWebStoreAppId, |
| 448 extensions::LAUNCH_TYPE_REGULAR); |
| 449 ASSERT_TRUE(AwaitQuiescence()); |
| 450 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 451 } |
| 452 |
425 // TODO(akalin): Add tests exercising: | 453 // TODO(akalin): Add tests exercising: |
426 // - Offline installation/uninstallation behavior | 454 // - Offline installation/uninstallation behavior |
427 // - App-specific properties | 455 // - App-specific properties |
OLD | NEW |