OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/external_provider_impl.h" | 5 #include "chrome/browser/extensions/external_provider_impl.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 // Don't install default apps. Some of the default apps are downloaded from | 73 // Don't install default apps. Some of the default apps are downloaded from |
74 // the webstore, ignoring the url we pass to kAppsGalleryUpdateURL, which | 74 // the webstore, ignoring the url we pass to kAppsGalleryUpdateURL, which |
75 // would cause the external updates to never finish install. | 75 // would cause the external updates to never finish install. |
76 profile_->GetPrefs()->SetString(prefs::kDefaultApps, ""); | 76 profile_->GetPrefs()->SetString(prefs::kDefaultApps, ""); |
77 | 77 |
78 ProviderCollection providers; | 78 ProviderCollection providers; |
79 extensions::ExternalProviderImpl::CreateExternalProviders( | 79 extensions::ExternalProviderImpl::CreateExternalProviders( |
80 service_, profile_.get(), &providers); | 80 service_, profile_.get(), &providers); |
81 | 81 |
82 for (ProviderCollection::iterator i = providers.begin(); | 82 for (std::unique_ptr<ExternalProviderInterface>& provider : providers) |
83 i != providers.end(); | 83 service_->AddProviderForTesting(std::move(provider)); |
84 ++i) { | |
85 service_->AddProviderForTesting(i->release()); | |
86 } | |
87 } | 84 } |
88 | 85 |
89 void InitializeExtensionServiceWithUpdaterAndPrefs() { | 86 void InitializeExtensionServiceWithUpdaterAndPrefs() { |
90 ExtensionServiceInitParams params = CreateDefaultInitParams(); | 87 ExtensionServiceInitParams params = CreateDefaultInitParams(); |
91 params.autoupdate_enabled = true; | 88 params.autoupdate_enabled = true; |
92 // Create prefs file to make the profile not new. | 89 // Create prefs file to make the profile not new. |
93 const char prefs[] = "{}"; | 90 const char prefs[] = "{}"; |
94 EXPECT_EQ(base::WriteFile(params.pref_file, prefs, sizeof(prefs)), | 91 EXPECT_EQ(base::WriteFile(params.pref_file, prefs, sizeof(prefs)), |
95 int(sizeof(prefs))); | 92 int(sizeof(prefs))); |
96 InitializeExtensionService(params); | 93 InitializeExtensionService(params); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 service_->CheckForExternalUpdates(); | 171 service_->CheckForExternalUpdates(); |
175 runner->Run(); | 172 runner->Run(); |
176 | 173 |
177 EXPECT_TRUE(service_->GetInstalledExtension( | 174 EXPECT_TRUE(service_->GetInstalledExtension( |
178 extension_misc::kInAppPaymentsSupportAppId)); | 175 extension_misc::kInAppPaymentsSupportAppId)); |
179 EXPECT_TRUE(service_->IsExtensionEnabled( | 176 EXPECT_TRUE(service_->IsExtensionEnabled( |
180 extension_misc::kInAppPaymentsSupportAppId)); | 177 extension_misc::kInAppPaymentsSupportAppId)); |
181 } | 178 } |
182 | 179 |
183 } // namespace extensions | 180 } // namespace extensions |
OLD | NEW |