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

Unified Diff: content/browser/tab_contents/navigation_controller_unittest.cc

Issue 6901031: Profile shouldn't own Session/TabRestore services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again and hope upload works this time Created 9 years, 8 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
« no previous file with comments | « chrome/test/testing_profile.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tab_contents/navigation_controller_unittest.cc
diff --git a/content/browser/tab_contents/navigation_controller_unittest.cc b/content/browser/tab_contents/navigation_controller_unittest.cc
index 572118959ef7fb7e46c31c675b753602e02449a9..24b5c1d84dfe16b92e92df6d4099026fb1201616 100644
--- a/content/browser/tab_contents/navigation_controller_unittest.cc
+++ b/content/browser/tab_contents/navigation_controller_unittest.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/history/history.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/sessions/session_service.h"
+#include "chrome/browser/sessions/session_service_factory.h"
#include "chrome/browser/sessions/session_service_test_helper.h"
#include "chrome/browser/sessions/session_types.h"
#include "chrome/common/render_messages.h"
@@ -61,7 +62,7 @@ class NavigationControllerHistoryTest : public NavigationControllerTest {
// Force the session service to be created.
SessionService* service = new SessionService(profile());
- profile()->set_session_service(service);
+ SessionServiceFactory::SetForTestProfile(profile(), service);
service->SetWindowType(window_id, Browser::TYPE_NORMAL);
service->SetWindowBounds(window_id, gfx::Rect(0, 1, 2, 3), false);
service->SetTabIndexInWindow(window_id,
@@ -75,7 +76,7 @@ class NavigationControllerHistoryTest : public NavigationControllerTest {
// Release profile's reference to the session service. Otherwise the file
// will still be open and we won't be able to delete the directory below.
session_helper_.ReleaseService(); // profile owns this
- profile()->set_session_service(NULL);
+ SessionServiceFactory::SetForTestProfile(profile(), NULL);
// Make sure we wait for history to shut down before continuing. The task
// we add will cause our message loop to quit once it is destroyed.
@@ -97,17 +98,16 @@ class NavigationControllerHistoryTest : public NavigationControllerTest {
// shuts down the history database and reopens it.
void ReopenDatabase() {
session_helper_.set_service(NULL);
- profile()->set_session_service(NULL);
+ SessionServiceFactory::SetForTestProfile(profile(), NULL);
SessionService* service = new SessionService(profile());
- profile()->set_session_service(service);
+ SessionServiceFactory::SetForTestProfile(profile(), service);
session_helper_.set_service(service);
}
void GetLastSession() {
- profile()->GetSessionService()->TabClosed(controller().window_id(),
- controller().session_id(),
- false);
+ SessionServiceFactory::GetForProfile(profile())->TabClosed(
+ controller().window_id(), controller().session_id(), false);
ReopenDatabase();
Time close_time;
« no previous file with comments | « chrome/test/testing_profile.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698