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

Unified Diff: chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_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/fileapi/provider_async_file_util_unittest.cc
diff --git a/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util_unittest.cc b/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util_unittest.cc
index f3789cf21d6870161bee130d1eba97ae60fee078..ea4180a03d9b7fbdf0929af2f3accd01b9de47da 100644
--- a/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util_unittest.cc
+++ b/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util_unittest.cc
@@ -100,13 +100,6 @@ storage::FileSystemURL CreateFileSystemURL(const std::string& mount_point_name,
base::FilePath::FromUTF8Unsafe(mount_point_name).Append(file_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
// Tests in this file are very lightweight and just test integration between
@@ -130,7 +123,6 @@ class FileSystemProviderProviderAsyncFileUtilTest : public testing::Test {
file_system_context_ =
content::CreateFileSystemContextForTesting(NULL, data_dir_.path());
- ServiceFactory::GetInstance()->SetTestingFactory(profile_, &CreateService);
Service* service = Service::Get(profile_); // Owned by its factory.
service->SetFileSystemFactoryForTesting(
base::Bind(&FakeProvidedFileSystem::Create));
@@ -155,12 +147,6 @@ class FileSystemProviderProviderAsyncFileUtilTest : public testing::Test {
ASSERT_TRUE(root_url_.is_valid());
}
- void TearDown() override {
- // Setting the testing factory to NULL will destroy the created service
- // associated with the testing profile.
- ServiceFactory::GetInstance()->SetTestingFactory(profile_, NULL);
- }
-
scoped_ptr<storage::FileSystemOperationContext> CreateOperationContext() {
return make_scoped_ptr(
new storage::FileSystemOperationContext(file_system_context_.get()));

Powered by Google App Engine
This is Rietveld 408576698