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

Unified Diff: chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc

Issue 1165913002: [Cleanup] Used scoped pointers in KeyedServiceFactory's SetTestingFactory functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finish renaming profile -> context Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc
diff --git a/chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc b/chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc
index 7c5ee2d85f61ac657d297b25d2d32676d84594bb..570f0b965fafb6974ce902b2c64db404c752ba09 100644
--- a/chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc
+++ b/chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc
@@ -56,13 +56,6 @@ storage::FileSystemURL CreateFileSystemURL(
base::FilePath(mount_path.BaseName().Append(relative_path)));
}
-// Creates a Service instance. Used to be able to destroy the service in
-// TearDown().
-KeyedService* CreateService(content::BrowserContext* context) {
- return new Service(Profile::FromBrowserContext(context),
- extensions::ExtensionRegistry::Get(context));
-}
-
} // namespace
class FileSystemProviderMountPathUtilTest : public testing::Test {
@@ -78,18 +71,11 @@ class FileSystemProviderMountPathUtilTest : public testing::Test {
user_manager_ = new FakeChromeUserManager();
user_manager_enabler_.reset(new ScopedUserManagerEnabler(user_manager_));
user_manager_->AddUser(profile_->GetProfileUserName());
- ServiceFactory::GetInstance()->SetTestingFactory(profile_, &CreateService);
file_system_provider_service_ = Service::Get(profile_);
file_system_provider_service_->SetFileSystemFactoryForTesting(
base::Bind(&FakeProvidedFileSystem::Create));
}
- void TearDown() override {
- // Setting the testing factory to NULL will destroy the created service
- // associated with the testing profile.
- ServiceFactory::GetInstance()->SetTestingFactory(profile_, NULL);
- }
-
content::TestBrowserThreadBundle thread_bundle_;
scoped_ptr<TestingProfileManager> profile_manager_;
TestingProfile* profile_; // Owned by TestingProfileManager.

Powered by Google App Engine
This is Rietveld 408576698