| 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 "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
| 8 #include "chrome/browser/extensions/app_sync_data.h" | 8 #include "chrome/browser/extensions/app_sync_data.h" |
| 9 #include "chrome/browser/extensions/bookmark_app_helper.h" | 9 #include "chrome/browser/extensions/bookmark_app_helper.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 | 402 |
| 403 extensions::AppSyncData original_data( | 403 extensions::AppSyncData original_data( |
| 404 extension_sync_service->GetAppSyncData(*extension)); | 404 extension_sync_service->GetAppSyncData(*extension)); |
| 405 | 405 |
| 406 // Create an invalid launch type and ensure it doesn't get down-synced. This | 406 // Create an invalid launch type and ensure it doesn't get down-synced. This |
| 407 // simulates the case of a future launch type being added which old versions | 407 // simulates the case of a future launch type being added which old versions |
| 408 // don't yet understand. | 408 // don't yet understand. |
| 409 extensions::AppSyncData invalid_launch_type_data( | 409 extensions::AppSyncData invalid_launch_type_data( |
| 410 *extension, | 410 *extension, |
| 411 original_data.extension_sync_data().enabled(), | 411 original_data.extension_sync_data().enabled(), |
| 412 original_data.extension_sync_data().disable_reasons(), |
| 412 original_data.extension_sync_data().incognito_enabled(), | 413 original_data.extension_sync_data().incognito_enabled(), |
| 413 original_data.extension_sync_data().remote_install(), | 414 original_data.extension_sync_data().remote_install(), |
| 414 original_data.extension_sync_data().all_urls_enabled(), | 415 original_data.extension_sync_data().all_urls_enabled(), |
| 415 original_data.app_launch_ordinal(), | 416 original_data.app_launch_ordinal(), |
| 416 original_data.page_ordinal(), | 417 original_data.page_ordinal(), |
| 417 extensions::NUM_LAUNCH_TYPES); | 418 extensions::NUM_LAUNCH_TYPES); |
| 418 extension_sync_service->ProcessAppSyncData(invalid_launch_type_data); | 419 extension_sync_service->ProcessAppSyncData(invalid_launch_type_data); |
| 419 | 420 |
| 420 // The launch type should remain the same. | 421 // The launch type should remain the same. |
| 421 ASSERT_TRUE(AwaitAllProfilesHaveSameAppsAsVerifier()); | 422 ASSERT_TRUE(AwaitAllProfilesHaveSameAppsAsVerifier()); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 content::WindowedNotificationObserver windowed_observer( | 459 content::WindowedNotificationObserver windowed_observer( |
| 459 extensions::NOTIFICATION_CRX_INSTALLER_DONE, | 460 extensions::NOTIFICATION_CRX_INSTALLER_DONE, |
| 460 base::Bind(&AllProfilesHaveSameAppsAsVerifier)); | 461 base::Bind(&AllProfilesHaveSameAppsAsVerifier)); |
| 461 windowed_observer.Wait(); | 462 windowed_observer.Wait(); |
| 462 } | 463 } |
| 463 } | 464 } |
| 464 | 465 |
| 465 // TODO(akalin): Add tests exercising: | 466 // TODO(akalin): Add tests exercising: |
| 466 // - Offline installation/uninstallation behavior | 467 // - Offline installation/uninstallation behavior |
| 467 // - App-specific properties | 468 // - App-specific properties |
| OLD | NEW |