| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PASSWORD_FORM_DATA_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_DATA_H_ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_DATA_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_DATA_H_ |
| 7 | 7 |
| 8 #include <ostream> | 8 #include <ostream> |
| 9 | 9 |
| 10 #include "components/autofill/core/common/password_form.h" | 10 #include "components/autofill/core/common/password_form.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 | 12 |
| 13 // TODO(sync): This file must eventually be refactored away -- crbug.com/87185. |
| 14 |
| 13 // Struct used for creation of PasswordForms from static arrays of data. | 15 // Struct used for creation of PasswordForms from static arrays of data. |
| 14 // Note: This is only meant to be used in unit test. | 16 // Note: This is only meant to be used in unit test. |
| 15 struct PasswordFormData { | 17 struct PasswordFormData { |
| 16 const autofill::PasswordForm::Scheme scheme; | 18 const autofill::PasswordForm::Scheme scheme; |
| 17 const char* signon_realm; | 19 const char* signon_realm; |
| 18 const char* origin; | 20 const char* origin; |
| 19 const char* action; | 21 const char* action; |
| 20 const wchar_t* submit_element; | 22 const wchar_t* submit_element; |
| 21 const wchar_t* username_element; | 23 const wchar_t* username_element; |
| 22 const wchar_t* password_element; | 24 const wchar_t* password_element; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 35 // Checks whether two vectors of PasswordForms contain equivalent elements, | 37 // Checks whether two vectors of PasswordForms contain equivalent elements, |
| 36 // regardless of order. | 38 // regardless of order. |
| 37 bool ContainsSamePasswordFormsPtr( | 39 bool ContainsSamePasswordFormsPtr( |
| 38 const std::vector<autofill::PasswordForm*>& first, | 40 const std::vector<autofill::PasswordForm*>& first, |
| 39 const std::vector<autofill::PasswordForm*>& second); | 41 const std::vector<autofill::PasswordForm*>& second); |
| 40 | 42 |
| 41 bool ContainsSamePasswordForms( | 43 bool ContainsSamePasswordForms( |
| 42 std::vector<autofill::PasswordForm>& first, | 44 std::vector<autofill::PasswordForm>& first, |
| 43 std::vector<autofill::PasswordForm>& second); | 45 std::vector<autofill::PasswordForm>& second); |
| 44 | 46 |
| 45 // Pretty-prints the contents of a PasswordForm. | |
| 46 // TODO(sync): This file must eventually be refactored away -- crbug.com/87185. | |
| 47 std::ostream& operator<<(std::ostream& os, | |
| 48 const autofill::PasswordForm& form); | |
| 49 | |
| 50 // This gmock matcher is used to check that the |arg| contains exactly the same | 47 // This gmock matcher is used to check that the |arg| contains exactly the same |
| 51 // PasswordForms as |forms|, regardless of order. | 48 // PasswordForms as |forms|, regardless of order. |
| 52 MATCHER_P(ContainsAllPasswordForms, forms, "") { | 49 MATCHER_P(ContainsAllPasswordForms, forms, "") { |
| 53 return ContainsSamePasswordFormsPtr(forms, arg); | 50 return ContainsSamePasswordFormsPtr(forms, arg); |
| 54 } | 51 } |
| 55 | 52 |
| 56 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_DATA_H_ | 53 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_FORM_DATA_H_ |
| OLD | NEW |