Chromium Code Reviews| 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/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" |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 362 } | 362 } |
| 363 | 363 |
| 364 // Install the same app on both clients, then sync. Change the app launch | 364 // Install the same app on both clients, then sync. Change the app launch |
| 365 // ordinal on one client and sync. Both clients should have the updated app | 365 // ordinal on one client and sync. Both clients should have the updated app |
| 366 // launch ordinal for the app. | 366 // launch ordinal for the app. |
| 367 IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, UpdateAppLaunchOrdinal) { | 367 IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, UpdateAppLaunchOrdinal) { |
| 368 ASSERT_TRUE(SetupSync()); | 368 ASSERT_TRUE(SetupSync()); |
| 369 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); | 369 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 370 | 370 |
| 371 syncer::StringOrdinal initial_position = | 371 syncer::StringOrdinal initial_position = |
| 372 syncer::StringOrdinal::CreateInitialOrdinal(); | 372 GetProfile(0)->GetExtensionService()->extension_prefs() |
|
akalin
2012/11/22 09:34:33
i think a more robust solution would be to get the
| |
| 373 ->extension_sorting()->CreateFirstAppLaunchOrdinal( | |
| 374 syncer::StringOrdinal::CreateInitialOrdinal()); | |
| 375 | |
| 373 InstallApp(GetProfile(0), 0); | 376 InstallApp(GetProfile(0), 0); |
| 374 InstallApp(GetProfile(1), 0); | 377 InstallApp(GetProfile(1), 0); |
| 375 InstallApp(verifier(), 0); | 378 InstallApp(verifier(), 0); |
| 376 ASSERT_TRUE(AwaitQuiescence()); | 379 ASSERT_TRUE(AwaitQuiescence()); |
| 377 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); | 380 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 378 | 381 |
| 379 syncer::StringOrdinal second_position = initial_position.CreateAfter(); | 382 syncer::StringOrdinal second_position = initial_position.CreateAfter(); |
| 380 SetAppLaunchOrdinalForApp(GetProfile(0), 0, second_position); | 383 SetAppLaunchOrdinalForApp(GetProfile(0), 0, second_position); |
| 381 SetAppLaunchOrdinalForApp(verifier(), 0, second_position); | 384 SetAppLaunchOrdinalForApp(verifier(), 0, second_position); |
| 382 ASSERT_TRUE(AwaitQuiescence()); | 385 ASSERT_TRUE(AwaitQuiescence()); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 415 verifier()->GetExtensionService()->extension_prefs()-> | 418 verifier()->GetExtensionService()->extension_prefs()-> |
| 416 extension_sorting()->SetPageOrdinal(extension_misc::kWebStoreAppId, | 419 extension_sorting()->SetPageOrdinal(extension_misc::kWebStoreAppId, |
| 417 cws_page_ordinal.CreateAfter()); | 420 cws_page_ordinal.CreateAfter()); |
| 418 ASSERT_TRUE(AwaitQuiescence()); | 421 ASSERT_TRUE(AwaitQuiescence()); |
| 419 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); | 422 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 420 } | 423 } |
| 421 | 424 |
| 422 // TODO(akalin): Add tests exercising: | 425 // TODO(akalin): Add tests exercising: |
| 423 // - Offline installation/uninstallation behavior | 426 // - Offline installation/uninstallation behavior |
| 424 // - App-specific properties | 427 // - App-specific properties |
| OLD | NEW |