| 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/extensions/launch_util.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/sync/test/integration/apps_helper.h" | 9 #include "chrome/browser/sync/test/integration/apps_helper.h" |
| 10 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" | 10 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 } | 300 } |
| 301 | 301 |
| 302 // TCM ID - 3718276. | 302 // TCM ID - 3718276. |
| 303 IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, DisableApps) { | 303 IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, DisableApps) { |
| 304 ASSERT_TRUE(SetupSync()); | 304 ASSERT_TRUE(SetupSync()); |
| 305 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); | 305 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 306 | 306 |
| 307 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncer::APPS)); | 307 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncer::APPS)); |
| 308 InstallApp(GetProfile(0), 0); | 308 InstallApp(GetProfile(0), 0); |
| 309 InstallApp(verifier(), 0); | 309 InstallApp(verifier(), 0); |
| 310 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion()); | 310 ASSERT_TRUE(GetClient(0)->AwaitCommitActivityCompletion()); |
| 311 ASSERT_TRUE(HasSameAppsAsVerifier(0)); | 311 ASSERT_TRUE(HasSameAppsAsVerifier(0)); |
| 312 ASSERT_FALSE(HasSameAppsAsVerifier(1)); | 312 ASSERT_FALSE(HasSameAppsAsVerifier(1)); |
| 313 | 313 |
| 314 ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncer::APPS)); | 314 ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncer::APPS)); |
| 315 ASSERT_TRUE(AwaitQuiescence()); | 315 ASSERT_TRUE(AwaitQuiescence()); |
| 316 | 316 |
| 317 InstallAppsPendingForSync(GetProfile(0)); | 317 InstallAppsPendingForSync(GetProfile(0)); |
| 318 InstallAppsPendingForSync(GetProfile(1)); | 318 InstallAppsPendingForSync(GetProfile(1)); |
| 319 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); | 319 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 320 } | 320 } |
| 321 | 321 |
| 322 // Disable sync for the second client and then install an app on the first | 322 // Disable sync for the second client and then install an app on the first |
| 323 // client, then enable sync on the second client. Both clients should have the | 323 // client, then enable sync on the second client. Both clients should have the |
| 324 // same app with identical app and page ordinals. | 324 // same app with identical app and page ordinals. |
| 325 // TCM ID - 3720303. | 325 // TCM ID - 3720303. |
| 326 IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, DisableSync) { | 326 IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, DisableSync) { |
| 327 ASSERT_TRUE(SetupSync()); | 327 ASSERT_TRUE(SetupSync()); |
| 328 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); | 328 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 329 | 329 |
| 330 ASSERT_TRUE(GetClient(1)->DisableSyncForAllDatatypes()); | 330 ASSERT_TRUE(GetClient(1)->DisableSyncForAllDatatypes()); |
| 331 InstallApp(GetProfile(0), 0); | 331 InstallApp(GetProfile(0), 0); |
| 332 InstallApp(verifier(), 0); | 332 InstallApp(verifier(), 0); |
| 333 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion()); | 333 ASSERT_TRUE(GetClient(0)->AwaitCommitActivityCompletion()); |
| 334 ASSERT_TRUE(HasSameAppsAsVerifier(0)); | 334 ASSERT_TRUE(HasSameAppsAsVerifier(0)); |
| 335 ASSERT_FALSE(HasSameAppsAsVerifier(1)); | 335 ASSERT_FALSE(HasSameAppsAsVerifier(1)); |
| 336 | 336 |
| 337 ASSERT_TRUE(GetClient(1)->EnableSyncForAllDatatypes()); | 337 ASSERT_TRUE(GetClient(1)->EnableSyncForAllDatatypes()); |
| 338 ASSERT_TRUE(AwaitQuiescence()); | 338 ASSERT_TRUE(AwaitQuiescence()); |
| 339 | 339 |
| 340 InstallAppsPendingForSync(GetProfile(0)); | 340 InstallAppsPendingForSync(GetProfile(0)); |
| 341 InstallAppsPendingForSync(GetProfile(1)); | 341 InstallAppsPendingForSync(GetProfile(1)); |
| 342 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); | 342 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 343 } | 343 } |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 extension_sync_service->ProcessAppSyncData(invalid_launch_type_data); | 488 extension_sync_service->ProcessAppSyncData(invalid_launch_type_data); |
| 489 | 489 |
| 490 // The launch type should remain the same. | 490 // The launch type should remain the same. |
| 491 ASSERT_TRUE(AwaitQuiescence()); | 491 ASSERT_TRUE(AwaitQuiescence()); |
| 492 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); | 492 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
| 493 } | 493 } |
| 494 | 494 |
| 495 // TODO(akalin): Add tests exercising: | 495 // TODO(akalin): Add tests exercising: |
| 496 // - Offline installation/uninstallation behavior | 496 // - Offline installation/uninstallation behavior |
| 497 // - App-specific properties | 497 // - App-specific properties |
| OLD | NEW |