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

Unified Diff: chrome/browser/ui/views/passwords/password_dialog_view_browsertest.cc

Issue 1832933002: Update the |skip_zero_click| flag of a credential when selected in the account chooser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 9 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/ui/views/passwords/password_dialog_view_browsertest.cc
diff --git a/chrome/browser/ui/views/passwords/password_dialog_view_browsertest.cc b/chrome/browser/ui/views/passwords/password_dialog_view_browsertest.cc
index 9453c8a6d4ddce4139f03a5f6864c7181e785db3..6f2edff46726ccf44f305de84039a13adff5cbb0 100644
--- a/chrome/browser/ui/views/passwords/password_dialog_view_browsertest.cc
+++ b/chrome/browser/ui/views/passwords/password_dialog_view_browsertest.cc
@@ -122,8 +122,7 @@ class PasswordDialogViewTest : public InProcessBrowserTest {
browser()->tab_strip_model()->GetActiveWebContents());
}
- MOCK_METHOD1(OnChooseCredential,
- void(const password_manager::CredentialInfo&));
+ MOCK_METHOD1(OnChooseCredential, void(const autofill::PasswordForm*));
private:
TestManagePasswordsUIController* controller_;
@@ -196,10 +195,7 @@ IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest,
ScopedVector<autofill::PasswordForm>(), origin);
ASSERT_TRUE(controller()->current_account_chooser());
AccountChooserDialogView* dialog = controller()->current_account_chooser();
- EXPECT_CALL(*this,
- OnChooseCredential(Field(
- &password_manager::CredentialInfo::type,
- password_manager::CredentialType::CREDENTIAL_TYPE_EMPTY)));
+ EXPECT_CALL(*this, OnChooseCredential(nullptr));
EXPECT_CALL(*controller(), OnDialogClosed());
dialog->GetWidget()->Close();
@@ -230,10 +226,7 @@ IN_PROC_BROWSER_TEST_F(
// After picking a credential, we should pass it back to the caller via the
// callback, but we should not pop up the autosignin prompt as there were
// multiple credentials available.
- EXPECT_CALL(
- *this, OnChooseCredential(Field(
- &password_manager::CredentialInfo::type,
- password_manager::CredentialType::CREDENTIAL_TYPE_FEDERATED)));
+ EXPECT_CALL(*this, OnChooseCredential(testing::Pointee(form)));
EXPECT_TRUE(
password_bubble_experiment::ShouldShowAutoSignInPromptFirstRunExperience(
browser()->profile()->GetPrefs()));
@@ -257,10 +250,7 @@ IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest,
EXPECT_TRUE(controller()->current_account_chooser());
AccountChooserDialogView* dialog = controller()->current_account_chooser();
- EXPECT_CALL(*this,
- OnChooseCredential(Field(
- &password_manager::CredentialInfo::type,
- password_manager::CredentialType::CREDENTIAL_TYPE_EMPTY)));
+ EXPECT_CALL(*this, OnChooseCredential(nullptr));
EXPECT_CALL(*controller(), OnDialogClosed());
dialog->GetWidget()->Close();
EXPECT_FALSE(controller()->current_autosignin_prompt());
@@ -283,10 +273,7 @@ IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest,
// After picking a credential, we should pass it back to the caller via the
// callback, and pop up the autosignin prompt iff we should show it.
- EXPECT_CALL(*this,
- OnChooseCredential(Field(
- &password_manager::CredentialInfo::type,
- password_manager::CredentialType::CREDENTIAL_TYPE_PASSWORD)));
+ EXPECT_CALL(*this, OnChooseCredential(testing::Pointee(form)));
EXPECT_TRUE(
password_bubble_experiment::ShouldShowAutoSignInPromptFirstRunExperience(
browser()->profile()->GetPrefs()));
@@ -316,10 +303,7 @@ IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest,
// After picking a credential, we should pass it back to the caller via the
// callback, and pop up the autosignin prompt iff we should show it.
- EXPECT_CALL(*this,
- OnChooseCredential(Field(
- &password_manager::CredentialInfo::type,
- password_manager::CredentialType::CREDENTIAL_TYPE_PASSWORD)));
+ EXPECT_CALL(*this, OnChooseCredential(testing::Pointee(form)));
browser()->profile()->GetPrefs()->SetBoolean(
password_manager::prefs::kCredentialsEnableAutosignin, false);
controller()->ChooseCredential(
@@ -357,10 +341,7 @@ IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest,
controller()->GetState());
EXPECT_TRUE(controller()->current_account_chooser());
- EXPECT_CALL(*this,
- OnChooseCredential(Field(
- &password_manager::CredentialInfo::type,
- password_manager::CredentialType::CREDENTIAL_TYPE_PASSWORD)));
+ EXPECT_CALL(*this, OnChooseCredential(testing::Pointee(form)));
controller()->ChooseCredential(
form, password_manager::CredentialType::CREDENTIAL_TYPE_PASSWORD);

Powered by Google App Engine
This is Rietveld 408576698