Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: chrome/browser/extensions/extension_service_unittest.cc

Issue 264763002: Support remote installation of extensions and apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_unittest.h" 5 #include "chrome/browser/extensions/extension_service_unittest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 3003 matching lines...) Expand 10 before | Expand all | Expand 10 after
3014 3014
3015 } // namespace 3015 } // namespace
3016 3016
3017 // Test adding a pending extension. 3017 // Test adding a pending extension.
3018 TEST_F(ExtensionServiceTest, AddPendingExtensionFromSync) { 3018 TEST_F(ExtensionServiceTest, AddPendingExtensionFromSync) {
3019 InitializeEmptyExtensionService(); 3019 InitializeEmptyExtensionService();
3020 3020
3021 const std::string kFakeId(all_zero); 3021 const std::string kFakeId(all_zero);
3022 const GURL kFakeUpdateURL("http:://fake.update/url"); 3022 const GURL kFakeUpdateURL("http:://fake.update/url");
3023 const bool kFakeInstallSilently(true); 3023 const bool kFakeInstallSilently(true);
3024 const bool kFakeRemoteInstall(false);
3024 3025
3025 EXPECT_TRUE(service_->pending_extension_manager()->AddFromSync( 3026 EXPECT_TRUE(
3026 kFakeId, kFakeUpdateURL, &IsExtension, 3027 service_->pending_extension_manager()->AddFromSync(kFakeId,
3027 kFakeInstallSilently)); 3028 kFakeUpdateURL,
3029 &IsExtension,
3030 kFakeInstallSilently,
3031 kFakeRemoteInstall));
3028 3032
3029 const extensions::PendingExtensionInfo* pending_extension_info; 3033 const extensions::PendingExtensionInfo* pending_extension_info;
3030 ASSERT_TRUE((pending_extension_info = service_->pending_extension_manager()-> 3034 ASSERT_TRUE((pending_extension_info = service_->pending_extension_manager()->
3031 GetById(kFakeId))); 3035 GetById(kFakeId)));
3032 EXPECT_EQ(kFakeUpdateURL, pending_extension_info->update_url()); 3036 EXPECT_EQ(kFakeUpdateURL, pending_extension_info->update_url());
3033 EXPECT_EQ(&IsExtension, pending_extension_info->should_allow_install_); 3037 EXPECT_EQ(&IsExtension, pending_extension_info->should_allow_install_);
3034 EXPECT_EQ(kFakeInstallSilently, pending_extension_info->install_silently()); 3038 EXPECT_EQ(kFakeInstallSilently, pending_extension_info->install_silently());
3039 EXPECT_EQ(kFakeRemoteInstall, pending_extension_info->remote_install());
3035 } 3040 }
3036 3041
3037 namespace { 3042 namespace {
3038 const char kGoodId[] = "ldnnhddmnhbkjipkidpdiheffobcpfmf"; 3043 const char kGoodId[] = "ldnnhddmnhbkjipkidpdiheffobcpfmf";
3039 const char kGoodUpdateURL[] = "http://good.update/url"; 3044 const char kGoodUpdateURL[] = "http://good.update/url";
3040 const bool kGoodIsFromSync = true; 3045 const bool kGoodIsFromSync = true;
3041 const bool kGoodInstallSilently = true; 3046 const bool kGoodInstallSilently = true;
3047 const bool kGoodRemoteInstall = false;
3042 } // namespace 3048 } // namespace
3043 3049
3044 // Test updating a pending extension. 3050 // Test updating a pending extension.
3045 TEST_F(ExtensionServiceTest, UpdatePendingExtension) { 3051 TEST_F(ExtensionServiceTest, UpdatePendingExtension) {
3046 InitializeEmptyExtensionService(); 3052 InitializeEmptyExtensionService();
3047 EXPECT_TRUE(service_->pending_extension_manager()->AddFromSync( 3053 EXPECT_TRUE(
3048 kGoodId, GURL(kGoodUpdateURL), &IsExtension, 3054 service_->pending_extension_manager()->AddFromSync(kGoodId,
3049 kGoodInstallSilently)); 3055 GURL(kGoodUpdateURL),
3056 &IsExtension,
3057 kGoodInstallSilently,
3058 kGoodRemoteInstall));
3050 EXPECT_TRUE(service_->pending_extension_manager()->IsIdPending(kGoodId)); 3059 EXPECT_TRUE(service_->pending_extension_manager()->IsIdPending(kGoodId));
3051 3060
3052 base::FilePath path = data_dir_.AppendASCII("good.crx"); 3061 base::FilePath path = data_dir_.AppendASCII("good.crx");
3053 UpdateExtension(kGoodId, path, ENABLED); 3062 UpdateExtension(kGoodId, path, ENABLED);
3054 3063
3055 EXPECT_FALSE(service_->pending_extension_manager()->IsIdPending(kGoodId)); 3064 EXPECT_FALSE(service_->pending_extension_manager()->IsIdPending(kGoodId));
3056 3065
3057 const Extension* extension = service_->GetExtensionById(kGoodId, true); 3066 const Extension* extension = service_->GetExtensionById(kGoodId, true);
3058 ASSERT_TRUE(extension); 3067 ASSERT_TRUE(extension);
3059 } 3068 }
3060 3069
3061 namespace { 3070 namespace {
3062 3071
3063 bool IsTheme(const Extension* extension) { 3072 bool IsTheme(const Extension* extension) {
3064 return extension->is_theme(); 3073 return extension->is_theme();
3065 } 3074 }
3066 3075
3067 } // namespace 3076 } // namespace
3068 3077
3069 // Test updating a pending theme. 3078 // Test updating a pending theme.
3070 // Disabled due to ASAN failure. http://crbug.com/108320 3079 // Disabled due to ASAN failure. http://crbug.com/108320
3071 TEST_F(ExtensionServiceTest, DISABLED_UpdatePendingTheme) { 3080 TEST_F(ExtensionServiceTest, DISABLED_UpdatePendingTheme) {
3072 InitializeEmptyExtensionService(); 3081 InitializeEmptyExtensionService();
3073 EXPECT_TRUE(service_->pending_extension_manager()->AddFromSync( 3082 EXPECT_TRUE(service_->pending_extension_manager()->AddFromSync(
3074 theme_crx, GURL(), &IsTheme, false)); 3083 theme_crx, GURL(), &IsTheme, false, false));
3075 EXPECT_TRUE(service_->pending_extension_manager()->IsIdPending(theme_crx)); 3084 EXPECT_TRUE(service_->pending_extension_manager()->IsIdPending(theme_crx));
3076 3085
3077 base::FilePath path = data_dir_.AppendASCII("theme.crx"); 3086 base::FilePath path = data_dir_.AppendASCII("theme.crx");
3078 UpdateExtension(theme_crx, path, ENABLED); 3087 UpdateExtension(theme_crx, path, ENABLED);
3079 3088
3080 EXPECT_FALSE(service_->pending_extension_manager()->IsIdPending(theme_crx)); 3089 EXPECT_FALSE(service_->pending_extension_manager()->IsIdPending(theme_crx));
3081 3090
3082 const Extension* extension = service_->GetExtensionById(theme_crx, true); 3091 const Extension* extension = service_->GetExtensionById(theme_crx, true);
3083 ASSERT_TRUE(extension); 3092 ASSERT_TRUE(extension);
3084 3093
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
3123 profile_.get())); 3132 profile_.get()));
3124 } 3133 }
3125 3134
3126 // Test updating a pending CRX as if the source is an external extension 3135 // Test updating a pending CRX as if the source is an external extension
3127 // with an update URL. The external update should overwrite a sync update, 3136 // with an update URL. The external update should overwrite a sync update,
3128 // but a sync update should not overwrite a non-sync update. 3137 // but a sync update should not overwrite a non-sync update.
3129 TEST_F(ExtensionServiceTest, UpdatePendingExternalCrxWinsOverSync) { 3138 TEST_F(ExtensionServiceTest, UpdatePendingExternalCrxWinsOverSync) {
3130 InitializeEmptyExtensionService(); 3139 InitializeEmptyExtensionService();
3131 3140
3132 // Add a crx to be installed from the update mechanism. 3141 // Add a crx to be installed from the update mechanism.
3133 EXPECT_TRUE(service_->pending_extension_manager()->AddFromSync( 3142 EXPECT_TRUE(
3134 kGoodId, GURL(kGoodUpdateURL), &IsExtension, 3143 service_->pending_extension_manager()->AddFromSync(kGoodId,
3135 kGoodInstallSilently)); 3144 GURL(kGoodUpdateURL),
3145 &IsExtension,
3146 kGoodInstallSilently,
3147 kGoodRemoteInstall));
3136 3148
3137 // Check that there is a pending crx, with is_from_sync set to true. 3149 // Check that there is a pending crx, with is_from_sync set to true.
3138 const extensions::PendingExtensionInfo* pending_extension_info; 3150 const extensions::PendingExtensionInfo* pending_extension_info;
3139 ASSERT_TRUE((pending_extension_info = service_->pending_extension_manager()-> 3151 ASSERT_TRUE((pending_extension_info = service_->pending_extension_manager()->
3140 GetById(kGoodId))); 3152 GetById(kGoodId)));
3141 EXPECT_TRUE(pending_extension_info->is_from_sync()); 3153 EXPECT_TRUE(pending_extension_info->is_from_sync());
3142 3154
3143 // Add a crx to be updated, with the same ID, from a non-sync source. 3155 // Add a crx to be updated, with the same ID, from a non-sync source.
3144 EXPECT_TRUE(service_->pending_extension_manager()->AddFromExternalUpdateUrl( 3156 EXPECT_TRUE(service_->pending_extension_manager()->AddFromExternalUpdateUrl(
3145 kGoodId, 3157 kGoodId,
3146 std::string(), 3158 std::string(),
3147 GURL(kGoodUpdateURL), 3159 GURL(kGoodUpdateURL),
3148 Manifest::EXTERNAL_PREF_DOWNLOAD, 3160 Manifest::EXTERNAL_PREF_DOWNLOAD,
3149 Extension::NO_FLAGS, 3161 Extension::NO_FLAGS,
3150 false)); 3162 false));
3151 3163
3152 // Check that there is a pending crx, with is_from_sync set to false. 3164 // Check that there is a pending crx, with is_from_sync set to false.
3153 ASSERT_TRUE((pending_extension_info = service_->pending_extension_manager()-> 3165 ASSERT_TRUE((pending_extension_info = service_->pending_extension_manager()->
3154 GetById(kGoodId))); 3166 GetById(kGoodId)));
3155 EXPECT_FALSE(pending_extension_info->is_from_sync()); 3167 EXPECT_FALSE(pending_extension_info->is_from_sync());
3156 EXPECT_EQ(Manifest::EXTERNAL_PREF_DOWNLOAD, 3168 EXPECT_EQ(Manifest::EXTERNAL_PREF_DOWNLOAD,
3157 pending_extension_info->install_source()); 3169 pending_extension_info->install_source());
3158 3170
3159 // Add a crx to be installed from the update mechanism. 3171 // Add a crx to be installed from the update mechanism.
3160 EXPECT_FALSE(service_->pending_extension_manager()->AddFromSync( 3172 EXPECT_FALSE(
3161 kGoodId, GURL(kGoodUpdateURL), &IsExtension, 3173 service_->pending_extension_manager()->AddFromSync(kGoodId,
3162 kGoodInstallSilently)); 3174 GURL(kGoodUpdateURL),
3175 &IsExtension,
3176 kGoodInstallSilently,
3177 kGoodRemoteInstall));
3163 3178
3164 // Check that the external, non-sync update was not overridden. 3179 // Check that the external, non-sync update was not overridden.
3165 ASSERT_TRUE((pending_extension_info = service_->pending_extension_manager()-> 3180 ASSERT_TRUE((pending_extension_info = service_->pending_extension_manager()->
3166 GetById(kGoodId))); 3181 GetById(kGoodId)));
3167 EXPECT_FALSE(pending_extension_info->is_from_sync()); 3182 EXPECT_FALSE(pending_extension_info->is_from_sync());
3168 EXPECT_EQ(Manifest::EXTERNAL_PREF_DOWNLOAD, 3183 EXPECT_EQ(Manifest::EXTERNAL_PREF_DOWNLOAD,
3169 pending_extension_info->install_source()); 3184 pending_extension_info->install_source());
3170 } 3185 }
3171 3186
3172 // Updating a theme should fail if the updater is explicitly told that 3187 // Updating a theme should fail if the updater is explicitly told that
3173 // the CRX is not a theme. 3188 // the CRX is not a theme.
3174 TEST_F(ExtensionServiceTest, UpdatePendingCrxThemeMismatch) { 3189 TEST_F(ExtensionServiceTest, UpdatePendingCrxThemeMismatch) {
3175 InitializeEmptyExtensionService(); 3190 InitializeEmptyExtensionService();
3176 EXPECT_TRUE(service_->pending_extension_manager()->AddFromSync( 3191 EXPECT_TRUE(service_->pending_extension_manager()->AddFromSync(
3177 theme_crx, GURL(), &IsExtension, true)); 3192 theme_crx, GURL(), &IsExtension, true, false));
3178 3193
3179 EXPECT_TRUE(service_->pending_extension_manager()->IsIdPending(theme_crx)); 3194 EXPECT_TRUE(service_->pending_extension_manager()->IsIdPending(theme_crx));
3180 3195
3181 base::FilePath path = data_dir_.AppendASCII("theme.crx"); 3196 base::FilePath path = data_dir_.AppendASCII("theme.crx");
3182 UpdateExtension(theme_crx, path, FAILED_SILENTLY); 3197 UpdateExtension(theme_crx, path, FAILED_SILENTLY);
3183 3198
3184 EXPECT_FALSE(service_->pending_extension_manager()->IsIdPending(theme_crx)); 3199 EXPECT_FALSE(service_->pending_extension_manager()->IsIdPending(theme_crx));
3185 3200
3186 const Extension* extension = service_->GetExtensionById(theme_crx, true); 3201 const Extension* extension = service_->GetExtensionById(theme_crx, true);
3187 ASSERT_FALSE(extension); 3202 ASSERT_FALSE(extension);
3188 } 3203 }
3189 3204
3190 // TODO(akalin): Test updating a pending extension non-silently once 3205 // TODO(akalin): Test updating a pending extension non-silently once
3191 // we can mock out ExtensionInstallUI and inject our version into 3206 // we can mock out ExtensionInstallUI and inject our version into
3192 // UpdateExtension(). 3207 // UpdateExtension().
3193 3208
3194 // Test updating a pending extension which fails the should-install test. 3209 // Test updating a pending extension which fails the should-install test.
3195 TEST_F(ExtensionServiceTest, UpdatePendingExtensionFailedShouldInstallTest) { 3210 TEST_F(ExtensionServiceTest, UpdatePendingExtensionFailedShouldInstallTest) {
3196 InitializeEmptyExtensionService(); 3211 InitializeEmptyExtensionService();
3197 // Add pending extension with a flipped is_theme. 3212 // Add pending extension with a flipped is_theme.
3198 EXPECT_TRUE(service_->pending_extension_manager()->AddFromSync( 3213 EXPECT_TRUE(
3199 kGoodId, GURL(kGoodUpdateURL), &IsTheme, kGoodInstallSilently)); 3214 service_->pending_extension_manager()->AddFromSync(kGoodId,
3215 GURL(kGoodUpdateURL),
3216 &IsTheme,
3217 kGoodInstallSilently,
3218 kGoodRemoteInstall));
3200 EXPECT_TRUE(service_->pending_extension_manager()->IsIdPending(kGoodId)); 3219 EXPECT_TRUE(service_->pending_extension_manager()->IsIdPending(kGoodId));
3201 3220
3202 base::FilePath path = data_dir_.AppendASCII("good.crx"); 3221 base::FilePath path = data_dir_.AppendASCII("good.crx");
3203 UpdateExtension(kGoodId, path, UPDATED); 3222 UpdateExtension(kGoodId, path, UPDATED);
3204 3223
3205 // TODO(akalin): Figure out how to check that the extensions 3224 // TODO(akalin): Figure out how to check that the extensions
3206 // directory is cleaned up properly in OnExtensionInstalled(). 3225 // directory is cleaned up properly in OnExtensionInstalled().
3207 3226
3208 EXPECT_FALSE(service_->pending_extension_manager()->IsIdPending(kGoodId)); 3227 EXPECT_FALSE(service_->pending_extension_manager()->IsIdPending(kGoodId));
3209 } 3228 }
(...skipping 26 matching lines...) Expand all
3236 service_->pending_extension_manager()->AddExtensionImpl( 3255 service_->pending_extension_manager()->AddExtensionImpl(
3237 good->id(), 3256 good->id(),
3238 std::string(), 3257 std::string(),
3239 extensions::ManifestURL::GetUpdateURL(good), 3258 extensions::ManifestURL::GetUpdateURL(good),
3240 Version(), 3259 Version(),
3241 &IsExtension, 3260 &IsExtension,
3242 kGoodIsFromSync, 3261 kGoodIsFromSync,
3243 kGoodInstallSilently, 3262 kGoodInstallSilently,
3244 Manifest::INTERNAL, 3263 Manifest::INTERNAL,
3245 Extension::NO_FLAGS, 3264 Extension::NO_FLAGS,
3246 false); 3265 false,
3266 kGoodRemoteInstall);
3247 UpdateExtension(good->id(), path, ENABLED); 3267 UpdateExtension(good->id(), path, ENABLED);
3248 3268
3249 EXPECT_FALSE(service_->pending_extension_manager()->IsIdPending(kGoodId)); 3269 EXPECT_FALSE(service_->pending_extension_manager()->IsIdPending(kGoodId));
3250 } 3270 }
3251 3271
3252 #if defined(ENABLE_BLACKLIST_TESTS) 3272 #if defined(ENABLE_BLACKLIST_TESTS)
3253 // Tests blacklisting then unblacklisting extensions after the service has been 3273 // Tests blacklisting then unblacklisting extensions after the service has been
3254 // initialized. 3274 // initialized.
3255 TEST_F(ExtensionServiceTest, SetUnsetBlacklistInPrefs) { 3275 TEST_F(ExtensionServiceTest, SetUnsetBlacklistInPrefs) {
3256 extensions::TestBlacklist test_blacklist; 3276 extensions::TestBlacklist test_blacklist;
(...skipping 2187 matching lines...) Expand 10 before | Expand all | Expand 10 after
5444 5464
5445 service_->Init(); 5465 service_->Init();
5446 ASSERT_TRUE(service_->is_ready()); 5466 ASSERT_TRUE(service_->is_ready());
5447 5467
5448 ASSERT_EQ(3u, loaded_.size()); 5468 ASSERT_EQ(3u, loaded_.size());
5449 5469
5450 // We start enabled. 5470 // We start enabled.
5451 const Extension* extension = service_->GetExtensionById(good0, true); 5471 const Extension* extension = service_->GetExtensionById(good0, true);
5452 ASSERT_TRUE(extension); 5472 ASSERT_TRUE(extension);
5453 ASSERT_TRUE(service_->IsExtensionEnabled(good0)); 5473 ASSERT_TRUE(service_->IsExtensionEnabled(good0));
5454 extensions::ExtensionSyncData disable_good_crx(*extension, false, false); 5474 extensions::ExtensionSyncData disable_good_crx(
5475 *extension, false, false, false);
5455 5476
5456 // Then sync data arrives telling us to disable |good0|. 5477 // Then sync data arrives telling us to disable |good0|.
5457 syncer::SyncDataList sync_data; 5478 syncer::SyncDataList sync_data;
5458 sync_data.push_back(disable_good_crx.GetSyncData()); 5479 sync_data.push_back(disable_good_crx.GetSyncData());
5459 extension_sync_service_->MergeDataAndStartSyncing( 5480 extension_sync_service_->MergeDataAndStartSyncing(
5460 syncer::EXTENSIONS, 5481 syncer::EXTENSIONS,
5461 sync_data, 5482 sync_data,
5462 scoped_ptr<syncer::SyncChangeProcessor>( 5483 scoped_ptr<syncer::SyncChangeProcessor>(
5463 new syncer::FakeSyncChangeProcessor), 5484 new syncer::FakeSyncChangeProcessor),
5464 scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); 5485 scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock()));
(...skipping 26 matching lines...) Expand all
5491 // Disable extension before first sync data arrives. 5512 // Disable extension before first sync data arrives.
5492 service_->DisableExtension(good0, Extension::DISABLE_USER_ACTION); 5513 service_->DisableExtension(good0, Extension::DISABLE_USER_ACTION);
5493 ASSERT_FALSE(service_->IsExtensionEnabled(good0)); 5514 ASSERT_FALSE(service_->IsExtensionEnabled(good0));
5494 5515
5495 // Enable extension - this is now the most recent state. 5516 // Enable extension - this is now the most recent state.
5496 service_->EnableExtension(good0); 5517 service_->EnableExtension(good0);
5497 ASSERT_TRUE(service_->IsExtensionEnabled(good0)); 5518 ASSERT_TRUE(service_->IsExtensionEnabled(good0));
5498 5519
5499 // Now sync data comes in that says to disable good0. This should be 5520 // Now sync data comes in that says to disable good0. This should be
5500 // ignored. 5521 // ignored.
5501 extensions::ExtensionSyncData disable_good_crx(*extension, false, false); 5522 extensions::ExtensionSyncData disable_good_crx(
5523 *extension, false, false, false);
5502 syncer::SyncDataList sync_data; 5524 syncer::SyncDataList sync_data;
5503 sync_data.push_back(disable_good_crx.GetSyncData()); 5525 sync_data.push_back(disable_good_crx.GetSyncData());
5504 extension_sync_service_->MergeDataAndStartSyncing( 5526 extension_sync_service_->MergeDataAndStartSyncing(
5505 syncer::EXTENSIONS, 5527 syncer::EXTENSIONS,
5506 sync_data, 5528 sync_data,
5507 scoped_ptr<syncer::SyncChangeProcessor>( 5529 scoped_ptr<syncer::SyncChangeProcessor>(
5508 new syncer::FakeSyncChangeProcessor), 5530 new syncer::FakeSyncChangeProcessor),
5509 scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); 5531 scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock()));
5510 5532
5511 // The extension was enabled locally before the sync data arrived, so it 5533 // The extension was enabled locally before the sync data arrived, so it
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
6491 Version version("1.0.0.0"); 6513 Version version("1.0.0.0");
6492 6514
6493 return service_->OnExternalExtensionFileFound( 6515 return service_->OnExternalExtensionFileFound(
6494 crx_id_, &version, crx_path_, Manifest::EXTERNAL_PREF, 6516 crx_id_, &version, crx_path_, Manifest::EXTERNAL_PREF,
6495 Extension::NO_FLAGS, false); 6517 Extension::NO_FLAGS, false);
6496 } 6518 }
6497 6519
6498 // Fake a request from sync to install an extension. 6520 // Fake a request from sync to install an extension.
6499 bool AddPendingSyncInstall() { 6521 bool AddPendingSyncInstall() {
6500 return service_->pending_extension_manager()->AddFromSync( 6522 return service_->pending_extension_manager()->AddFromSync(
6501 crx_id_, GURL(kGoodUpdateURL), &IsExtension, kGoodInstallSilently); 6523 crx_id_,
6524 GURL(kGoodUpdateURL),
6525 &IsExtension,
6526 kGoodInstallSilently,
6527 kGoodRemoteInstall);
6502 } 6528 }
6503 6529
6504 // Fake a policy install. 6530 // Fake a policy install.
6505 bool AddPendingPolicyInstall() { 6531 bool AddPendingPolicyInstall() {
6506 // Get path to the CRX with id |kGoodId|. 6532 // Get path to the CRX with id |kGoodId|.
6507 return service_->OnExternalExtensionUpdateUrlFound( 6533 return service_->OnExternalExtensionUpdateUrlFound(
6508 crx_id_, 6534 crx_id_,
6509 std::string(), 6535 std::string(),
6510 GURL(), 6536 GURL(),
6511 Manifest::EXTERNAL_POLICY_DOWNLOAD, 6537 Manifest::EXTERNAL_POLICY_DOWNLOAD,
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
6910 // ReconcileKnownDisabled(). 6936 // ReconcileKnownDisabled().
6911 service_->EnableExtension(good2); 6937 service_->EnableExtension(good2);
6912 service_->ReconcileKnownDisabled(); 6938 service_->ReconcileKnownDisabled();
6913 expected_extensions.insert(good2); 6939 expected_extensions.insert(good2);
6914 expected_disabled_extensions.erase(good2); 6940 expected_disabled_extensions.erase(good2);
6915 6941
6916 EXPECT_EQ(expected_extensions, registry_->enabled_extensions().GetIDs()); 6942 EXPECT_EQ(expected_extensions, registry_->enabled_extensions().GetIDs());
6917 EXPECT_EQ(expected_disabled_extensions, 6943 EXPECT_EQ(expected_disabled_extensions,
6918 registry_->disabled_extensions().GetIDs()); 6944 registry_->disabled_extensions().GetIDs());
6919 } 6945 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698