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

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: Rebase 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..737268302e9ae2514877b8a4d1bd0ed9df1974fa 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 scoped_ptr<KeyedService>();
sky 2015/06/08 20:18:49 nullptr (and 183).
Ilya Sherman 2015/06/08 22:11:43 Done.
scoped_ptr<EasyUnlockAppManager> app_manager =
app_manager_factory->Create(context);
EXPECT_TRUE(app_manager.get());
if (!app_manager.get())
- return NULL;
+ return scoped_ptr<KeyedService>();
- 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 {

Powered by Google App Engine
This is Rietveld 408576698