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/renderer/autofill/password_generation_test_utils.h" | 7 #include "chrome/renderer/autofill/password_generation_test_utils.h" |
8 #include "chrome/test/base/chrome_render_view_test.h" | 8 #include "chrome/test/base/chrome_render_view_test.h" |
9 #include "components/autofill/content/common/autofill_messages.h" | 9 #include "components/autofill/content/common/autofill_messages.h" |
10 #include "components/autofill/content/renderer/autofill_agent.h" | 10 #include "components/autofill/content/renderer/autofill_agent.h" |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 username_element_, kBobUsername, kCarolPassword)); | 994 username_element_, kBobUsername, kCarolPassword)); |
995 CheckTextFieldsDOMState(kBobUsername, true, kCarolPassword, true); | 995 CheckTextFieldsDOMState(kBobUsername, true, kCarolPassword, true); |
996 username_length = strlen(kBobUsername); | 996 username_length = strlen(kBobUsername); |
997 CheckUsernameSelection(username_length, username_length); | 997 CheckUsernameSelection(username_length, username_length); |
998 } | 998 } |
999 | 999 |
1000 // Tests that |PreviewSuggestion| properly previews the username and password. | 1000 // Tests that |PreviewSuggestion| properly previews the username and password. |
1001 TEST_F(PasswordAutofillAgentTest, PreviewSuggestion) { | 1001 TEST_F(PasswordAutofillAgentTest, PreviewSuggestion) { |
1002 // Simulate the browser sending the login info, but set |wait_for_username| | 1002 // Simulate the browser sending the login info, but set |wait_for_username| |
1003 // to prevent the form from being immediately filled. | 1003 // to prevent the form from being immediately filled. |
| 1004 size_t match_start = 0; |
1004 fill_data_.wait_for_username = true; | 1005 fill_data_.wait_for_username = true; |
1005 SimulateOnFillPasswordForm(fill_data_); | 1006 SimulateOnFillPasswordForm(fill_data_); |
1006 | 1007 |
1007 // Neither field should have been autocompleted. | 1008 // Neither field should have been autocompleted. |
1008 CheckTextFieldsDOMState(std::string(), false, std::string(), false); | 1009 CheckTextFieldsDOMState(std::string(), false, std::string(), false); |
1009 | 1010 |
1010 // If the password field is not autocompletable, it should not be affected. | 1011 // If the password field is not autocompletable, it should not be affected. |
1011 SetElementReadOnly(password_element_, true); | 1012 SetElementReadOnly(password_element_, true); |
1012 EXPECT_FALSE(password_autofill_agent_->PreviewSuggestion( | 1013 EXPECT_FALSE(password_autofill_agent_->PreviewSuggestion( |
1013 username_element_, kAliceUsername, kAlicePassword)); | 1014 username_element_, kAliceUsername, kAlicePassword, match_start)); |
1014 EXPECT_EQ(std::string(), username_element_.suggestedValue().utf8()); | 1015 EXPECT_EQ(std::string(), username_element_.suggestedValue().utf8()); |
1015 EXPECT_FALSE(username_element_.isAutofilled()); | 1016 EXPECT_FALSE(username_element_.isAutofilled()); |
1016 EXPECT_EQ(std::string(), password_element_.suggestedValue().utf8()); | 1017 EXPECT_EQ(std::string(), password_element_.suggestedValue().utf8()); |
1017 EXPECT_FALSE(password_element_.isAutofilled()); | 1018 EXPECT_FALSE(password_element_.isAutofilled()); |
1018 SetElementReadOnly(password_element_, false); | 1019 SetElementReadOnly(password_element_, false); |
1019 | 1020 |
1020 // After selecting the suggestion, both fields should be previewed | 1021 // After selecting the suggestion, both fields should be previewed |
1021 // with suggested values. | 1022 // with suggested values. |
1022 EXPECT_TRUE(password_autofill_agent_->PreviewSuggestion( | 1023 EXPECT_TRUE(password_autofill_agent_->PreviewSuggestion( |
1023 username_element_, kAliceUsername, kAlicePassword)); | 1024 username_element_, kAliceUsername, kAlicePassword, match_start)); |
1024 EXPECT_EQ( | 1025 EXPECT_EQ( |
1025 kAliceUsername, | 1026 kAliceUsername, |
1026 static_cast<std::string>(username_element_.suggestedValue().utf8())); | 1027 static_cast<std::string>(username_element_.suggestedValue().utf8())); |
1027 EXPECT_TRUE(username_element_.isAutofilled()); | 1028 EXPECT_TRUE(username_element_.isAutofilled()); |
1028 EXPECT_EQ( | 1029 EXPECT_EQ( |
1029 kAlicePassword, | 1030 kAlicePassword, |
1030 static_cast<std::string>(password_element_.suggestedValue().utf8())); | 1031 static_cast<std::string>(password_element_.suggestedValue().utf8())); |
1031 EXPECT_TRUE(password_element_.isAutofilled()); | 1032 EXPECT_TRUE(password_element_.isAutofilled()); |
1032 int username_length = strlen(kAliceUsername); | 1033 int username_length = strlen(kAliceUsername); |
1033 CheckUsernameSelection(0, username_length); | 1034 CheckUsernameSelection(0, username_length); |
1034 | 1035 |
1035 // Try previewing with a password different from the one that was initially | 1036 // Try previewing with a password different from the one that was initially |
1036 // sent to the renderer. | 1037 // sent to the renderer. |
1037 EXPECT_TRUE(password_autofill_agent_->PreviewSuggestion( | 1038 EXPECT_TRUE(password_autofill_agent_->PreviewSuggestion( |
1038 username_element_, kBobUsername, kCarolPassword)); | 1039 username_element_, kBobUsername, kCarolPassword, match_start)); |
1039 EXPECT_EQ( | 1040 EXPECT_EQ( |
1040 kBobUsername, | 1041 kBobUsername, |
1041 static_cast<std::string>(username_element_.suggestedValue().utf8())); | 1042 static_cast<std::string>(username_element_.suggestedValue().utf8())); |
1042 EXPECT_TRUE(username_element_.isAutofilled()); | 1043 EXPECT_TRUE(username_element_.isAutofilled()); |
1043 EXPECT_EQ( | 1044 EXPECT_EQ( |
1044 kCarolPassword, | 1045 kCarolPassword, |
1045 static_cast<std::string>(password_element_.suggestedValue().utf8())); | 1046 static_cast<std::string>(password_element_.suggestedValue().utf8())); |
1046 EXPECT_TRUE(password_element_.isAutofilled()); | 1047 EXPECT_TRUE(password_element_.isAutofilled()); |
1047 username_length = strlen(kBobUsername); | 1048 username_length = strlen(kBobUsername); |
1048 CheckUsernameSelection(0, username_length); | 1049 CheckUsernameSelection(0, username_length); |
1049 } | 1050 } |
1050 | 1051 |
1051 // Tests that |PreviewSuggestion| properly sets the username selection range. | 1052 // Tests that |PreviewSuggestion| properly sets the username selection range. |
1052 TEST_F(PasswordAutofillAgentTest, PreviewSuggestionSelectionRange) { | 1053 TEST_F(PasswordAutofillAgentTest, PreviewSuggestionSelectionRange) { |
| 1054 size_t match_start = 0; |
1053 username_element_.setValue(WebString::fromUTF8("ali")); | 1055 username_element_.setValue(WebString::fromUTF8("ali")); |
1054 username_element_.setSelectionRange(3, 3); | 1056 username_element_.setSelectionRange(3, 3); |
1055 username_element_.setAutofilled(true); | 1057 username_element_.setAutofilled(true); |
1056 | 1058 |
1057 CheckTextFieldsDOMState("ali", true, std::string(), false); | 1059 CheckTextFieldsDOMState("ali", true, std::string(), false); |
1058 | 1060 |
1059 // Simulate the browser sending the login info, but set |wait_for_username| | 1061 // Simulate the browser sending the login info, but set |wait_for_username| |
1060 // to prevent the form from being immediately filled. | 1062 // to prevent the form from being immediately filled. |
1061 fill_data_.wait_for_username = true; | 1063 fill_data_.wait_for_username = true; |
1062 SimulateOnFillPasswordForm(fill_data_); | 1064 SimulateOnFillPasswordForm(fill_data_); |
1063 | 1065 |
1064 EXPECT_TRUE(password_autofill_agent_->PreviewSuggestion( | 1066 EXPECT_TRUE(password_autofill_agent_->PreviewSuggestion( |
1065 username_element_, kAliceUsername, kAlicePassword)); | 1067 username_element_, kAliceUsername, kAlicePassword, match_start)); |
1066 EXPECT_EQ( | 1068 EXPECT_EQ( |
1067 kAliceUsername, | 1069 kAliceUsername, |
1068 static_cast<std::string>(username_element_.suggestedValue().utf8())); | 1070 static_cast<std::string>(username_element_.suggestedValue().utf8())); |
1069 EXPECT_TRUE(username_element_.isAutofilled()); | 1071 EXPECT_TRUE(username_element_.isAutofilled()); |
1070 EXPECT_EQ( | 1072 EXPECT_EQ( |
1071 kAlicePassword, | 1073 kAlicePassword, |
1072 static_cast<std::string>(password_element_.suggestedValue().utf8())); | 1074 static_cast<std::string>(password_element_.suggestedValue().utf8())); |
1073 EXPECT_TRUE(password_element_.isAutofilled()); | 1075 EXPECT_TRUE(password_element_.isAutofilled()); |
1074 int username_length = strlen(kAliceUsername); | 1076 int username_length = strlen(kAliceUsername); |
1075 CheckUsernameSelection(3, username_length); | 1077 CheckUsernameSelection(3, username_length); |
1076 } | 1078 } |
1077 | 1079 |
1078 // Tests that |ClearPreview| properly clears previewed username and password | 1080 // Tests that |ClearPreview| properly clears previewed username and password |
1079 // with password being previously autofilled. | 1081 // with password being previously autofilled. |
1080 TEST_F(PasswordAutofillAgentTest, ClearPreviewWithPasswordAutofilled) { | 1082 TEST_F(PasswordAutofillAgentTest, ClearPreviewWithPasswordAutofilled) { |
| 1083 size_t match_start = 0; |
1081 password_element_.setValue(WebString::fromUTF8("sec")); | 1084 password_element_.setValue(WebString::fromUTF8("sec")); |
1082 password_element_.setAutofilled(true); | 1085 password_element_.setAutofilled(true); |
1083 | 1086 |
1084 // Simulate the browser sending the login info, but set |wait_for_username| | 1087 // Simulate the browser sending the login info, but set |wait_for_username| |
1085 // to prevent the form from being immediately filled. | 1088 // to prevent the form from being immediately filled. |
1086 fill_data_.wait_for_username = true; | 1089 fill_data_.wait_for_username = true; |
1087 SimulateOnFillPasswordForm(fill_data_); | 1090 SimulateOnFillPasswordForm(fill_data_); |
1088 | 1091 |
1089 CheckTextFieldsDOMState(std::string(), false, "sec", true); | 1092 CheckTextFieldsDOMState(std::string(), false, "sec", true); |
1090 | 1093 |
1091 EXPECT_TRUE(password_autofill_agent_->PreviewSuggestion( | 1094 EXPECT_TRUE(password_autofill_agent_->PreviewSuggestion( |
1092 username_element_, kAliceUsername, kAlicePassword)); | 1095 username_element_, kAliceUsername, kAlicePassword, match_start)); |
1093 | 1096 |
1094 EXPECT_TRUE( | 1097 EXPECT_TRUE( |
1095 password_autofill_agent_->DidClearAutofillSelection(username_element_)); | 1098 password_autofill_agent_->DidClearAutofillSelection(username_element_)); |
1096 | 1099 |
1097 EXPECT_TRUE(username_element_.value().isEmpty()); | 1100 EXPECT_TRUE(username_element_.value().isEmpty()); |
1098 EXPECT_TRUE(username_element_.suggestedValue().isEmpty()); | 1101 EXPECT_TRUE(username_element_.suggestedValue().isEmpty()); |
1099 EXPECT_FALSE(username_element_.isAutofilled()); | 1102 EXPECT_FALSE(username_element_.isAutofilled()); |
1100 EXPECT_EQ(ASCIIToUTF16("sec"), password_element_.value()); | 1103 EXPECT_EQ(ASCIIToUTF16("sec"), password_element_.value()); |
1101 EXPECT_TRUE(password_element_.suggestedValue().isEmpty()); | 1104 EXPECT_TRUE(password_element_.suggestedValue().isEmpty()); |
1102 EXPECT_TRUE(password_element_.isAutofilled()); | 1105 EXPECT_TRUE(password_element_.isAutofilled()); |
1103 CheckUsernameSelection(0, 0); | 1106 CheckUsernameSelection(0, 0); |
1104 } | 1107 } |
1105 | 1108 |
1106 // Tests that |ClearPreview| properly clears previewed username and password | 1109 // Tests that |ClearPreview| properly clears previewed username and password |
1107 // with username being previously autofilled. | 1110 // with username being previously autofilled. |
1108 TEST_F(PasswordAutofillAgentTest, ClearPreviewWithUsernameAutofilled) { | 1111 TEST_F(PasswordAutofillAgentTest, ClearPreviewWithUsernameAutofilled) { |
| 1112 size_t match_start = 0; |
1109 username_element_.setValue(WebString::fromUTF8("ali")); | 1113 username_element_.setValue(WebString::fromUTF8("ali")); |
1110 username_element_.setSelectionRange(3, 3); | 1114 username_element_.setSelectionRange(3, 3); |
1111 username_element_.setAutofilled(true); | 1115 username_element_.setAutofilled(true); |
1112 | 1116 |
1113 // Simulate the browser sending the login info, but set |wait_for_username| | 1117 // Simulate the browser sending the login info, but set |wait_for_username| |
1114 // to prevent the form from being immediately filled. | 1118 // to prevent the form from being immediately filled. |
1115 fill_data_.wait_for_username = true; | 1119 fill_data_.wait_for_username = true; |
1116 SimulateOnFillPasswordForm(fill_data_); | 1120 SimulateOnFillPasswordForm(fill_data_); |
1117 | 1121 |
1118 CheckTextFieldsDOMState("ali", true, std::string(), false); | 1122 CheckTextFieldsDOMState("ali", true, std::string(), false); |
1119 | 1123 |
1120 EXPECT_TRUE(password_autofill_agent_->PreviewSuggestion( | 1124 EXPECT_TRUE(password_autofill_agent_->PreviewSuggestion( |
1121 username_element_, kAliceUsername, kAlicePassword)); | 1125 username_element_, kAliceUsername, kAlicePassword, match_start)); |
1122 | 1126 |
1123 EXPECT_TRUE( | 1127 EXPECT_TRUE( |
1124 password_autofill_agent_->DidClearAutofillSelection(username_element_)); | 1128 password_autofill_agent_->DidClearAutofillSelection(username_element_)); |
1125 | 1129 |
1126 EXPECT_EQ(ASCIIToUTF16("ali"), username_element_.value()); | 1130 EXPECT_EQ(ASCIIToUTF16("ali"), username_element_.value()); |
1127 EXPECT_TRUE(username_element_.suggestedValue().isEmpty()); | 1131 EXPECT_TRUE(username_element_.suggestedValue().isEmpty()); |
1128 EXPECT_TRUE(username_element_.isAutofilled()); | 1132 EXPECT_TRUE(username_element_.isAutofilled()); |
1129 EXPECT_TRUE(password_element_.value().isEmpty()); | 1133 EXPECT_TRUE(password_element_.value().isEmpty()); |
1130 EXPECT_TRUE(password_element_.suggestedValue().isEmpty()); | 1134 EXPECT_TRUE(password_element_.suggestedValue().isEmpty()); |
1131 EXPECT_FALSE(password_element_.isAutofilled()); | 1135 EXPECT_FALSE(password_element_.isAutofilled()); |
1132 CheckUsernameSelection(3, 3); | 1136 CheckUsernameSelection(3, 3); |
1133 } | 1137 } |
1134 | 1138 |
1135 // Tests that |ClearPreview| properly clears previewed username and password | 1139 // Tests that |ClearPreview| properly clears previewed username and password |
1136 // with username and password being previously autofilled. | 1140 // with username and password being previously autofilled. |
1137 TEST_F(PasswordAutofillAgentTest, | 1141 TEST_F(PasswordAutofillAgentTest, |
1138 ClearPreviewWithAutofilledUsernameAndPassword) { | 1142 ClearPreviewWithAutofilledUsernameAndPassword) { |
| 1143 size_t match_start = 0; |
1139 username_element_.setValue(WebString::fromUTF8("ali")); | 1144 username_element_.setValue(WebString::fromUTF8("ali")); |
1140 username_element_.setSelectionRange(3, 3); | 1145 username_element_.setSelectionRange(3, 3); |
1141 username_element_.setAutofilled(true); | 1146 username_element_.setAutofilled(true); |
1142 password_element_.setValue(WebString::fromUTF8("sec")); | 1147 password_element_.setValue(WebString::fromUTF8("sec")); |
1143 password_element_.setAutofilled(true); | 1148 password_element_.setAutofilled(true); |
1144 | 1149 |
1145 // Simulate the browser sending the login info, but set |wait_for_username| | 1150 // Simulate the browser sending the login info, but set |wait_for_username| |
1146 // to prevent the form from being immediately filled. | 1151 // to prevent the form from being immediately filled. |
1147 fill_data_.wait_for_username = true; | 1152 fill_data_.wait_for_username = true; |
1148 SimulateOnFillPasswordForm(fill_data_); | 1153 SimulateOnFillPasswordForm(fill_data_); |
1149 | 1154 |
1150 CheckTextFieldsDOMState("ali", true, "sec", true); | 1155 CheckTextFieldsDOMState("ali", true, "sec", true); |
1151 | 1156 |
1152 EXPECT_TRUE(password_autofill_agent_->PreviewSuggestion( | 1157 EXPECT_TRUE(password_autofill_agent_->PreviewSuggestion( |
1153 username_element_, kAliceUsername, kAlicePassword)); | 1158 username_element_, kAliceUsername, kAlicePassword, match_start)); |
1154 | 1159 |
1155 EXPECT_TRUE( | 1160 EXPECT_TRUE( |
1156 password_autofill_agent_->DidClearAutofillSelection(username_element_)); | 1161 password_autofill_agent_->DidClearAutofillSelection(username_element_)); |
1157 | 1162 |
1158 EXPECT_EQ(ASCIIToUTF16("ali"), username_element_.value()); | 1163 EXPECT_EQ(ASCIIToUTF16("ali"), username_element_.value()); |
1159 EXPECT_TRUE(username_element_.suggestedValue().isEmpty()); | 1164 EXPECT_TRUE(username_element_.suggestedValue().isEmpty()); |
1160 EXPECT_TRUE(username_element_.isAutofilled()); | 1165 EXPECT_TRUE(username_element_.isAutofilled()); |
1161 EXPECT_EQ(ASCIIToUTF16("sec"), password_element_.value()); | 1166 EXPECT_EQ(ASCIIToUTF16("sec"), password_element_.value()); |
1162 EXPECT_TRUE(password_element_.suggestedValue().isEmpty()); | 1167 EXPECT_TRUE(password_element_.suggestedValue().isEmpty()); |
1163 EXPECT_TRUE(password_element_.isAutofilled()); | 1168 EXPECT_TRUE(password_element_.isAutofilled()); |
1164 CheckUsernameSelection(3, 3); | 1169 CheckUsernameSelection(3, 3); |
1165 } | 1170 } |
1166 | 1171 |
1167 // Tests that |ClearPreview| properly clears previewed username and password | 1172 // Tests that |ClearPreview| properly clears previewed username and password |
1168 // with neither username nor password being previously autofilled. | 1173 // with neither username nor password being previously autofilled. |
1169 TEST_F(PasswordAutofillAgentTest, | 1174 TEST_F(PasswordAutofillAgentTest, |
1170 ClearPreviewWithNotAutofilledUsernameAndPassword) { | 1175 ClearPreviewWithNotAutofilledUsernameAndPassword) { |
1171 // Simulate the browser sending the login info, but set |wait_for_username| | 1176 // Simulate the browser sending the login info, but set |wait_for_username| |
1172 // to prevent the form from being immediately filled. | 1177 // to prevent the form from being immediately filled. |
| 1178 size_t match_start = 0; |
1173 fill_data_.wait_for_username = true; | 1179 fill_data_.wait_for_username = true; |
1174 SimulateOnFillPasswordForm(fill_data_); | 1180 SimulateOnFillPasswordForm(fill_data_); |
1175 | 1181 |
1176 CheckTextFieldsDOMState(std::string(), false, std::string(), false); | 1182 CheckTextFieldsDOMState(std::string(), false, std::string(), false); |
1177 | 1183 |
1178 EXPECT_TRUE(password_autofill_agent_->PreviewSuggestion( | 1184 EXPECT_TRUE(password_autofill_agent_->PreviewSuggestion( |
1179 username_element_, kAliceUsername, kAlicePassword)); | 1185 username_element_, kAliceUsername, kAlicePassword, match_start)); |
1180 | 1186 |
1181 EXPECT_TRUE( | 1187 EXPECT_TRUE( |
1182 password_autofill_agent_->DidClearAutofillSelection(username_element_)); | 1188 password_autofill_agent_->DidClearAutofillSelection(username_element_)); |
1183 | 1189 |
1184 EXPECT_TRUE(username_element_.value().isEmpty()); | 1190 EXPECT_TRUE(username_element_.value().isEmpty()); |
1185 EXPECT_TRUE(username_element_.suggestedValue().isEmpty()); | 1191 EXPECT_TRUE(username_element_.suggestedValue().isEmpty()); |
1186 EXPECT_FALSE(username_element_.isAutofilled()); | 1192 EXPECT_FALSE(username_element_.isAutofilled()); |
1187 EXPECT_TRUE(password_element_.value().isEmpty()); | 1193 EXPECT_TRUE(password_element_.value().isEmpty()); |
1188 EXPECT_TRUE(password_element_.suggestedValue().isEmpty()); | 1194 EXPECT_TRUE(password_element_.suggestedValue().isEmpty()); |
1189 EXPECT_FALSE(password_element_.isAutofilled()); | 1195 EXPECT_FALSE(password_element_.isAutofilled()); |
(...skipping 10 matching lines...) Expand all Loading... |
1200 ClearUsernameAndPasswordFields(); | 1206 ClearUsernameAndPasswordFields(); |
1201 | 1207 |
1202 // Simulate the user typing in the first letter of 'alice', a stored username. | 1208 // Simulate the user typing in the first letter of 'alice', a stored username. |
1203 SimulateUsernameChange("a"); | 1209 SimulateUsernameChange("a"); |
1204 // Both the username and password text fields should reflect selection of the | 1210 // Both the username and password text fields should reflect selection of the |
1205 // stored login. | 1211 // stored login. |
1206 CheckTextFieldsDOMState(kAliceUsername, true, kAlicePassword, true); | 1212 CheckTextFieldsDOMState(kAliceUsername, true, kAlicePassword, true); |
1207 // The selection should have been set to 'lice', the last 4 letters. | 1213 // The selection should have been set to 'lice', the last 4 letters. |
1208 CheckUsernameSelection(1, 5); | 1214 CheckUsernameSelection(1, 5); |
1209 | 1215 |
| 1216 size_t match_start = 0; |
1210 EXPECT_TRUE(password_autofill_agent_->PreviewSuggestion( | 1217 EXPECT_TRUE(password_autofill_agent_->PreviewSuggestion( |
1211 username_element_, "alicia", "secret")); | 1218 username_element_, "alicia", "secret", match_start)); |
1212 EXPECT_EQ( | 1219 EXPECT_EQ( |
1213 "alicia", | 1220 "alicia", |
1214 static_cast<std::string>(username_element_.suggestedValue().utf8())); | 1221 static_cast<std::string>(username_element_.suggestedValue().utf8())); |
1215 EXPECT_TRUE(username_element_.isAutofilled()); | 1222 EXPECT_TRUE(username_element_.isAutofilled()); |
1216 EXPECT_EQ( | 1223 EXPECT_EQ( |
1217 "secret", | 1224 "secret", |
1218 static_cast<std::string>(password_element_.suggestedValue().utf8())); | 1225 static_cast<std::string>(password_element_.suggestedValue().utf8())); |
1219 EXPECT_TRUE(password_element_.isAutofilled()); | 1226 EXPECT_TRUE(password_element_.isAutofilled()); |
1220 CheckUsernameSelection(1, 6); | 1227 CheckUsernameSelection(1, 6); |
1221 | 1228 |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2023 // Simulate a user clicking on the password element. This should produce no | 2030 // Simulate a user clicking on the password element. This should produce no |
2024 // message. | 2031 // message. |
2025 render_thread_->sink().ClearMessages(); | 2032 render_thread_->sink().ClearMessages(); |
2026 static_cast<PageClickListener*>(autofill_agent_) | 2033 static_cast<PageClickListener*>(autofill_agent_) |
2027 ->FormControlElementClicked(password_element_, false); | 2034 ->FormControlElementClicked(password_element_, false); |
2028 EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching( | 2035 EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching( |
2029 AutofillHostMsg_ShowPasswordSuggestions::ID)); | 2036 AutofillHostMsg_ShowPasswordSuggestions::ID)); |
2030 } | 2037 } |
2031 | 2038 |
2032 } // namespace autofill | 2039 } // namespace autofill |
OLD | NEW |