| 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 #include "base/strings/string_util.h" | 5 #include "base/strings/string_util.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "chrome/test/base/chrome_render_view_test.h" | 7 #include "chrome/test/base/chrome_render_view_test.h" |
| 8 #include "components/autofill/common/autofill_messages.h" | 8 #include "components/autofill/common/autofill_messages.h" |
| 9 #include "components/autofill/common/form_data.h" | 9 #include "components/autofill/common/form_data.h" |
| 10 #include "components/autofill/common/form_field_data.h" | 10 #include "components/autofill/common/form_field_data.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 username_field.name = ASCIIToUTF16(kUsernameName); | 85 username_field.name = ASCIIToUTF16(kUsernameName); |
| 86 username_field.value = username1_; | 86 username_field.value = username1_; |
| 87 fill_data_.basic_data.fields.push_back(username_field); | 87 fill_data_.basic_data.fields.push_back(username_field); |
| 88 | 88 |
| 89 FormFieldData password_field; | 89 FormFieldData password_field; |
| 90 password_field.name = ASCIIToUTF16(kPasswordName); | 90 password_field.name = ASCIIToUTF16(kPasswordName); |
| 91 password_field.value = password1_; | 91 password_field.value = password1_; |
| 92 password_field.form_control_type = "password"; | 92 password_field.form_control_type = "password"; |
| 93 fill_data_.basic_data.fields.push_back(password_field); | 93 fill_data_.basic_data.fields.push_back(password_field); |
| 94 | 94 |
| 95 fill_data_.additional_logins[username2_] = password2_; | 95 PasswordAndRealm password2; |
| 96 fill_data_.additional_logins[username3_] = password3_; | 96 password2.password = password2_; |
| 97 fill_data_.additional_logins[username2_] = password2; |
| 98 PasswordAndRealm password3; |
| 99 password3.password = password3_; |
| 100 fill_data_.additional_logins[username3_] = password3; |
| 97 | 101 |
| 98 UsernamesCollectionKey key; | 102 UsernamesCollectionKey key; |
| 99 key.username = username3_; | 103 key.username = username3_; |
| 100 key.password = password3_; | 104 key.password = password3_; |
| 101 fill_data_.other_possible_usernames[key].push_back(alternate_username3_); | 105 fill_data_.other_possible_usernames[key].push_back(alternate_username3_); |
| 102 | 106 |
| 103 // We need to set the origin so it matches the frame URL and the action so | 107 // We need to set the origin so it matches the frame URL and the action so |
| 104 // it matches the form action, otherwise we won't autocomplete. | 108 // it matches the form action, otherwise we won't autocomplete. |
| 105 std::string origin("data:text/html;charset=utf-8,"); | 109 std::string origin("data:text/html;charset=utf-8,"); |
| 106 origin += kFormHTML; | 110 origin += kFormHTML; |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 // didSelectAutofillSuggestion on the renderer. | 500 // didSelectAutofillSuggestion on the renderer. |
| 497 autofill_agent_->didSelectAutofillSuggestion(username_element_, | 501 autofill_agent_->didSelectAutofillSuggestion(username_element_, |
| 498 ASCIIToUTF16(kAliceUsername), | 502 ASCIIToUTF16(kAliceUsername), |
| 499 WebKit::WebString(), | 503 WebKit::WebString(), |
| 500 0); | 504 0); |
| 501 // Autocomplete should not have kicked in. | 505 // Autocomplete should not have kicked in. |
| 502 CheckTextFieldsState(std::string(), false, std::string(), false); | 506 CheckTextFieldsState(std::string(), false, std::string(), false); |
| 503 } | 507 } |
| 504 | 508 |
| 505 } // namespace autofill | 509 } // namespace autofill |
| OLD | NEW |