summaryrefslogtreecommitdiffstats
path: root/chrome/test/testing_profile.h
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-18 00:09:55 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-18 00:09:55 +0000
commitea6f76577b2fc1b31bb84fa03c5491609dc0bdf3 (patch)
treec46a94cdbe9e13a504b2b9eb0f63d3b4dae1bb46 /chrome/test/testing_profile.h
parent5e324b7c50d5ec8bd2feb4ee6fe93bae82e82458 (diff)
downloadchromium_src-ea6f76577b2fc1b31bb84fa03c5491609dc0bdf3.zip
chromium_src-ea6f76577b2fc1b31bb84fa03c5491609dc0bdf3.tar.gz
chromium_src-ea6f76577b2fc1b31bb84fa03c5491609dc0bdf3.tar.bz2
Makes the tab restore service contain any windows that were open at
the time of a crash. BUG=5465 TEST=Bring up chrome, go to google.com. Wait a minute. Kill chrome via the task manager. Launch chrome again. Make sure the new tab page shows an entry named 'Window (g)' where g is Google's favicon. Review URL: http://codereview.chromium.org/14172 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7188 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/testing_profile.h')
-rw-r--r--chrome/test/testing_profile.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h
index 4973682..c99b51c 100644
--- a/chrome/test/testing_profile.h
+++ b/chrome/test/testing_profile.h
@@ -12,6 +12,7 @@
#include "chrome/browser/browser_prefs.h"
#include "chrome/browser/history/history.h"
#include "chrome/browser/profile.h"
+#include "chrome/browser/sessions/session_service.h"
#include "chrome/browser/template_url_model.h"
#include "chrome/common/pref_service.h"
@@ -107,13 +108,16 @@ class TestingProfile : public Profile {
virtual URLRequestContext* GetRequestContext() {
return NULL;
}
+ void set_session_service(SessionService* session_service) {
+ session_service_ = session_service;
+ }
virtual SessionService* GetSessionService() {
- return NULL;
+ return session_service_.get();
}
virtual void ShutdownSessionService() {
}
virtual bool HasSessionService() const {
- return false;
+ return (session_service_.get() != NULL);
}
virtual std::wstring GetName() {
return std::wstring();
@@ -126,8 +130,11 @@ class TestingProfile : public Profile {
virtual void SetID(const std::wstring& id) {
id_ = id;
}
+ void set_last_session_exited_cleanly(bool value) {
+ last_session_exited_cleanly_ = value;
+ }
virtual bool DidLastSessionExitCleanly() {
- return true;
+ return last_session_exited_cleanly_;
}
virtual void MergeResourceString(int message_id,
std::wstring* output_string) {
@@ -185,6 +192,9 @@ class TestingProfile : public Profile {
// The TemplateURLFetcher. Only created if CreateTemplateURLModel is invoked.
scoped_ptr<TemplateURLModel> template_url_model_;
+ // The SessionService. Defaults to NULL, but can be set using the setter.
+ scoped_refptr<SessionService> session_service_;
+
// Do we have a history service? This defaults to the value of
// history_service, but can be explicitly set.
bool has_history_service_;
@@ -192,6 +202,9 @@ class TestingProfile : public Profile {
std::wstring id_;
bool off_the_record_;
+
+ // Did the last session exit cleanly? Default is true.
+ bool last_session_exited_cleanly_;
};
#endif // CHROME_TEST_TESTING_PROFILE_H__