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

Unified Diff: chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader_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/file_stream_reader_unittest.cc
diff --git a/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader_unittest.cc b/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader_unittest.cc
index 2b25c3269db1cd45b4b9df3983c86713e4021c91..22132394b9ea999679f90dd7a84a0fdc5a780b56 100644
--- a/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader_unittest.cc
+++ b/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader_unittest.cc
@@ -71,13 +71,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
class FileSystemProviderFileStreamReader : public testing::Test {
@@ -92,7 +85,6 @@ class FileSystemProviderFileStreamReader : public testing::Test {
ASSERT_TRUE(profile_manager_->SetUp());
profile_ = profile_manager_->CreateTestingProfile("testing-profile");
- ServiceFactory::GetInstance()->SetTestingFactory(profile_, &CreateService);
Service* service = Service::Get(profile_); // Owned by its factory.
service->SetFileSystemFactoryForTesting(
base::Bind(&FakeProvidedFileSystem::Create));
@@ -120,12 +112,6 @@ class FileSystemProviderFileStreamReader : public testing::Test {
ASSERT_TRUE(wrong_file_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);
- }
-
content::TestBrowserThreadBundle thread_bundle_;
base::ScopedTempDir data_dir_;
scoped_ptr<TestingProfileManager> profile_manager_;

Powered by Google App Engine
This is Rietveld 408576698