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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 size_t num_extensions = | 535 size_t num_extensions = |
536 GetExtensionRegistry(GetProfile(0))->enabled_extensions().size(); | 536 GetExtensionRegistry(GetProfile(0))->enabled_extensions().size(); |
537 | 537 |
538 WebApplicationInfo web_app_info; | 538 WebApplicationInfo web_app_info; |
539 web_app_info.app_url = GURL("http://www.chromium.org"); | 539 web_app_info.app_url = GURL("http://www.chromium.org"); |
540 web_app_info.title = base::UTF8ToUTF16("Test name"); | 540 web_app_info.title = base::UTF8ToUTF16("Test name"); |
541 web_app_info.description = base::UTF8ToUTF16("Test description"); | 541 web_app_info.description = base::UTF8ToUTF16("Test description"); |
542 ++num_extensions; | 542 ++num_extensions; |
543 { | 543 { |
544 content::WindowedNotificationObserver windowed_observer( | 544 content::WindowedNotificationObserver windowed_observer( |
545 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 545 extensions::NOTIFICATION_CRX_INSTALLER_DONE, |
546 content::NotificationService::AllSources()); | 546 content::NotificationService::AllSources()); |
547 extensions::CreateOrUpdateBookmarkApp(GetExtensionService(GetProfile(0)), | 547 extensions::CreateOrUpdateBookmarkApp(GetExtensionService(GetProfile(0)), |
548 web_app_info); | 548 web_app_info); |
549 windowed_observer.Wait(); | 549 windowed_observer.Wait(); |
550 EXPECT_EQ(num_extensions, | 550 EXPECT_EQ(num_extensions, |
551 GetExtensionRegistry(GetProfile(0))->enabled_extensions().size()); | 551 GetExtensionRegistry(GetProfile(0))->enabled_extensions().size()); |
552 } | 552 } |
553 { | 553 { |
554 content::WindowedNotificationObserver windowed_observer( | 554 content::WindowedNotificationObserver windowed_observer( |
555 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 555 extensions::NOTIFICATION_CRX_INSTALLER_DONE, |
556 content::NotificationService::AllSources()); | 556 content::NotificationService::AllSources()); |
557 extensions::CreateOrUpdateBookmarkApp(GetExtensionService(verifier()), | 557 extensions::CreateOrUpdateBookmarkApp(GetExtensionService(verifier()), |
558 web_app_info); | 558 web_app_info); |
559 windowed_observer.Wait(); | 559 windowed_observer.Wait(); |
560 EXPECT_EQ(num_extensions, | 560 EXPECT_EQ(num_extensions, |
561 GetExtensionRegistry(verifier())->enabled_extensions().size()); | 561 GetExtensionRegistry(verifier())->enabled_extensions().size()); |
562 } | 562 } |
563 { | 563 { |
564 // Wait for the synced app to install. | 564 // Wait for the synced app to install. |
565 content::WindowedNotificationObserver windowed_observer( | 565 content::WindowedNotificationObserver windowed_observer( |
566 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 566 extensions::NOTIFICATION_CRX_INSTALLER_DONE, |
567 content::NotificationService::AllSources()); | 567 content::NotificationService::AllSources()); |
568 ASSERT_TRUE(AwaitQuiescence()); | 568 ASSERT_TRUE(AwaitQuiescence()); |
569 windowed_observer.Wait(); | 569 windowed_observer.Wait(); |
570 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); | 570 ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); |
571 } | 571 } |
572 } | 572 } |
573 // TODO(akalin): Add tests exercising: | 573 // TODO(akalin): Add tests exercising: |
574 // - Offline installation/uninstallation behavior | 574 // - Offline installation/uninstallation behavior |
575 // - App-specific properties | 575 // - App-specific properties |
OLD | NEW |