diff options
author | skrul@chromium.org <skrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-02 05:00:03 +0000 |
---|---|---|
committer | skrul@chromium.org <skrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-02 05:00:03 +0000 |
commit | 8a8ce8c0491c75486edd2865dd5801a91b3fcd86 (patch) | |
tree | bae0231707269fbe73ea8da0d2fa169ec1b0be0d /chrome/browser/webdata | |
parent | afd832cff8b5c78906b6208a3cd5d2305b17a54f (diff) | |
download | chromium_src-8a8ce8c0491c75486edd2865dd5801a91b3fcd86.zip chromium_src-8a8ce8c0491c75486edd2865dd5801a91b3fcd86.tar.gz chromium_src-8a8ce8c0491c75486edd2865dd5801a91b3fcd86.tar.bz2 |
Unit test for autofill sync.
Including some changes to make things testable, including adding WebDatabase* to the ctor of the MA and PC, plus making some methods virtual on WebDatabase.
Review URL: http://codereview.chromium.org/661316
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40359 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/webdata')
-rw-r--r-- | chrome/browser/webdata/web_data_service.h | 8 | ||||
-rw-r--r-- | chrome/browser/webdata/web_database.h | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/chrome/browser/webdata/web_data_service.h b/chrome/browser/webdata/web_data_service.h index c6887f4..004532a 100644 --- a/chrome/browser/webdata/web_data_service.h +++ b/chrome/browser/webdata/web_data_service.h @@ -448,10 +448,12 @@ class WebDataService void set_failed_init(bool value) { failed_init_ = value; } #endif - bool IsDatabaseLoaded(); - WebDatabase* GetDatabase(); + virtual bool IsDatabaseLoaded(); + virtual WebDatabase* GetDatabase(); protected: + virtual ~WebDataService(); + friend class TemplateURLModelTest; friend class TemplateURLModelTestingProfile; friend class WebDataServiceTest; @@ -480,8 +482,6 @@ class WebDataService typedef GenericRequest2<std::vector<const TemplateURL*>, std::vector<TemplateURL*> > SetKeywordsRequest; - ~WebDataService(); - // Invoked on the main thread if initializing the db fails. void DBInitFailed(sql::InitStatus init_status); diff --git a/chrome/browser/webdata/web_database.h b/chrome/browser/webdata/web_database.h index 6d1a99d..06727e9 100644 --- a/chrome/browser/webdata/web_database.h +++ b/chrome/browser/webdata/web_database.h @@ -44,7 +44,7 @@ struct IE7PasswordInfo; class WebDatabase { public: WebDatabase(); - ~WebDatabase(); + virtual ~WebDatabase(); // Initialize the database given a name. The name defines where the sqlite // file is. If this returns an error code, no other method should be called. @@ -201,20 +201,20 @@ class WebDatabase { bool RemoveFormElementForID(int64 pair_id); // Removes row from the autofill tables for the given |name| |value| pair. - bool RemoveFormElement(const string16& name, const string16& value); + virtual bool RemoveFormElement(const string16& name, const string16& value); // Retrieves all of the entries in the autofill table. - bool GetAllAutofillEntries(std::vector<AutofillEntry>* entries); + virtual bool GetAllAutofillEntries(std::vector<AutofillEntry>* entries); // Retrieves a single entry from the autofill table. - bool GetAutofillTimestamps(const string16& name, + virtual bool GetAutofillTimestamps(const string16& name, const string16& value, std::vector<base::Time>* timestamps); // Replaces existing autofill entries with the entries supplied in // the argument. If the entry does not already exist, it will be // added. - bool UpdateAutofillEntries(const std::vector<AutofillEntry>& entries); + virtual bool UpdateAutofillEntries(const std::vector<AutofillEntry>& entries); // Records a single AutoFill profile in the autofill_profiles table. bool AddAutoFillProfile(const AutoFillProfile& profile); |