#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_TEST_PASSWORD_STORE_H_
#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_TEST_PASSWORD_STORE_H_
#include <map>
#include <string>
#include <vector>
#include "base/memory/ref_counted.h"
#include "components/password_manager/core/browser/password_store.h"
namespace content {
class BrowserContext;
}
class TestPasswordStore : public PasswordStore {
public:
TestPasswordStore();
typedef std::map<std::string ,
std::vector<autofill::PasswordForm> > PasswordMap;
PasswordMap stored_passwords();
void Clear();
protected:
virtual ~TestPasswordStore();
bool FormsAreEquivalent(const autofill::PasswordForm& lhs,
const autofill::PasswordForm& rhs);
virtual PasswordStoreChangeList AddLoginImpl(
const autofill::PasswordForm& form) OVERRIDE;
virtual PasswordStoreChangeList UpdateLoginImpl(
const autofill::PasswordForm& form) OVERRIDE;
virtual PasswordStoreChangeList RemoveLoginImpl(
const autofill::PasswordForm& form) OVERRIDE;
virtual void GetLoginsImpl(
const autofill::PasswordForm& form,
PasswordStore::AuthorizationPromptPolicy prompt_policy,
const ConsumerCallbackRunner& runner) OVERRIDE;
virtual void WrapModificationTask(ModificationTask task) OVERRIDE;
virtual void ReportMetricsImpl() OVERRIDE {}
virtual PasswordStoreChangeList RemoveLoginsCreatedBetweenImpl(
const base::Time& begin, const base::Time& end) OVERRIDE;
virtual void GetAutofillableLoginsImpl(
PasswordStore::GetLoginsRequest* request) OVERRIDE {}
virtual void GetBlacklistLoginsImpl(
PasswordStore::GetLoginsRequest* request) OVERRIDE {}
virtual bool FillAutofillableLogins(
std::vector<autofill::PasswordForm*>* forms) OVERRIDE;
virtual bool FillBlacklistLogins(
std::vector<autofill::PasswordForm*>* forms) OVERRIDE;
private:
PasswordMap stored_passwords_;
DISALLOW_COPY_AND_ASSIGN(TestPasswordStore);
};
#endif