Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Side by Side Diff: chrome/browser/password_manager/password_manager_browsertest.cc

Issue 343663002: PasswordManager: Add rendered forms to pending_login_managers_ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/test/data/password/between_parsing_and_rendering.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(&params); 920 ui_test_utils::NavigateToURL(&params);
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/password/between_parsing_and_rendering.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698