Chromium Code Reviews| 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 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1112 std::string submit = | 1112 std::string submit = |
| 1113 "document.getElementById('username').value = 'overwrite_me';" | 1113 "document.getElementById('username').value = 'overwrite_me';" |
| 1114 "document.getElementById('password').value = 'random';" | 1114 "document.getElementById('password').value = 'random';" |
| 1115 "document.getElementById('non-form-button').click();"; | 1115 "document.getElementById('non-form-button').click();"; |
| 1116 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), submit)); | 1116 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), submit)); |
| 1117 observer.Wait(); | 1117 observer.Wait(); |
| 1118 | 1118 |
| 1119 EXPECT_TRUE(prompt_observer->IsShowingPrompt()); | 1119 EXPECT_TRUE(prompt_observer->IsShowingPrompt()); |
| 1120 } | 1120 } |
| 1121 | 1121 |
| 1122 // Test that if login fails and content server pushes a different login form | |
| 1123 // with action URL having different scheme and/or case. Heuristic shall be able | |
|
vabr (Chromium)
2014/08/21 14:54:12
I'm actually not convinced that the action URL com
vabr (Chromium)
2014/08/21 14:54:12
The test below does not test the different scheme,
Pritam Nikam
2014/08/21 16:49:21
I didn't find any real example though, this partic
Pritam Nikam
2014/08/21 16:49:21
Seems it's quite difficult as we need http and htt
| |
| 1124 // identify such cases and *shall not* prompt to save incorrect password. | |
| 1125 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest, | |
| 1126 NoPromptForLoginFailedAndServerPushSeperateLoginForm) { | |
| 1127 NavigateToFile("/password/seperate_login_form.html"); | |
|
vabr (Chromium)
2014/08/21 14:54:12
typo: seperate -> separate
Please also correct in
Pritam Nikam
2014/08/21 16:49:21
Done.
| |
| 1128 | |
| 1129 NavigationObserver observer(WebContents()); | |
| 1130 scoped_ptr<PromptObserver> prompt_observer( | |
| 1131 PromptObserver::Create(WebContents())); | |
| 1132 std::string fill_and_submit = | |
| 1133 "document.getElementById('username_seperate').value = 'temp';" | |
| 1134 "document.getElementById('password_seperate').value = 'random';" | |
| 1135 "document.getElementById('submit_seperate').click();"; | |
| 1136 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit)); | |
| 1137 observer.Wait(); | |
| 1138 | |
| 1139 EXPECT_FALSE(prompt_observer->IsShowingPrompt()); | |
| 1140 } | |
| OLD | NEW |