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

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

Issue 2893633002: [Password Manager] Make filling robust against changing url by JavaScript (Closed)
Patch Set: Test added 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
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 2876 matching lines...) Expand 10 before | Expand all | Expand 10 after
2887 EXPECT_EQ(1, fake_driver_.called_check_safe_browsing_reputation_cnt()); 2887 EXPECT_EQ(1, fake_driver_.called_check_safe_browsing_reputation_cnt());
2888 2888
2889 // Navigate to another page and click on username field, 2889 // Navigate to another page and click on username field,
2890 // CheckSafeBrowsingReputation() should be triggered again. 2890 // CheckSafeBrowsingReputation() should be triggered again.
2891 LoadHTML(kFormHTML); 2891 LoadHTML(kFormHTML);
2892 SimulateElementClick(kUsernameName); 2892 SimulateElementClick(kUsernameName);
2893 base::RunLoop().RunUntilIdle(); 2893 base::RunLoop().RunUntilIdle();
2894 EXPECT_EQ(2, fake_driver_.called_check_safe_browsing_reputation_cnt()); 2894 EXPECT_EQ(2, fake_driver_.called_check_safe_browsing_reputation_cnt());
2895 } 2895 }
2896 #endif 2896 #endif
2897
2898 // Tests that the password login is autocompleted as expected when the browser
2899 // when JavaScript changes url.
kolos1 2017/05/18 09:52:52 Didn't understand the comment.
dvadym 2017/05/18 11:08:52 Updated comments
2900 TEST_F(PasswordAutofillAgentTest, AutocompleteWhenPageUrlIsChanged) {
2901 // Simulate that JavaScript changes url.
2902 fill_data_.origin = GURL(fill_data_.origin.possibly_invalid_spec() + "/path");
2903
2904 SimulateOnFillPasswordForm(fill_data_);
2905
2906 // The username and password should have been autocompleted.
2907 CheckTextFieldsState(kAliceUsername, true, kAlicePassword, true);
2908 }
2897 } // namespace autofill 2909 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698