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 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 std::string fill = | 1008 std::string fill = |
1009 "document.getElementById('username_redirect').value = 'temp';" | 1009 "document.getElementById('username_redirect').value = 'temp';" |
1010 "document.getElementById('password_redirect').value = 'random';"; | 1010 "document.getElementById('password_redirect').value = 'random';"; |
1011 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill)); | 1011 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill)); |
1012 | 1012 |
1013 NavigationObserver observer(WebContents()); | 1013 NavigationObserver observer(WebContents()); |
1014 scoped_ptr<PromptObserver> prompt_observer( | 1014 scoped_ptr<PromptObserver> prompt_observer( |
1015 PromptObserver::Create(WebContents())); | 1015 PromptObserver::Create(WebContents())); |
1016 GURL url = embedded_test_server()->GetURL("/password/password_form.html"); | 1016 GURL url = embedded_test_server()->GetURL("/password/password_form.html"); |
1017 chrome::NavigateParams params(browser(), url, | 1017 chrome::NavigateParams params(browser(), url, |
1018 content::PAGE_TRANSITION_RELOAD); | 1018 ui::PAGE_TRANSITION_RELOAD); |
1019 ui_test_utils::NavigateToURL(¶ms); | 1019 ui_test_utils::NavigateToURL(¶ms); |
1020 observer.Wait(); | 1020 observer.Wait(); |
1021 EXPECT_FALSE(prompt_observer->IsShowingPrompt()); | 1021 EXPECT_FALSE(prompt_observer->IsShowingPrompt()); |
1022 } | 1022 } |
1023 | 1023 |
1024 // Test that if a form gets dynamically added between the form parsing and | 1024 // Test that if a form gets dynamically added between the form parsing and |
1025 // rendering, and while the main frame still loads, it still is registered, and | 1025 // rendering, and while the main frame still loads, it still is registered, and |
1026 // thus saving passwords from it works. | 1026 // thus saving passwords from it works. |
1027 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest, | 1027 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest, |
1028 FormsAddedBetweenParsingAndRendering) { | 1028 FormsAddedBetweenParsingAndRendering) { |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 NavigationObserver observer(WebContents()); | 1172 NavigationObserver observer(WebContents()); |
1173 scoped_ptr<PromptObserver> prompt_observer( | 1173 scoped_ptr<PromptObserver> prompt_observer( |
1174 PromptObserver::Create(WebContents())); | 1174 PromptObserver::Create(WebContents())); |
1175 ui_test_utils::NavigateToURL(browser(), https_url); | 1175 ui_test_utils::NavigateToURL(browser(), https_url); |
1176 | 1176 |
1177 observer.SetPathToWaitFor("/password/done_and_separate_login_form.html"); | 1177 observer.SetPathToWaitFor("/password/done_and_separate_login_form.html"); |
1178 observer.Wait(); | 1178 observer.Wait(); |
1179 | 1179 |
1180 EXPECT_FALSE(prompt_observer->IsShowingPrompt()); | 1180 EXPECT_FALSE(prompt_observer->IsShowingPrompt()); |
1181 } | 1181 } |
OLD | NEW |