| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/extensions/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 2718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2729 | 2729 |
| 2730 } // namespace | 2730 } // namespace |
| 2731 | 2731 |
| 2732 // Test adding a pending extension. | 2732 // Test adding a pending extension. |
| 2733 TEST_F(ExtensionServiceTest, AddPendingExtensionFromSync) { | 2733 TEST_F(ExtensionServiceTest, AddPendingExtensionFromSync) { |
| 2734 InitializeEmptyExtensionService(); | 2734 InitializeEmptyExtensionService(); |
| 2735 | 2735 |
| 2736 const std::string kFakeId(all_zero); | 2736 const std::string kFakeId(all_zero); |
| 2737 const GURL kFakeUpdateURL("http:://fake.update/url"); | 2737 const GURL kFakeUpdateURL("http:://fake.update/url"); |
| 2738 const bool kFakeRemoteInstall(false); | 2738 const bool kFakeRemoteInstall(false); |
| 2739 const bool kFakeInstalledByCustodian(false); | |
| 2740 | 2739 |
| 2741 EXPECT_TRUE( | 2740 EXPECT_TRUE( |
| 2742 service()->pending_extension_manager()->AddFromSync( | 2741 service()->pending_extension_manager()->AddFromSync( |
| 2743 kFakeId, | 2742 kFakeId, |
| 2744 kFakeUpdateURL, | 2743 kFakeUpdateURL, |
| 2745 base::Version(), | 2744 base::Version(), |
| 2746 &IsExtension, | 2745 &IsExtension, |
| 2747 kFakeRemoteInstall, | 2746 kFakeRemoteInstall)); |
| 2748 kFakeInstalledByCustodian)); | |
| 2749 | 2747 |
| 2750 const extensions::PendingExtensionInfo* pending_extension_info; | 2748 const extensions::PendingExtensionInfo* pending_extension_info; |
| 2751 ASSERT_TRUE((pending_extension_info = | 2749 ASSERT_TRUE((pending_extension_info = |
| 2752 service()->pending_extension_manager()->GetById(kFakeId))); | 2750 service()->pending_extension_manager()->GetById(kFakeId))); |
| 2753 EXPECT_EQ(kFakeUpdateURL, pending_extension_info->update_url()); | 2751 EXPECT_EQ(kFakeUpdateURL, pending_extension_info->update_url()); |
| 2754 EXPECT_EQ(&IsExtension, pending_extension_info->should_allow_install_); | 2752 EXPECT_EQ(&IsExtension, pending_extension_info->should_allow_install_); |
| 2755 // Use | 2753 // Use |
| 2756 // EXPECT_TRUE(kFakeRemoteInstall == pending_extension_info->remote_install()) | 2754 // EXPECT_TRUE(kFakeRemoteInstall == pending_extension_info->remote_install()) |
| 2757 // instead of | 2755 // instead of |
| 2758 // EXPECT_EQ(kFakeRemoteInstall, pending_extension_info->remote_install()) | 2756 // EXPECT_EQ(kFakeRemoteInstall, pending_extension_info->remote_install()) |
| 2759 // as gcc 4.7 issues the following warning on EXPECT_EQ(false, x), which is | 2757 // as gcc 4.7 issues the following warning on EXPECT_EQ(false, x), which is |
| 2760 // turned into an error with -Werror=conversion-null: | 2758 // turned into an error with -Werror=conversion-null: |
| 2761 // converting 'false' to pointer type for argument 1 of | 2759 // converting 'false' to pointer type for argument 1 of |
| 2762 // 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' | 2760 // 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' |
| 2763 // https://code.google.com/p/googletest/issues/detail?id=458 | 2761 // https://code.google.com/p/googletest/issues/detail?id=458 |
| 2764 EXPECT_TRUE(kFakeRemoteInstall == pending_extension_info->remote_install()); | 2762 EXPECT_TRUE(kFakeRemoteInstall == pending_extension_info->remote_install()); |
| 2765 } | 2763 } |
| 2766 | 2764 |
| 2767 namespace { | 2765 namespace { |
| 2768 const char kGoodId[] = "ldnnhddmnhbkjipkidpdiheffobcpfmf"; | 2766 const char kGoodId[] = "ldnnhddmnhbkjipkidpdiheffobcpfmf"; |
| 2769 const char kGoodUpdateURL[] = "http://good.update/url"; | 2767 const char kGoodUpdateURL[] = "http://good.update/url"; |
| 2770 const char kGoodVersion[] = "1"; | 2768 const char kGoodVersion[] = "1"; |
| 2771 const bool kGoodIsFromSync = true; | 2769 const bool kGoodIsFromSync = true; |
| 2772 const bool kGoodRemoteInstall = false; | 2770 const bool kGoodRemoteInstall = false; |
| 2773 const bool kGoodInstalledByCustodian = false; | |
| 2774 } // namespace | 2771 } // namespace |
| 2775 | 2772 |
| 2776 // Test installing a pending extension (this goes through | 2773 // Test installing a pending extension (this goes through |
| 2777 // ExtensionService::UpdateExtension). | 2774 // ExtensionService::UpdateExtension). |
| 2778 TEST_F(ExtensionServiceTest, UpdatePendingExtension) { | 2775 TEST_F(ExtensionServiceTest, UpdatePendingExtension) { |
| 2779 InitializeEmptyExtensionService(); | 2776 InitializeEmptyExtensionService(); |
| 2780 EXPECT_TRUE( | 2777 EXPECT_TRUE( |
| 2781 service()->pending_extension_manager()->AddFromSync( | 2778 service()->pending_extension_manager()->AddFromSync( |
| 2782 kGoodId, | 2779 kGoodId, |
| 2783 GURL(kGoodUpdateURL), | 2780 GURL(kGoodUpdateURL), |
| 2784 base::Version(kGoodVersion), | 2781 base::Version(kGoodVersion), |
| 2785 &IsExtension, | 2782 &IsExtension, |
| 2786 kGoodRemoteInstall, | 2783 kGoodRemoteInstall)); |
| 2787 kGoodInstalledByCustodian)); | |
| 2788 EXPECT_TRUE(service()->pending_extension_manager()->IsIdPending(kGoodId)); | 2784 EXPECT_TRUE(service()->pending_extension_manager()->IsIdPending(kGoodId)); |
| 2789 | 2785 |
| 2790 base::FilePath path = data_dir().AppendASCII("good.crx"); | 2786 base::FilePath path = data_dir().AppendASCII("good.crx"); |
| 2791 UpdateExtension(kGoodId, path, ENABLED); | 2787 UpdateExtension(kGoodId, path, ENABLED); |
| 2792 | 2788 |
| 2793 EXPECT_FALSE(service()->pending_extension_manager()->IsIdPending(kGoodId)); | 2789 EXPECT_FALSE(service()->pending_extension_manager()->IsIdPending(kGoodId)); |
| 2794 | 2790 |
| 2795 const Extension* extension = service()->GetExtensionById(kGoodId, true); | 2791 const Extension* extension = service()->GetExtensionById(kGoodId, true); |
| 2796 EXPECT_TRUE(extension); | 2792 EXPECT_TRUE(extension); |
| 2797 } | 2793 } |
| 2798 | 2794 |
| 2799 TEST_F(ExtensionServiceTest, UpdatePendingExtensionWrongVersion) { | 2795 TEST_F(ExtensionServiceTest, UpdatePendingExtensionWrongVersion) { |
| 2800 InitializeEmptyExtensionService(); | 2796 InitializeEmptyExtensionService(); |
| 2801 base::Version other_version("0.1"); | 2797 base::Version other_version("0.1"); |
| 2802 ASSERT_TRUE(other_version.IsValid()); | 2798 ASSERT_TRUE(other_version.IsValid()); |
| 2803 ASSERT_NE(other_version, base::Version(kGoodVersion)); | 2799 ASSERT_NE(other_version, base::Version(kGoodVersion)); |
| 2804 EXPECT_TRUE( | 2800 EXPECT_TRUE( |
| 2805 service()->pending_extension_manager()->AddFromSync( | 2801 service()->pending_extension_manager()->AddFromSync( |
| 2806 kGoodId, | 2802 kGoodId, |
| 2807 GURL(kGoodUpdateURL), | 2803 GURL(kGoodUpdateURL), |
| 2808 other_version, | 2804 other_version, |
| 2809 &IsExtension, | 2805 &IsExtension, |
| 2810 kGoodRemoteInstall, | 2806 kGoodRemoteInstall)); |
| 2811 kGoodInstalledByCustodian)); | |
| 2812 EXPECT_TRUE(service()->pending_extension_manager()->IsIdPending(kGoodId)); | 2807 EXPECT_TRUE(service()->pending_extension_manager()->IsIdPending(kGoodId)); |
| 2813 | 2808 |
| 2814 base::FilePath path = data_dir().AppendASCII("good.crx"); | 2809 base::FilePath path = data_dir().AppendASCII("good.crx"); |
| 2815 // After installation, the extension should be disabled, because it's missing | 2810 // After installation, the extension should be disabled, because it's missing |
| 2816 // permissions. | 2811 // permissions. |
| 2817 UpdateExtension(kGoodId, path, DISABLED); | 2812 UpdateExtension(kGoodId, path, DISABLED); |
| 2818 | 2813 |
| 2819 EXPECT_TRUE( | 2814 EXPECT_TRUE( |
| 2820 ExtensionPrefs::Get(profile())->DidExtensionEscalatePermissions(kGoodId)); | 2815 ExtensionPrefs::Get(profile())->DidExtensionEscalatePermissions(kGoodId)); |
| 2821 | 2816 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2832 return extension->is_theme(); | 2827 return extension->is_theme(); |
| 2833 } | 2828 } |
| 2834 | 2829 |
| 2835 } // namespace | 2830 } // namespace |
| 2836 | 2831 |
| 2837 // Test updating a pending theme. | 2832 // Test updating a pending theme. |
| 2838 // Disabled due to ASAN failure. http://crbug.com/108320 | 2833 // Disabled due to ASAN failure. http://crbug.com/108320 |
| 2839 TEST_F(ExtensionServiceTest, DISABLED_UpdatePendingTheme) { | 2834 TEST_F(ExtensionServiceTest, DISABLED_UpdatePendingTheme) { |
| 2840 InitializeEmptyExtensionService(); | 2835 InitializeEmptyExtensionService(); |
| 2841 EXPECT_TRUE(service()->pending_extension_manager()->AddFromSync( | 2836 EXPECT_TRUE(service()->pending_extension_manager()->AddFromSync( |
| 2842 theme_crx, GURL(), base::Version(), &IsTheme, false, false)); | 2837 theme_crx, GURL(), base::Version(), &IsTheme, false)); |
| 2843 EXPECT_TRUE(service()->pending_extension_manager()->IsIdPending(theme_crx)); | 2838 EXPECT_TRUE(service()->pending_extension_manager()->IsIdPending(theme_crx)); |
| 2844 | 2839 |
| 2845 base::FilePath path = data_dir().AppendASCII("theme.crx"); | 2840 base::FilePath path = data_dir().AppendASCII("theme.crx"); |
| 2846 UpdateExtension(theme_crx, path, ENABLED); | 2841 UpdateExtension(theme_crx, path, ENABLED); |
| 2847 | 2842 |
| 2848 EXPECT_FALSE(service()->pending_extension_manager()->IsIdPending(theme_crx)); | 2843 EXPECT_FALSE(service()->pending_extension_manager()->IsIdPending(theme_crx)); |
| 2849 | 2844 |
| 2850 const Extension* extension = service()->GetExtensionById(theme_crx, true); | 2845 const Extension* extension = service()->GetExtensionById(theme_crx, true); |
| 2851 ASSERT_TRUE(extension); | 2846 ASSERT_TRUE(extension); |
| 2852 | 2847 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2897 TEST_F(ExtensionServiceTest, UpdatePendingExternalCrxWinsOverSync) { | 2892 TEST_F(ExtensionServiceTest, UpdatePendingExternalCrxWinsOverSync) { |
| 2898 InitializeEmptyExtensionService(); | 2893 InitializeEmptyExtensionService(); |
| 2899 | 2894 |
| 2900 // Add a crx to be installed from the update mechanism. | 2895 // Add a crx to be installed from the update mechanism. |
| 2901 EXPECT_TRUE( | 2896 EXPECT_TRUE( |
| 2902 service()->pending_extension_manager()->AddFromSync( | 2897 service()->pending_extension_manager()->AddFromSync( |
| 2903 kGoodId, | 2898 kGoodId, |
| 2904 GURL(kGoodUpdateURL), | 2899 GURL(kGoodUpdateURL), |
| 2905 base::Version(), | 2900 base::Version(), |
| 2906 &IsExtension, | 2901 &IsExtension, |
| 2907 kGoodRemoteInstall, | 2902 kGoodRemoteInstall)); |
| 2908 kGoodInstalledByCustodian)); | |
| 2909 | 2903 |
| 2910 // Check that there is a pending crx, with is_from_sync set to true. | 2904 // Check that there is a pending crx, with is_from_sync set to true. |
| 2911 const extensions::PendingExtensionInfo* pending_extension_info; | 2905 const extensions::PendingExtensionInfo* pending_extension_info; |
| 2912 ASSERT_TRUE((pending_extension_info = | 2906 ASSERT_TRUE((pending_extension_info = |
| 2913 service()->pending_extension_manager()->GetById(kGoodId))); | 2907 service()->pending_extension_manager()->GetById(kGoodId))); |
| 2914 EXPECT_TRUE(pending_extension_info->is_from_sync()); | 2908 EXPECT_TRUE(pending_extension_info->is_from_sync()); |
| 2915 | 2909 |
| 2916 // Add a crx to be updated, with the same ID, from a non-sync source. | 2910 // Add a crx to be updated, with the same ID, from a non-sync source. |
| 2917 EXPECT_TRUE(service()->pending_extension_manager()->AddFromExternalUpdateUrl( | 2911 EXPECT_TRUE(service()->pending_extension_manager()->AddFromExternalUpdateUrl( |
| 2918 kGoodId, | 2912 kGoodId, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2929 EXPECT_EQ(Manifest::EXTERNAL_PREF_DOWNLOAD, | 2923 EXPECT_EQ(Manifest::EXTERNAL_PREF_DOWNLOAD, |
| 2930 pending_extension_info->install_source()); | 2924 pending_extension_info->install_source()); |
| 2931 | 2925 |
| 2932 // Add a crx to be installed from the update mechanism. | 2926 // Add a crx to be installed from the update mechanism. |
| 2933 EXPECT_FALSE( | 2927 EXPECT_FALSE( |
| 2934 service()->pending_extension_manager()->AddFromSync( | 2928 service()->pending_extension_manager()->AddFromSync( |
| 2935 kGoodId, | 2929 kGoodId, |
| 2936 GURL(kGoodUpdateURL), | 2930 GURL(kGoodUpdateURL), |
| 2937 base::Version(), | 2931 base::Version(), |
| 2938 &IsExtension, | 2932 &IsExtension, |
| 2939 kGoodRemoteInstall, | 2933 kGoodRemoteInstall)); |
| 2940 kGoodInstalledByCustodian)); | |
| 2941 | 2934 |
| 2942 // Check that the external, non-sync update was not overridden. | 2935 // Check that the external, non-sync update was not overridden. |
| 2943 ASSERT_TRUE((pending_extension_info = | 2936 ASSERT_TRUE((pending_extension_info = |
| 2944 service()->pending_extension_manager()->GetById(kGoodId))); | 2937 service()->pending_extension_manager()->GetById(kGoodId))); |
| 2945 EXPECT_FALSE(pending_extension_info->is_from_sync()); | 2938 EXPECT_FALSE(pending_extension_info->is_from_sync()); |
| 2946 EXPECT_EQ(Manifest::EXTERNAL_PREF_DOWNLOAD, | 2939 EXPECT_EQ(Manifest::EXTERNAL_PREF_DOWNLOAD, |
| 2947 pending_extension_info->install_source()); | 2940 pending_extension_info->install_source()); |
| 2948 } | 2941 } |
| 2949 | 2942 |
| 2950 // Updating a theme should fail if the updater is explicitly told that | 2943 // Updating a theme should fail if the updater is explicitly told that |
| 2951 // the CRX is not a theme. | 2944 // the CRX is not a theme. |
| 2952 TEST_F(ExtensionServiceTest, UpdatePendingCrxThemeMismatch) { | 2945 TEST_F(ExtensionServiceTest, UpdatePendingCrxThemeMismatch) { |
| 2953 InitializeEmptyExtensionService(); | 2946 InitializeEmptyExtensionService(); |
| 2954 EXPECT_TRUE(service()->pending_extension_manager()->AddFromSync( | 2947 EXPECT_TRUE(service()->pending_extension_manager()->AddFromSync( |
| 2955 theme_crx, GURL(), base::Version(), &IsExtension, false, false)); | 2948 theme_crx, GURL(), base::Version(), &IsExtension, false)); |
| 2956 | 2949 |
| 2957 EXPECT_TRUE(service()->pending_extension_manager()->IsIdPending(theme_crx)); | 2950 EXPECT_TRUE(service()->pending_extension_manager()->IsIdPending(theme_crx)); |
| 2958 | 2951 |
| 2959 base::FilePath path = data_dir().AppendASCII("theme.crx"); | 2952 base::FilePath path = data_dir().AppendASCII("theme.crx"); |
| 2960 UpdateExtension(theme_crx, path, FAILED_SILENTLY); | 2953 UpdateExtension(theme_crx, path, FAILED_SILENTLY); |
| 2961 | 2954 |
| 2962 EXPECT_FALSE(service()->pending_extension_manager()->IsIdPending(theme_crx)); | 2955 EXPECT_FALSE(service()->pending_extension_manager()->IsIdPending(theme_crx)); |
| 2963 | 2956 |
| 2964 const Extension* extension = service()->GetExtensionById(theme_crx, true); | 2957 const Extension* extension = service()->GetExtensionById(theme_crx, true); |
| 2965 ASSERT_FALSE(extension); | 2958 ASSERT_FALSE(extension); |
| 2966 } | 2959 } |
| 2967 | 2960 |
| 2968 // TODO(akalin): Test updating a pending extension non-silently once | 2961 // TODO(akalin): Test updating a pending extension non-silently once |
| 2969 // we can mock out ExtensionInstallUI and inject our version into | 2962 // we can mock out ExtensionInstallUI and inject our version into |
| 2970 // UpdateExtension(). | 2963 // UpdateExtension(). |
| 2971 | 2964 |
| 2972 // Test updating a pending extension which fails the should-install test. | 2965 // Test updating a pending extension which fails the should-install test. |
| 2973 TEST_F(ExtensionServiceTest, UpdatePendingExtensionFailedShouldInstallTest) { | 2966 TEST_F(ExtensionServiceTest, UpdatePendingExtensionFailedShouldInstallTest) { |
| 2974 InitializeEmptyExtensionService(); | 2967 InitializeEmptyExtensionService(); |
| 2975 // Add pending extension with a flipped is_theme. | 2968 // Add pending extension with a flipped is_theme. |
| 2976 EXPECT_TRUE( | 2969 EXPECT_TRUE( |
| 2977 service()->pending_extension_manager()->AddFromSync( | 2970 service()->pending_extension_manager()->AddFromSync( |
| 2978 kGoodId, | 2971 kGoodId, |
| 2979 GURL(kGoodUpdateURL), | 2972 GURL(kGoodUpdateURL), |
| 2980 base::Version(), | 2973 base::Version(), |
| 2981 &IsTheme, | 2974 &IsTheme, |
| 2982 kGoodRemoteInstall, | 2975 kGoodRemoteInstall)); |
| 2983 kGoodInstalledByCustodian)); | |
| 2984 EXPECT_TRUE(service()->pending_extension_manager()->IsIdPending(kGoodId)); | 2976 EXPECT_TRUE(service()->pending_extension_manager()->IsIdPending(kGoodId)); |
| 2985 | 2977 |
| 2986 base::FilePath path = data_dir().AppendASCII("good.crx"); | 2978 base::FilePath path = data_dir().AppendASCII("good.crx"); |
| 2987 UpdateExtension(kGoodId, path, UPDATED); | 2979 UpdateExtension(kGoodId, path, UPDATED); |
| 2988 | 2980 |
| 2989 // TODO(akalin): Figure out how to check that the extensions | 2981 // TODO(akalin): Figure out how to check that the extensions |
| 2990 // directory is cleaned up properly in OnExtensionInstalled(). | 2982 // directory is cleaned up properly in OnExtensionInstalled(). |
| 2991 | 2983 |
| 2992 EXPECT_FALSE(service()->pending_extension_manager()->IsIdPending(kGoodId)); | 2984 EXPECT_FALSE(service()->pending_extension_manager()->IsIdPending(kGoodId)); |
| 2993 } | 2985 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 3018 | 3010 |
| 3019 // Use AddExtensionImpl() as AddFrom*() would balk. | 3011 // Use AddExtensionImpl() as AddFrom*() would balk. |
| 3020 service()->pending_extension_manager()->AddExtensionImpl( | 3012 service()->pending_extension_manager()->AddExtensionImpl( |
| 3021 good->id(), | 3013 good->id(), |
| 3022 std::string(), | 3014 std::string(), |
| 3023 extensions::ManifestURL::GetUpdateURL(good), | 3015 extensions::ManifestURL::GetUpdateURL(good), |
| 3024 Version(), | 3016 Version(), |
| 3025 &IsExtension, | 3017 &IsExtension, |
| 3026 kGoodIsFromSync, | 3018 kGoodIsFromSync, |
| 3027 Manifest::INTERNAL, | 3019 Manifest::INTERNAL, |
| 3028 Extension::NO_FLAGS, | |
| 3029 false, | 3020 false, |
| 3030 kGoodRemoteInstall); | 3021 kGoodRemoteInstall); |
| 3031 UpdateExtension(good->id(), path, ENABLED); | 3022 UpdateExtension(good->id(), path, ENABLED); |
| 3032 | 3023 |
| 3033 EXPECT_FALSE(service()->pending_extension_manager()->IsIdPending(kGoodId)); | 3024 EXPECT_FALSE(service()->pending_extension_manager()->IsIdPending(kGoodId)); |
| 3034 } | 3025 } |
| 3035 | 3026 |
| 3036 #if defined(ENABLE_BLACKLIST_TESTS) | 3027 #if defined(ENABLE_BLACKLIST_TESTS) |
| 3037 // Tests blacklisting then unblacklisting extensions after the service has been | 3028 // Tests blacklisting then unblacklisting extensions after the service has been |
| 3038 // initialized. | 3029 // initialized. |
| (...skipping 2974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6013 return service()->OnExternalExtensionFileFound(*info); | 6004 return service()->OnExternalExtensionFileFound(*info); |
| 6014 } | 6005 } |
| 6015 | 6006 |
| 6016 // Fake a request from sync to install an extension. | 6007 // Fake a request from sync to install an extension. |
| 6017 bool AddPendingSyncInstall() { | 6008 bool AddPendingSyncInstall() { |
| 6018 return service()->pending_extension_manager()->AddFromSync( | 6009 return service()->pending_extension_manager()->AddFromSync( |
| 6019 crx_id_, | 6010 crx_id_, |
| 6020 GURL(kGoodUpdateURL), | 6011 GURL(kGoodUpdateURL), |
| 6021 base::Version(), | 6012 base::Version(), |
| 6022 &IsExtension, | 6013 &IsExtension, |
| 6023 kGoodRemoteInstall, | 6014 kGoodRemoteInstall); |
| 6024 kGoodInstalledByCustodian); | |
| 6025 } | 6015 } |
| 6026 | 6016 |
| 6027 // Fake a policy install. | 6017 // Fake a policy install. |
| 6028 bool AddPendingPolicyInstall() { | 6018 bool AddPendingPolicyInstall() { |
| 6029 // Get path to the CRX with id |kGoodId|. | 6019 // Get path to the CRX with id |kGoodId|. |
| 6030 std::unique_ptr<GURL> empty_url(new GURL()); | 6020 std::unique_ptr<GURL> empty_url(new GURL()); |
| 6031 std::unique_ptr<ExternalInstallInfoUpdateUrl> info( | 6021 std::unique_ptr<ExternalInstallInfoUpdateUrl> info( |
| 6032 new ExternalInstallInfoUpdateUrl( | 6022 new ExternalInstallInfoUpdateUrl( |
| 6033 crx_id_, std::string(), std::move(empty_url), | 6023 crx_id_, std::string(), std::move(empty_url), |
| 6034 Manifest::EXTERNAL_POLICY_DOWNLOAD, Extension::NO_FLAGS, false)); | 6024 Manifest::EXTERNAL_POLICY_DOWNLOAD, Extension::NO_FLAGS, false)); |
| (...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6815 | 6805 |
| 6816 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED, | 6806 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED, |
| 6817 content::Source<Profile>(profile()), | 6807 content::Source<Profile>(profile()), |
| 6818 content::NotificationService::NoDetails()); | 6808 content::NotificationService::NoDetails()); |
| 6819 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_); | 6809 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_); |
| 6820 EXPECT_EQ(0u, registry()->enabled_extensions().size()); | 6810 EXPECT_EQ(0u, registry()->enabled_extensions().size()); |
| 6821 EXPECT_EQ(0u, registry()->disabled_extensions().size()); | 6811 EXPECT_EQ(0u, registry()->disabled_extensions().size()); |
| 6822 EXPECT_EQ(0u, registry()->terminated_extensions().size()); | 6812 EXPECT_EQ(0u, registry()->terminated_extensions().size()); |
| 6823 EXPECT_EQ(0u, registry()->blacklisted_extensions().size()); | 6813 EXPECT_EQ(0u, registry()->blacklisted_extensions().size()); |
| 6824 } | 6814 } |
| OLD | NEW |