OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/histogram_samples.h" | 8 #include "base/metrics/histogram_samples.h" |
9 #include "base/metrics/statistics_recorder.h" | 9 #include "base/metrics/statistics_recorder.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1076 ui_controller()->SavePassword(); | 1076 ui_controller()->SavePassword(); |
1077 } else { | 1077 } else { |
1078 EXPECT_TRUE(nav_observer.infobar_shown()); | 1078 EXPECT_TRUE(nav_observer.infobar_shown()); |
1079 } | 1079 } |
1080 // Spin the message loop to make sure the password store had a chance to save | 1080 // Spin the message loop to make sure the password store had a chance to save |
1081 // the password. | 1081 // the password. |
1082 base::RunLoop run_loop; | 1082 base::RunLoop run_loop; |
1083 run_loop.RunUntilIdle(); | 1083 run_loop.RunUntilIdle(); |
1084 EXPECT_FALSE(password_store->IsEmpty()); | 1084 EXPECT_FALSE(password_store->IsEmpty()); |
1085 } | 1085 } |
1086 | |
1087 // In some situations, multiple PasswordFormManager instances from | |
1088 // PasswordManager::pending_login_managers_ would match (via DoesManage) a form | |
1089 // to be provisionally saved. One of them might be a complete match, the other | |
1090 // all-but-action match. Normally, the former should be preferred, but if the | |
1091 // former did not finished matching, and the latter did, the latter should be | |
engedy
2014/07/11 17:05:35
nit: s/did/has/
vabr (Chromium)
2014/07/11 18:15:47
Done.
| |
1092 // used (otherwise we'd give up even though we could have saved the password). | |
1093 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest, | |
1094 TryToUsePasswordFormManagerWhichFinishedMatching) { | |
engedy
2014/07/11 17:05:35
nit: s/TryToUse/Prefer/
vabr (Chromium)
2014/07/11 18:15:47
Done.
| |
1095 NavigateToFile("/password/create_form_copy_on_submit.html"); | |
1096 | |
1097 NavigationObserver observer(WebContents()); | |
1098 std::string submit = | |
1099 "document.getElementById('username').value = 'overwrite_me';" | |
1100 "document.getElementById('password').value = 'random';" | |
1101 "document.getElementById('non-form-button').click();"; | |
1102 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), submit)); | |
1103 observer.Wait(); | |
1104 | |
1105 if (ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled()) { | |
1106 EXPECT_TRUE(ui_controller()->PasswordPendingUserDecision()); | |
1107 } else { | |
1108 EXPECT_TRUE(observer.infobar_shown()); | |
1109 } | |
1110 } | |
1111 | |
OLD | NEW |