Commit 087f5c46 authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

BubbleObserver::AcceptUpdatePrompt: remove unused |form| parameter

Test-only cleanup: Before this CL, BubbleObserver::AcceptUpdatePrompt
accepted a |form| parameter that it didn't use. This CL removes the
param and updates call sites accordingly.

Bug: none
Change-Id: I4798237434dd02b7ff852a29f70a6cd891234fa0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2105300Reviewed-by: default avatarMohamed Amir Yosef <mamir@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750626}
parent 67822d02
...@@ -2463,10 +2463,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest, ChangePwd1AccountStored) { ...@@ -2463,10 +2463,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest, ChangePwd1AccountStored) {
EXPECT_TRUE(prompt_observer->IsUpdatePromptShownAutomatically()); EXPECT_TRUE(prompt_observer->IsUpdatePromptShownAutomatically());
// We emulate that the user clicks "Update" button. // We emulate that the user clicks "Update" button.
const autofill::PasswordForm& pending_credentials = prompt_observer->AcceptUpdatePrompt();
ManagePasswordsUIController::FromWebContents(WebContents())
->GetPendingPassword();
prompt_observer->AcceptUpdatePrompt(pending_credentials);
WaitForPasswordStore(); WaitForPasswordStore();
CheckThatCredentialsStored("temp", "new_pw"); CheckThatCredentialsStored("temp", "new_pw");
...@@ -2515,9 +2512,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestWithAutofillDisabled, ...@@ -2515,9 +2512,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestWithAutofillDisabled,
// expected. // expected.
EXPECT_TRUE(prompt_observer->IsUpdatePromptShownAutomatically()); EXPECT_TRUE(prompt_observer->IsUpdatePromptShownAutomatically());
const autofill::PasswordForm stored_form = prompt_observer->AcceptUpdatePrompt();
password_store->stored_passwords().begin()->second[0];
prompt_observer->AcceptUpdatePrompt(stored_form);
WaitForPasswordStore(); WaitForPasswordStore();
CheckThatCredentialsStored("temp", "new_pw"); CheckThatCredentialsStored("temp", "new_pw");
} }
...@@ -2631,9 +2626,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest, ...@@ -2631,9 +2626,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest,
observer.Wait(); observer.Wait();
EXPECT_TRUE(prompt_observer->IsUpdatePromptShownAutomatically()); EXPECT_TRUE(prompt_observer->IsUpdatePromptShownAutomatically());
const autofill::PasswordForm stored_form = prompt_observer->AcceptUpdatePrompt();
password_store->stored_passwords().begin()->second[0];
prompt_observer->AcceptUpdatePrompt(stored_form);
WaitForPasswordStore(); WaitForPasswordStore();
CheckThatCredentialsStored("temp", "new_pw"); CheckThatCredentialsStored("temp", "new_pw");
} }
...@@ -3146,9 +3139,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest, ...@@ -3146,9 +3139,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest,
// The new password "new_pw" is used, so update prompt is expected. // The new password "new_pw" is used, so update prompt is expected.
EXPECT_TRUE(prompt_observer->IsUpdatePromptShownAutomatically()); EXPECT_TRUE(prompt_observer->IsUpdatePromptShownAutomatically());
const autofill::PasswordForm stored_form = prompt_observer->AcceptUpdatePrompt();
password_store->stored_passwords().begin()->second[0];
prompt_observer->AcceptUpdatePrompt(stored_form);
WaitForPasswordStore(); WaitForPasswordStore();
CheckThatCredentialsStored("temp", "new_pw"); CheckThatCredentialsStored("temp", "new_pw");
...@@ -3800,9 +3791,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest, ...@@ -3800,9 +3791,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest,
EXPECT_TRUE(prompt_observer->IsUpdatePromptShownAutomatically()); EXPECT_TRUE(prompt_observer->IsUpdatePromptShownAutomatically());
// Check that the password is updated correctly if the user clicks Update. // Check that the password is updated correctly if the user clicks Update.
const autofill::PasswordForm& stored_form = prompt_observer->AcceptUpdatePrompt();
password_store->stored_passwords().begin()->second[0];
prompt_observer->AcceptUpdatePrompt(stored_form);
WaitForPasswordStore(); WaitForPasswordStore();
// The stored credential has been updated with the new password. // The stored credential has been updated with the new password.
......
...@@ -101,10 +101,7 @@ class CapturedSitesPasswordManagerBrowserTest ...@@ -101,10 +101,7 @@ class CapturedSitesPasswordManagerBrowserTest
bool UpdatePassword() override { bool UpdatePassword() override {
BubbleObserver bubble_observer(WebContents()); BubbleObserver bubble_observer(WebContents());
if (bubble_observer.IsUpdatePromptAvailable()) { if (bubble_observer.IsUpdatePromptAvailable()) {
const autofill::PasswordForm& pending_credentials = bubble_observer.AcceptUpdatePrompt();
ManagePasswordsUIController::FromWebContents(WebContents())
->GetPendingPassword();
bubble_observer.AcceptUpdatePrompt(pending_credentials);
PasswordManagerBrowserTestBase::WaitForPasswordStore(browser()); PasswordManagerBrowserTestBase::WaitForPasswordStore(browser());
// Hide the Update Password Prompt UI. // Hide the Update Password Prompt UI.
TabDialogs::FromWebContents(WebContents())->HideManagePasswordsBubble(); TabDialogs::FromWebContents(WebContents())->HideManagePasswordsBubble();
......
...@@ -344,8 +344,7 @@ void BubbleObserver::AcceptSavePrompt() const { ...@@ -344,8 +344,7 @@ void BubbleObserver::AcceptSavePrompt() const {
EXPECT_FALSE(IsSavePromptAvailable()); EXPECT_FALSE(IsSavePromptAvailable());
} }
void BubbleObserver::AcceptUpdatePrompt( void BubbleObserver::AcceptUpdatePrompt() const {
const autofill::PasswordForm& form) const {
ASSERT_TRUE(IsUpdatePromptAvailable()); ASSERT_TRUE(IsUpdatePromptAvailable());
passwords_ui_controller_->SavePassword( passwords_ui_controller_->SavePassword(
passwords_ui_controller_->GetPendingPassword().username_value, passwords_ui_controller_->GetPendingPassword().username_value,
......
...@@ -92,9 +92,9 @@ class BubbleObserver { ...@@ -92,9 +92,9 @@ class BubbleObserver {
// checks that the prompt is no longer available afterwards. // checks that the prompt is no longer available afterwards.
void AcceptSavePrompt() const; void AcceptSavePrompt() const;
// Expecting that the prompt is shown, update |form| with the password from // Expecting that the prompt is available, updates the password. At the end,
// observed form. Checks that the prompt is no longer visible afterwards. // checks that the prompt is no longer visible afterwards.
void AcceptUpdatePrompt(const autofill::PasswordForm& form) const; void AcceptUpdatePrompt() const;
// Returns once the account chooser pops up or it's already shown. // Returns once the account chooser pops up or it's already shown.
// |web_contents| must be the custom one returned by // |web_contents| must be the custom one returned by
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment