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-08-11 16:40:57 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-11 16:40:57 +0000
commit4d0cd7ce8c91a2c0157ecf9e0a5153712ff43d10 (patch)
treeeff001f3129de849da6e8658d45072c2ccf494f6 /chrome/test/testing_profile.h
parent50f2f629605750f033ef3c766498e42783a785f6 (diff)
downloadchromium_src-4d0cd7ce8c91a2c0157ecf9e0a5153712ff43d10.zip
chromium_src-4d0cd7ce8c91a2c0157ecf9e0a5153712ff43d10.tar.gz
chromium_src-4d0cd7ce8c91a2c0157ecf9e0a5153712ff43d10.tar.bz2
A set of tests to exercise chrome menus as well as parts of bookmark
bar view. These are disabled until we straighten out the buildbot that is always logged in. BUG=1318922 TEST=this is just a bunch of tests. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@654 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/testing_profile.h')
-rw-r--r--chrome/test/testing_profile.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h
index ae6c356..f6b01b5 100644
--- a/chrome/test/testing_profile.h
+++ b/chrome/test/testing_profile.h
@@ -33,6 +33,7 @@
#include "base/base_paths.h"
#include "base/path_service.h"
#include "base/file_util.h"
+#include "chrome/browser/bookmark_bar_model.h"
#include "chrome/browser/browser_prefs.h"
#include "chrome/browser/history/history.h"
#include "chrome/browser/profile.h"
@@ -40,12 +41,16 @@
class TestingProfile : public Profile {
public:
- TestingProfile() : start_time_(Time::Now()) {}
+ TestingProfile() : start_time_(Time::Now()), has_history_service_(false) {}
virtual ~TestingProfile();
// Creates the HistoryService. Normally there is no HistoryService.
void CreateHistoryService();
+ // Creates the BookmkarBarModel. If not invoked the bookmark bar model is
+ // NULL.
+ void CreateBookmarkBarModel();
+
virtual std::wstring GetPath() {
return std::wstring();
}
@@ -64,8 +69,11 @@ class TestingProfile : public Profile {
virtual HistoryService* GetHistoryService(ServiceAccessType access) {
return history_service_.get();
}
+ void set_has_history_service(bool has_history_service) {
+ has_history_service_ = has_history_service;
+ }
virtual bool HasHistoryService() const {
- return (history_service_.get() != NULL);
+ return (history_service_.get() != NULL || has_history_service_);
}
virtual WebDataService* GetWebDataService(ServiceAccessType access) {
return NULL;
@@ -134,10 +142,10 @@ class TestingProfile : public Profile {
virtual void MergeResourceBoolean(int message_id, bool* output_value) {
}
virtual bool HasBookmarkBarModel() {
- return false;
+ return (bookmark_bar_model_.get() != NULL);
}
virtual BookmarkBarModel* GetBookmarkBarModel() {
- return NULL;
+ return bookmark_bar_model_.get();
}
virtual bool Profile::IsSameProfile(Profile *p) {
return this == p;
@@ -171,6 +179,13 @@ class TestingProfile : public Profile {
// The history service. Only created if CreateHistoryService is invoked.
scoped_refptr<HistoryService> history_service_;
+
+ // The BookmarkBarModel. Only created if CreateBookmarkBarModel is invoked.
+ scoped_ptr<BookmarkBarModel> bookmark_bar_model_;
+
+ // Do we have a history service? This defaults to the value of
+ // history_service, but can be explicitly set.
+ bool has_history_service_;
};
#endif // CHROME_TEST_TESTING_PROFILE_H__