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 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 199 } | 199 } |
| 200 | 200 |
| 201 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, | 201 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, |
| 202 NoPromptIfFormReappearedInputOutsideFor) { | 202 NoPromptIfFormReappearedInputOutsideFor) { |
| 203 NavigateToFile("/password/failed_input_outside.html"); | 203 NavigateToFile("/password/failed_input_outside.html"); |
| 204 TestPromptNotShown("form with input outside", WebContents(), | 204 TestPromptNotShown("form with input outside", WebContents(), |
| 205 RenderViewHost()); | 205 RenderViewHost()); |
| 206 } | 206 } |
| 207 | 207 |
| 208 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, | 208 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, |
| 209 NoPromptIfPasswordFormManagerDestroyed) { | |
|
vabr (Chromium)
2016/07/27 14:06:49
Just a note: One thing I'm wary of here is that th
vasilii
2016/07/27 14:26:59
It's actually failing > 50% of the times on my mac
| |
| 210 NavigateToFile("/password/password_form.html"); | |
| 211 // Simulate the Credential Manager API essentially destroying all the | |
| 212 // PasswordFormManager instances. | |
| 213 ChromePasswordManagerClient::FromWebContents(WebContents()) | |
| 214 ->NotifyStorePasswordCalled(); | |
| 215 | |
| 216 // Fill a form and submit through a <input type="submit"> button. The renderer | |
| 217 // should not send "PasswordFormsParsed" messages after the page was loaded. | |
| 218 NavigationObserver observer(WebContents()); | |
| 219 std::string fill_and_submit = | |
| 220 "document.getElementById('username_field').value = 'temp';" | |
| 221 "document.getElementById('password_field').value = 'random';" | |
| 222 "document.getElementById('input_submit_button').click()"; | |
| 223 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit)); | |
| 224 observer.Wait(); | |
| 225 std::unique_ptr<BubbleObserver> prompt_observer( | |
| 226 new BubbleObserver(WebContents())); | |
| 227 EXPECT_FALSE(prompt_observer->IsShowingSavePrompt()); | |
| 228 } | |
| 229 | |
| 230 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, | |
| 209 PromptForSubmitWithInPageNavigation) { | 231 PromptForSubmitWithInPageNavigation) { |
| 210 NavigateToFile("/password/password_navigate_before_submit.html"); | 232 NavigateToFile("/password/password_navigate_before_submit.html"); |
| 211 | 233 |
| 212 // Fill a form and submit through a <input type="submit"> button. Nothing | 234 // Fill a form and submit through a <input type="submit"> button. Nothing |
| 213 // special. The form does an in-page navigation before submitting. | 235 // special. The form does an in-page navigation before submitting. |
| 214 NavigationObserver observer(WebContents()); | 236 NavigationObserver observer(WebContents()); |
| 215 std::unique_ptr<BubbleObserver> prompt_observer( | 237 std::unique_ptr<BubbleObserver> prompt_observer( |
| 216 new BubbleObserver(WebContents())); | 238 new BubbleObserver(WebContents())); |
| 217 std::string fill_and_submit = | 239 std::string fill_and_submit = |
| 218 "document.getElementById('username_field').value = 'temp';" | 240 "document.getElementById('username_field').value = 'temp';" |
| (...skipping 2806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3025 // about all frames, not just the main one. The factories should receive | 3047 // about all frames, not just the main one. The factories should receive |
| 3026 // messages for non-main frames, in particular | 3048 // messages for non-main frames, in particular |
| 3027 // AutofillHostMsg_PasswordFormsParsed. If that were the first time the | 3049 // AutofillHostMsg_PasswordFormsParsed. If that were the first time the |
| 3028 // factories hear about such frames, this would crash. | 3050 // factories hear about such frames, this would crash. |
| 3029 tab_strip_model->AddWebContents(detached_web_contents.release(), -1, | 3051 tab_strip_model->AddWebContents(detached_web_contents.release(), -1, |
| 3030 ::ui::PAGE_TRANSITION_AUTO_TOPLEVEL, | 3052 ::ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 3031 TabStripModel::ADD_ACTIVE); | 3053 TabStripModel::ADD_ACTIVE); |
| 3032 } | 3054 } |
| 3033 | 3055 |
| 3034 } // namespace password_manager | 3056 } // namespace password_manager |
| OLD | NEW |