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