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

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

Issue 2915763003: [Password Manager] Show omnibox icon and anchored prompt once user start typing password (Closed)
Patch Set: Introduced |has_generated_password| argument Created 3 years, 4 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
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 977950e9c1f887c9ca63d2734ea2532217c95a36..a1c68dd54f19b91b06f096e48a44a025e05d46c5 100644
--- a/chrome/browser/password_manager/password_manager_browsertest.cc
+++ b/chrome/browser/password_manager/password_manager_browsertest.cc
@@ -166,20 +166,6 @@ class ObservingAutofillClient
DISALLOW_COPY_AND_ASSIGN(ObservingAutofillClient);
};
-// For simplicity we assume that password store contains only 1 credential.
-void CheckThatCredentialsStored(
- password_manager::TestPasswordStore* password_store,
- const base::string16& username,
- const base::string16& password) {
- auto& passwords_map = password_store->stored_passwords();
- ASSERT_EQ(1u, passwords_map.size());
- auto& passwords_vector = passwords_map.begin()->second;
- ASSERT_EQ(1u, passwords_vector.size());
- const autofill::PasswordForm& form = passwords_vector[0];
- EXPECT_EQ(username, form.username_value);
- EXPECT_EQ(password, form.password_value);
-}
-
void TestPromptNotShown(const char* failure_message,
content::WebContents* web_contents,
content::RenderViewHost* rvh) {
@@ -193,7 +179,7 @@ void TestPromptNotShown(const char* failure_message,
ASSERT_TRUE(content::ExecuteScript(rvh, fill_and_submit));
observer.Wait();
- EXPECT_FALSE(BubbleObserver(web_contents).IsShowingSavePrompt());
+ EXPECT_FALSE(BubbleObserver(web_contents).WasSavePromptShown());
}
} // namespace
@@ -218,7 +204,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, PromptForNormalSubmit) {
// Save the password and check the store.
BubbleObserver bubble_observer(WebContents());
- EXPECT_TRUE(bubble_observer.IsShowingSavePrompt());
+ EXPECT_TRUE(bubble_observer.WasSavePromptShown());
bubble_observer.AcceptSavePrompt();
WaitForPasswordStore();
@@ -269,7 +255,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
observer.Wait();
std::unique_ptr<BubbleObserver> prompt_observer(
new BubbleObserver(WebContents()));
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -287,7 +273,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('input_submit_button').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -306,7 +292,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('submit_unrelated').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, LoginFailed) {
@@ -324,7 +310,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, LoginFailed) {
"document.getElementById('submit_failed').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, Redirects) {
@@ -340,7 +326,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, Redirects) {
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer1.Wait();
BubbleObserver bubble_observer(WebContents());
- EXPECT_TRUE(bubble_observer.IsShowingSavePrompt());
+ EXPECT_TRUE(bubble_observer.WasSavePromptShown());
// The redirection page now redirects via Javascript. We check that the
// bubble stays.
@@ -348,7 +334,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, Redirects) {
ASSERT_TRUE(content::ExecuteScriptWithoutUserGesture(
RenderFrameHost(), "window.location.href = 'done.html';"));
observer2.Wait();
- EXPECT_TRUE(bubble_observer.IsShowingSavePrompt());
+ EXPECT_TRUE(bubble_observer.WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -367,7 +353,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('submit_button').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, PromptForDynamicForm) {
@@ -408,7 +394,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, PromptForDynamicForm) {
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_TRUE(BubbleObserver(WebContents()).IsShowingSavePrompt());
+ EXPECT_TRUE(BubbleObserver(WebContents()).WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, NoPromptForNavigation) {
@@ -421,7 +407,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, NoPromptForNavigation) {
ASSERT_TRUE(content::ExecuteScriptWithoutUserGesture(
RenderFrameHost(), "window.location.href = 'done.html';"));
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -446,7 +432,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill));
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), navigate_frame));
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -472,7 +458,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), navigate_frame));
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(
@@ -492,7 +478,7 @@ IN_PROC_BROWSER_TEST_F(
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(
@@ -515,7 +501,7 @@ IN_PROC_BROWSER_TEST_F(
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.SetPathToWaitFor("/password/failed.html");
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, PromptForXHRSubmit) {
@@ -534,7 +520,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, PromptForXHRSubmit) {
"document.getElementById('submit_button').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -552,7 +538,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"send_xhr()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_navigate));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -573,7 +559,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"send_xhr()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_navigate));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -603,7 +589,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
break;
}
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -634,7 +620,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
break;
}
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -660,7 +646,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
break;
}
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(
@@ -687,7 +673,7 @@ IN_PROC_BROWSER_TEST_F(
break;
}
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, PromptForFetchSubmit) {
@@ -706,7 +692,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, PromptForFetchSubmit) {
"document.getElementById('submit_button').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -724,7 +710,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"send_fetch()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_navigate));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -745,7 +731,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"send_fetch()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_navigate));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -775,7 +761,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
break;
}
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -806,7 +792,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
break;
}
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(
@@ -833,7 +819,7 @@ IN_PROC_BROWSER_TEST_F(
break;
}
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(
@@ -860,7 +846,7 @@ IN_PROC_BROWSER_TEST_F(
break;
}
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, NoPromptIfLinkClicked) {
@@ -877,7 +863,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, NoPromptIfLinkClicked) {
"document.getElementById('link').click();";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_click_link));
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -903,7 +889,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
first_observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
prompt_observer->AcceptSavePrompt();
// Now navigate to a login form that has similar HTML markup.
@@ -927,7 +913,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('input_submit_button').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), submit_form));
second_observer.Wait();
- EXPECT_FALSE(second_prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(second_prompt_observer->WasSavePromptShown());
// Verify that we sent two pings to Autofill. One vote for of PASSWORD for
// the current form, and one vote for ACCOUNT_CREATION_PASSWORD on the
@@ -964,7 +950,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -982,7 +968,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('input_submit_button_no_name').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -1000,7 +986,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementsByName('input_submit_button_no_id')[0].click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -1021,7 +1007,7 @@ 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_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
prompt_observer->AcceptSavePrompt();
// Check that credentials are stored.
@@ -1053,7 +1039,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('input_submit_button').click();";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -1071,7 +1057,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('input_submit_button_http_error').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -1202,7 +1188,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
new BubbleObserver(WebContents()));
NavigateToFile("/password/done.html");
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -1220,7 +1206,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('input_submit_button').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -1237,7 +1223,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('input_submit_button').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
// Test fix for crbug.com/368690.
@@ -1256,7 +1242,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, NoPromptWhenReloading) {
chrome::NavigateParams params(browser(), url, ::ui::PAGE_TRANSITION_RELOAD);
ui_test_utils::NavigateToURL(&params);
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
// Test that if a form gets dynamically added between the form parsing and
@@ -1274,7 +1260,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), submit));
observer.Wait();
- EXPECT_TRUE(BubbleObserver(WebContents()).IsShowingSavePrompt());
+ EXPECT_TRUE(BubbleObserver(WebContents()).WasSavePromptShown());
}
// Test that if a hidden form gets dynamically added between the form parsing
@@ -1377,13 +1363,11 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, NoLastLoadGoodLastLoad) {
// authentication.
ui_test_utils::NavigateToURLWithDisposition(
browser(), http_test_server.GetURL("/basic_auth"),
- WindowOpenDisposition::NEW_FOREGROUND_TAB,
- ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB);
+ WindowOpenDisposition::CURRENT_TAB, ui_test_utils::BROWSER_TEST_NONE);
- content::WebContents* tab =
- browser()->tab_strip_model()->GetActiveWebContents();
- content::NavigationController* nav_controller = &tab->GetController();
- NavigationObserver nav_observer(tab);
+ content::NavigationController* nav_controller =
+ &WebContents()->GetController();
+ NavigationObserver nav_observer(WebContents());
WindowedAuthNeededObserver auth_needed_observer(nav_controller);
auth_needed_observer.Wait();
@@ -1399,8 +1383,8 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, NoLastLoadGoodLastLoad) {
// The password manager should be working correctly.
nav_observer.Wait();
WaitForPasswordStore();
- BubbleObserver bubble_observer(tab);
- EXPECT_TRUE(bubble_observer.IsShowingSavePrompt());
+ BubbleObserver bubble_observer(WebContents());
+ EXPECT_TRUE(bubble_observer.WasSavePromptShown());
bubble_observer.AcceptSavePrompt();
// Spin the message loop to make sure the password store had a chance to save
@@ -1429,7 +1413,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
observer.Wait();
WaitForPasswordStore();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
// Test that if login fails and content server pushes a different login form
@@ -1451,7 +1435,7 @@ IN_PROC_BROWSER_TEST_F(
observer.SetPathToWaitFor("/password/done_and_separate_login_form.html");
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(
@@ -1473,7 +1457,7 @@ IN_PROC_BROWSER_TEST_F(
observer.SetPathToWaitFor("/password/done_and_separate_login_form.html");
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
// Tests whether a attempted submission of a malicious credentials gets blocked.
@@ -1526,7 +1510,7 @@ IN_PROC_BROWSER_TEST_F(
WaitForPasswordStore();
BubbleObserver prompt_observer(WebContents());
- EXPECT_TRUE(prompt_observer.IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer.WasSavePromptShown());
prompt_observer.AcceptSavePrompt();
// Wait for password store and check that credentials are stored.
@@ -1656,7 +1640,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
prompt_observer->AcceptSavePrompt();
WaitForPasswordStore();
@@ -1728,7 +1712,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('submit_button').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
// Similar to the case above, but this time the form persists after
@@ -1751,7 +1735,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('submit_button').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
// The password manager should distinguish forms with empty actions. After
@@ -1771,7 +1755,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('ea_submit_button').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
// Similar to the case above, but this time the form persists after
@@ -1792,7 +1776,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('ea_submit_button').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
// Current and target URLs contain different parameters and references. This
@@ -1814,7 +1798,7 @@ IN_PROC_BROWSER_TEST_F(
"document.getElementById('pa_submit_button').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
// Similar to the case above, but this time the form persists after
@@ -1838,7 +1822,7 @@ IN_PROC_BROWSER_TEST_F(
"document.getElementById('pa_submit_button').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -1913,7 +1897,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('chg_submit_button').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -1932,7 +1916,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('chg_submit_button').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, NoPromptOnBack) {
@@ -1964,7 +1948,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, NoPromptOnBack) {
"window.history.back();";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_back));
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
}
// Regression test for http://crbug.com/452306
@@ -1985,7 +1969,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('testform').submit();";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), change_and_submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
// Regression test for http://crbug.com/451631
@@ -2009,7 +1993,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('testform').submit();";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
@@ -2036,7 +2020,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
break;
}
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
// Tests that if a site embeds the login and signup forms into one <form>, the
@@ -2089,7 +2073,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
std::string init_form = "sendMessage('fill_and_submit');";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), init_form));
init_observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
prompt_observer->AcceptSavePrompt();
// Visit the form again
@@ -2162,7 +2146,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"ifrmDoc.getElementById('input_submit_button').click();";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
prompt_observer->AcceptSavePrompt();
// Visit the form again
@@ -2290,7 +2274,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
// No credentials stored before, so save bubble is shown.
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
prompt_observer->AcceptSavePrompt();
// Check that credentials are stored.
scoped_refptr<password_manager::TestPasswordStore> password_store =
@@ -2334,7 +2318,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(),
fill_and_submit_change_password));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingUpdatePrompt());
+ EXPECT_TRUE(prompt_observer->WasUpdatePromptShown());
// We emulate that the user clicks "Update" button.
const autofill::PasswordForm& pending_credentials =
@@ -2380,7 +2364,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
observer.Wait();
// The stored password "pw" was overriden with "new_pw", so update prompt is
// expected.
- EXPECT_TRUE(prompt_observer->IsShowingUpdatePrompt());
+ EXPECT_TRUE(prompt_observer->WasUpdatePromptShown());
const autofill::PasswordForm stored_form =
password_store->stored_passwords().begin()->second[0];
@@ -2417,7 +2401,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
observer.Wait();
// The stored password "pw" was not overriden, so update prompt is not
// expected.
- EXPECT_FALSE(prompt_observer->IsShowingUpdatePrompt());
+ EXPECT_FALSE(prompt_observer->WasUpdatePromptShown());
CheckThatCredentialsStored(password_store.get(), base::ASCIIToUTF16("temp"),
base::ASCIIToUTF16("pw"));
}
@@ -2453,7 +2437,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(),
fill_and_submit_change_password));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingUpdatePrompt());
+ EXPECT_TRUE(prompt_observer->WasUpdatePromptShown());
const autofill::PasswordForm stored_form =
password_store->stored_passwords().begin()->second[0];
@@ -2944,7 +2928,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('retry_submit_button').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
prompt_observer->AcceptSavePrompt();
WaitForPasswordStore();
@@ -2982,8 +2966,8 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('retry_submit_button').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
- EXPECT_FALSE(prompt_observer->IsShowingUpdatePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
+ EXPECT_FALSE(prompt_observer->WasUpdatePromptShown());
}
// Tests that the update bubble shown when a password form without username is
@@ -3013,7 +2997,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
// The new password "new_pw" is used, so update prompt is expected.
- EXPECT_TRUE(prompt_observer->IsShowingUpdatePrompt());
+ EXPECT_TRUE(prompt_observer->WasUpdatePromptShown());
const autofill::PasswordForm stored_form =
password_store->stored_passwords().begin()->second[0];
@@ -3069,7 +3053,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
"document.getElementById('submit').click()";
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
observer.Wait();
- EXPECT_TRUE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_TRUE(prompt_observer->WasSavePromptShown());
}
// Tests that password suggestions still work if the fields have the
@@ -3119,7 +3103,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(),
fill_and_submit_change_password));
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
// Verify that the form's 'skip_zero_click' is not updated.
auto& passwords_map = password_store->stored_passwords();
@@ -3162,7 +3146,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
ASSERT_TRUE(content::ExecuteScript(RenderViewHost(),
fill_and_submit_change_password));
observer.Wait();
- EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+ EXPECT_FALSE(prompt_observer->WasSavePromptShown());
// Verify that the form's 'skip_zero_click' is not updated.
auto& passwords_map = password_store->stored_passwords();

Powered by Google App Engine
This is Rietveld 408576698