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

Unified Diff: chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_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/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc
diff --git a/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc b/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc
index b37f5fc7aae782f5ad384f18878fcf1dc5cb7323..422d36e5107c054dc8be7ddb1c56e664f0781e72 100644
--- a/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc
+++ b/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc
@@ -8,6 +8,7 @@
#include <vector>
#include "base/command_line.h"
+#include "base/memory/scoped_ptr.h"
#include "base/run_loop.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/sessions/persistent_tab_restore_service.h"
@@ -140,11 +141,10 @@ class RecentTabsSubMenuModelTest
content::RunAllBlockingPoolTasksUntilIdle();
}
- static KeyedService* GetTabRestoreService(
+ static scoped_ptr<KeyedService> GetTabRestoreService(
content::BrowserContext* browser_context) {
- // Ownership is tranfered to the profile.
- return new PersistentTabRestoreService(
- Profile::FromBrowserContext(browser_context), NULL);
+ return make_scoped_ptr(new PersistentTabRestoreService(
+ Profile::FromBrowserContext(browser_context), NULL));
}
browser_sync::OpenTabsUIDelegate* GetOpenTabsDelegate() {
@@ -258,7 +258,8 @@ TEST_F(RecentTabsSubMenuModelTest,
// Create a SessionService for the profile (profile owns the service) and add
// a window with a tab to this session.
SessionService* session_service = new SessionService(profile());
- SessionServiceFactory::SetForTestProfile(profile(), session_service);
+ SessionServiceFactory::SetForTestProfile(profile(),
+ make_scoped_ptr(session_service));
SessionID tab_id;
SessionID window_id;
session_service->SetWindowType(window_id,
« no previous file with comments | « chrome/browser/ui/tabs/pinned_tab_service_unittest.cc ('k') | chrome/browser/ui/views/bookmarks/bookmark_bar_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698