| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "base/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "components/autofill/core/browser/popup_item_ids.h" | 8 #include "components/autofill/core/browser/popup_item_ids.h" |
| 9 #include "components/autofill/core/browser/test_autofill_client.h" | 9 #include "components/autofill/core/browser/test_autofill_client.h" |
| 10 #include "components/autofill/core/browser/test_autofill_driver.h" | 10 #include "components/autofill/core/browser/test_autofill_driver.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 } // namespace | 67 } // namespace |
| 68 | 68 |
| 69 class PasswordAutofillManagerTest : public testing::Test { | 69 class PasswordAutofillManagerTest : public testing::Test { |
| 70 protected: | 70 protected: |
| 71 PasswordAutofillManagerTest() | 71 PasswordAutofillManagerTest() |
| 72 : test_username_(base::ASCIIToUTF16(kAliceUsername)), | 72 : test_username_(base::ASCIIToUTF16(kAliceUsername)), |
| 73 test_password_(base::ASCIIToUTF16(kAlicePassword)) {} | 73 test_password_(base::ASCIIToUTF16(kAlicePassword)) {} |
| 74 | 74 |
| 75 virtual void SetUp() override { | 75 void SetUp() override { |
| 76 // Add a preferred login and an additional login to the FillData. | 76 // Add a preferred login and an additional login to the FillData. |
| 77 username_field_.name = base::ASCIIToUTF16(kUsernameName); | 77 username_field_.name = base::ASCIIToUTF16(kUsernameName); |
| 78 username_field_.value = test_username_; | 78 username_field_.value = test_username_; |
| 79 fill_data_.basic_data.fields.push_back(username_field_); | 79 fill_data_.basic_data.fields.push_back(username_field_); |
| 80 | 80 |
| 81 autofill::FormFieldData password_field; | 81 autofill::FormFieldData password_field; |
| 82 password_field.name = base::ASCIIToUTF16(kPasswordName); | 82 password_field.name = base::ASCIIToUTF16(kPasswordName); |
| 83 password_field.value = test_password_; | 83 password_field.value = test_password_; |
| 84 fill_data_.basic_data.fields.push_back(password_field); | 84 fill_data_.basic_data.fields.push_back(password_field); |
| 85 } | 85 } |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 password_autofill_manager_->OnShowPasswordSuggestions( | 185 password_autofill_manager_->OnShowPasswordSuggestions( |
| 186 username_field_, element_bounds, suggestions, realms); | 186 username_field_, element_bounds, suggestions, realms); |
| 187 | 187 |
| 188 // Accepting a suggestion should trigger a call to hide the popup. | 188 // Accepting a suggestion should trigger a call to hide the popup. |
| 189 EXPECT_CALL(*autofill_client, HideAutofillPopup()); | 189 EXPECT_CALL(*autofill_client, HideAutofillPopup()); |
| 190 password_autofill_manager_->DidAcceptSuggestion( | 190 password_autofill_manager_->DidAcceptSuggestion( |
| 191 suggestions[0], autofill::POPUP_ITEM_ID_PASSWORD_ENTRY); | 191 suggestions[0], autofill::POPUP_ITEM_ID_PASSWORD_ENTRY); |
| 192 } | 192 } |
| 193 | 193 |
| 194 } // namespace password_manager | 194 } // namespace password_manager |
| OLD | NEW |