Home | History | Annotate | Download | only in password_manager
      1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_MOCK_PASSWORD_STORE_H_
      6 #define CHROME_BROWSER_PASSWORD_MANAGER_MOCK_PASSWORD_STORE_H_
      7 
      8 #include "chrome/browser/password_manager/password_store.h"
      9 #include "content/public/common/password_form.h"
     10 #include "testing/gmock/include/gmock/gmock.h"
     11 
     12 namespace content {
     13 class BrowserContext;
     14 }
     15 
     16 class MockPasswordStore : public PasswordStore {
     17  public:
     18   MockPasswordStore();
     19 
     20   static scoped_refptr<RefcountedBrowserContextKeyedService> Build(
     21       content::BrowserContext* profile);
     22 
     23   MOCK_METHOD1(RemoveLogin, void(const content::PasswordForm&));
     24   MOCK_METHOD2(GetLogins,
     25                CancelableTaskTracker::TaskId(const content::PasswordForm&,
     26                                              PasswordStoreConsumer*));
     27   MOCK_METHOD1(AddLogin, void(const content::PasswordForm&));
     28   MOCK_METHOD1(UpdateLogin, void(const content::PasswordForm&));
     29   MOCK_METHOD0(ReportMetrics, void());
     30   MOCK_METHOD0(ReportMetricsImpl, void());
     31   MOCK_METHOD1(AddLoginImpl, void(const content::PasswordForm&));
     32   MOCK_METHOD1(UpdateLoginImpl, void(const content::PasswordForm&));
     33   MOCK_METHOD1(RemoveLoginImpl, void(const content::PasswordForm&));
     34   MOCK_METHOD2(RemoveLoginsCreatedBetweenImpl, void(const base::Time&,
     35                const base::Time&));
     36   MOCK_METHOD2(GetLoginsImpl,
     37                void(const content::PasswordForm& form,
     38                     const ConsumerCallbackRunner& callback_runner));
     39   MOCK_METHOD1(GetAutofillableLoginsImpl, void(GetLoginsRequest*));
     40   MOCK_METHOD1(GetBlacklistLoginsImpl, void(GetLoginsRequest*));
     41   MOCK_METHOD1(FillAutofillableLogins,
     42       bool(std::vector<content::PasswordForm*>*));
     43   MOCK_METHOD1(FillBlacklistLogins,
     44       bool(std::vector<content::PasswordForm*>*));
     45 
     46   virtual void ShutdownOnUIThread();
     47 
     48  protected:
     49   virtual ~MockPasswordStore();
     50 };
     51 
     52 #endif  // CHROME_BROWSER_PASSWORD_MANAGER_MOCK_PASSWORD_STORE_H_
     53