Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Side by Side Diff: chrome/renderer/autofill/password_autofill_agent_browsertest.cc

Issue 2716873002: More robust fill password fields on click. (Closed)
Patch Set: Update comment Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/autofill/content/renderer/password_autofill_agent.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "components/autofill/content/renderer/password_autofill_agent.h" 5 #include "components/autofill/content/renderer/password_autofill_agent.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 2498 matching lines...) Expand 10 before | Expand all | Expand 10 after
2509 expect_signature_for_field); 2509 expect_signature_for_field);
2510 if (expect_signature_for_field) { 2510 if (expect_signature_for_field) {
2511 EXPECT_EQ(field_element.getAttribute(field_signature_attribute), 2511 EXPECT_EQ(field_element.getAttribute(field_signature_attribute),
2512 blink::WebString::fromUTF8(base::Uint64ToString( 2512 blink::WebString::fromUTF8(base::Uint64ToString(
2513 CalculateFieldSignatureForField(form_data.fields[i])))); 2513 CalculateFieldSignatureForField(form_data.fields[i]))));
2514 } 2514 }
2515 } 2515 }
2516 } 2516 }
2517 } 2517 }
2518 2518
2519 // Tests that a suggestion dropdown is shown even if JavaScripts updated field
2520 // names.
2521 TEST_F(PasswordAutofillAgentTest, SuggestWhenJavaScriptUpdatesFieldNames) {
2522 // Simulate that JavaScript updated field names.
2523 auto fill_data = fill_data_;
2524 fill_data.username_field.name += ASCIIToUTF16("1");
2525 fill_data.password_field.name += ASCIIToUTF16("1");
2526 // Simulate the browser sending back the login info.
2527 SimulateOnFillPasswordForm(fill_data);
2528
2529 // Call SimulateElementClick() to produce a user gesture on the page so
2530 // autofill will actually fill.
2531 SimulateElementClick(kUsernameName);
2532
2533 // Simulate a user clicking on the password element. This should produce a
2534 // dropdown with suggestion of all available usernames.
2535 static_cast<PageClickListener*>(autofill_agent_)
2536 ->FormControlElementClicked(password_element_, false);
2537 CheckSuggestions("", false);
2538 }
2539
2519 } // namespace autofill 2540 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | components/autofill/content/renderer/password_autofill_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698