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

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

Issue 2900713003: [Password Manager, merge to M-59] Make filling robust against changing url by JavaScript. (Closed)
Patch Set: fix merge Created 3 years, 7 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 2694 matching lines...) Expand 10 before | Expand all | Expand 10 after
2705 base::RunLoop().RunUntilIdle(); 2705 base::RunLoop().RunUntilIdle();
2706 2706
2707 // Chect that the form was submitted with in-page navigation. 2707 // Chect that the form was submitted with in-page navigation.
2708 EXPECT_TRUE(fake_driver_.called_inpage_navigation()); 2708 EXPECT_TRUE(fake_driver_.called_inpage_navigation());
2709 EXPECT_EQ(base::string16(), 2709 EXPECT_EQ(base::string16(),
2710 fake_driver_.password_form_inpage_navigation()->username_value); 2710 fake_driver_.password_form_inpage_navigation()->username_value);
2711 EXPECT_EQ(ASCIIToUTF16("random"), 2711 EXPECT_EQ(ASCIIToUTF16("random"),
2712 fake_driver_.password_form_inpage_navigation()->password_value); 2712 fake_driver_.password_form_inpage_navigation()->password_value);
2713 } 2713 }
2714 2714
2715 // Tests that username/password are autofilled when JavaScript is changing url
2716 // between discovering a form and receving credentials from the browser process.
2717 TEST_F(PasswordAutofillAgentTest, AutocompleteWhenPageUrlIsChanged) {
2718 // Simulate that JavaScript changes url.
2719 fill_data_.origin = GURL(fill_data_.origin.possibly_invalid_spec() + "/path");
2720
2721 SimulateOnFillPasswordForm(fill_data_);
2722
2723 // The username and password should have been autocompleted.
2724 CheckTextFieldsState(kAliceUsername, true, kAlicePassword, true);
2725 }
2715 } // namespace autofill 2726 } // 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