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/string_util.h" | 5 #include "base/string_util.h" |
6 #include "base/utf_string_conversions.h" | 6 #include "base/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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 FormFieldData username_field; | 84 FormFieldData username_field; |
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 fill_data_.basic_data.fields.push_back(password_field); | 92 fill_data_.basic_data.fields.push_back(password_field); |
93 | 93 |
94 fill_data_.additional_logins[username2_] = password2_; | 94 PasswordAndRealm password2; |
95 fill_data_.additional_logins[username3_] = password3_; | 95 password2.password = password2_; |
| 96 fill_data_.additional_logins[username2_] = password2; |
| 97 PasswordAndRealm password3; |
| 98 password3.password = password3_; |
| 99 fill_data_.additional_logins[username3_] = password3; |
96 | 100 |
97 UsernamesCollectionKey key; | 101 UsernamesCollectionKey key; |
98 key.username = username3_; | 102 key.username = username3_; |
99 key.password = password3_; | 103 key.password = password3_; |
100 fill_data_.other_possible_usernames[key].push_back(alternate_username3_); | 104 fill_data_.other_possible_usernames[key].push_back(alternate_username3_); |
101 | 105 |
102 // We need to set the origin so it matches the frame URL and the action so | 106 // We need to set the origin so it matches the frame URL and the action so |
103 // it matches the form action, otherwise we won't autocomplete. | 107 // it matches the form action, otherwise we won't autocomplete. |
104 std::string origin("data:text/html;charset=utf-8,"); | 108 std::string origin("data:text/html;charset=utf-8,"); |
105 origin += kFormHTML; | 109 origin += kFormHTML; |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 // didSelectAutofillSuggestion on the renderer. | 433 // didSelectAutofillSuggestion on the renderer. |
430 autofill_agent_->didSelectAutofillSuggestion(username_element_, | 434 autofill_agent_->didSelectAutofillSuggestion(username_element_, |
431 ASCIIToUTF16(kAliceUsername), | 435 ASCIIToUTF16(kAliceUsername), |
432 WebKit::WebString(), | 436 WebKit::WebString(), |
433 0); | 437 0); |
434 // Autocomplete should not have kicked in. | 438 // Autocomplete should not have kicked in. |
435 CheckTextFieldsState(std::string(), false, std::string(), false); | 439 CheckTextFieldsState(std::string(), false, std::string(), false); |
436 } | 440 } |
437 | 441 |
438 } // namespace autofill | 442 } // namespace autofill |
OLD | NEW |