| 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/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 918 chrome::NavigateParams params(browser(), url, | 918 chrome::NavigateParams params(browser(), url, |
| 919 content::PAGE_TRANSITION_RELOAD); | 919 content::PAGE_TRANSITION_RELOAD); |
| 920 ui_test_utils::NavigateToURL(¶ms); | 920 ui_test_utils::NavigateToURL(¶ms); |
| 921 observer.Wait(); | 921 observer.Wait(); |
| 922 if (ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled()) { | 922 if (ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled()) { |
| 923 EXPECT_FALSE(controller()->PasswordPendingUserDecision()); | 923 EXPECT_FALSE(controller()->PasswordPendingUserDecision()); |
| 924 } else { | 924 } else { |
| 925 EXPECT_FALSE(observer.infobar_shown()); | 925 EXPECT_FALSE(observer.infobar_shown()); |
| 926 } | 926 } |
| 927 } | 927 } |
| 928 |
| 929 // Test that if a form gets dynamically added between the form parsing and |
| 930 // rendering, and while the main frame still loads, it still is registered, and |
| 931 // thus saving passwords from it works. |
| 932 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest, |
| 933 FormsAddedBetweenParsingAndRendering) { |
| 934 NavigateToFile("/password/between_parsing_and_rendering.html"); |
| 935 |
| 936 NavigationObserver observer(WebContents()); |
| 937 std::string submit = |
| 938 "document.getElementById('username').value = 'temp';" |
| 939 "document.getElementById('password').value = 'random';" |
| 940 "document.getElementById('submit-button').click();"; |
| 941 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), submit)); |
| 942 observer.Wait(); |
| 943 |
| 944 if (ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled()) { |
| 945 EXPECT_TRUE(controller()->PasswordPendingUserDecision()); |
| 946 } else { |
| 947 EXPECT_TRUE(observer.infobar_shown()); |
| 948 } |
| 949 } |
| OLD | NEW |