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

Unified Diff: chrome/browser/password_manager/password_manager_browsertest.cc

Issue 1286593003: [Password Manager] Store forms with field name and id attributes missing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed mac bot failure. Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/autofill/content/renderer/password_form_conversion_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/password_manager_browsertest.cc
diff --git a/chrome/browser/password_manager/password_manager_browsertest.cc b/chrome/browser/password_manager/password_manager_browsertest.cc
index 6cd24946f0a59b8d0f19edda16ce8966aad46b42..7bf317bbe814f64bba14237a163d31e56e606eb1 100644
--- a/chrome/browser/password_manager/password_manager_browsertest.cc
+++ b/chrome/browser/password_manager/password_manager_browsertest.cc
@@ -897,8 +897,8 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
- NoPromptForInputElementWithoutIdAndName) {
- // Check that no prompt is shown for forms where the input fields lack both
+ PromptForInputElementWithoutIdAndName) {
+ // Check that prompt is shown for forms where the input fields lack both
// the "id" and the "name" attributes.
NavigateToFile("/password/password_form.html");
@@ -914,7 +914,26 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"form.children[2].click()"; // form.children[2] is the submit button.
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingPrompt());
+ EXPECT_TRUE(prompt_observer->IsShowingPrompt());
+ prompt_observer->Accept();
+
+ // Check that credentials are stored.
+ scoped_refptr<password_manager::TestPasswordStore> password_store =
+ static_cast<password_manager::TestPasswordStore*>(
+ PasswordStoreFactory::GetForProfile(
+ browser()->profile(), ServiceAccessType::IMPLICIT_ACCESS)
+ .get());
+
+ // Spin the message loop to make sure the password store had a chance to save
+ // the password.
+ base::RunLoop run_loop;
+ run_loop.RunUntilIdle();
+ EXPECT_FALSE(password_store->IsEmpty());
+
+#if !defined(OS_MACOSX)
+ CheckThatCredentialsStored(password_store.get(), base::ASCIIToUTF16("temp"),
+ base::ASCIIToUTF16("random"));
+#endif
}
// Test for checking that no prompt is shown for URLs with file: scheme.
« no previous file with comments | « no previous file | components/autofill/content/renderer/password_form_conversion_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698