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

Unified Diff: chrome/browser/signin/easy_unlock_service_unittest_chromeos.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/signin/easy_unlock_service_unittest_chromeos.cc
diff --git a/chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc b/chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc
index c5b341872e628e11e8e7f64a2c0ef7b8a534ac80..8c8ccaa9714fb8906960b1938003bd4669250d9a 100644
--- a/chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc
+++ b/chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc
@@ -6,6 +6,7 @@
#include <string>
#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
#include "base/run_loop.h"
#include "base/values.h"
#include "chrome/browser/chromeos/login/users/mock_user_manager.h"
@@ -169,21 +170,22 @@ TestAppManagerFactory* app_manager_factory = NULL;
// EasyUnlockService factory function injected into testing profiles.
// It creates an EasyUnlockService with test AppManager.
-KeyedService* CreateEasyUnlockServiceForTest(content::BrowserContext* context) {
+scoped_ptr<KeyedService> CreateEasyUnlockServiceForTest(
+ content::BrowserContext* context) {
EXPECT_TRUE(app_manager_factory);
if (!app_manager_factory)
- return NULL;
+ return nullptr;
scoped_ptr<EasyUnlockAppManager> app_manager =
app_manager_factory->Create(context);
EXPECT_TRUE(app_manager.get());
if (!app_manager.get())
- return NULL;
+ return nullptr;
- EasyUnlockService* service =
- new EasyUnlockServiceRegular(Profile::FromBrowserContext(context));
+ scoped_ptr<EasyUnlockServiceRegular> service(
+ new EasyUnlockServiceRegular(Profile::FromBrowserContext(context)));
service->Initialize(app_manager.Pass());
- return service;
+ return service.Pass();
}
class EasyUnlockServiceTest : public testing::Test {
« no previous file with comments | « chrome/browser/signin/easy_unlock_app_manager_unittest.cc ('k') | chrome/browser/signin/fake_account_tracker_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698