#include <memory>
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/password_manager/chrome_password_manager_client.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/autofill/chrome_autofill_client.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/test/test_browser_dialog.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/passwords/account_chooser_dialog_view.h"
#include "chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.h"
#include "chrome/browser/ui/views/passwords/credential_leak_dialog_view.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/password_manager/core/browser/mock_password_form_manager_for_ui.h"
#include "components/password_manager/core/browser/password_bubble_experiment.h"
#include "components/password_manager/core/browser/password_form.h"
#include "components/password_manager/core/common/password_manager_pref_names.h"
#include "components/prefs/pref_service.h"
#include "content/public/test/browser_test.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "ui/base/ui_base_switches.h"
#include "ui/views/test/widget_test.h"
#include "ui/views/widget/widget.h"
BasicHttpResponse;
HttpRequest;
HttpResponse;
CredentialLeakFlags;
CredentialLeakType;
Field;
ReturnRef;
namespace {
class TestManagePasswordsUIController : public ManagePasswordsUIController { … };
TestManagePasswordsUIController::TestManagePasswordsUIController(
content::WebContents* web_contents)
: … { … }
void TestManagePasswordsUIController::OnDialogHidden() { … }
AccountChooserPrompt* TestManagePasswordsUIController::CreateAccountChooser(
CredentialManagerDialogController* controller) { … }
AutoSigninFirstRunPrompt*
TestManagePasswordsUIController::CreateAutoSigninPrompt(
CredentialManagerDialogController* controller) { … }
CredentialLeakPrompt*
TestManagePasswordsUIController::CreateCredentialLeakPrompt(
CredentialLeakDialogController* controller) { … }
std::unique_ptr<password_manager::PasswordFormManagerForUI> WrapFormInManager(
const password_manager::PasswordForm* form) { … }
class PasswordDialogViewTest : public DialogBrowserTest { … };
void PasswordDialogViewTest::SetUpOnMainThread() { … }
void PasswordDialogViewTest::SetupChooseCredentials(
std::vector<std::unique_ptr<password_manager::PasswordForm>>
local_credentials,
const url::Origin& origin) { … }
content::WebContents* PasswordDialogViewTest::SetupTabWithTestController(
Browser* browser) { … }
IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest,
PopupAccountChooserWithMultipleCredentialsReturnEmpty) { … }
IN_PROC_BROWSER_TEST_F(
PasswordDialogViewTest,
PopupAccountChooserWithMultipleCredentialsReturnNonEmpty) { … }
IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest,
PopupAccountChooserWithSingleCredentialReturnEmpty) { … }
IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest,
PopupAccountChooserWithSingleCredentialClickSignIn) { … }
IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest,
PopupAccountChooserWithSingleCredentialReturnNonEmpty) { … }
IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest,
PopupAccountChooserWithDisabledAutoSignin) { … }
IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest, PopupAccountChooserInIncognito) { … }
IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest, EscCancelsAutoSigninPrompt) { … }
IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest, PopupCredentialsLeakedPrompt) { … }
IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest,
PopupAutoSigninPromptAfterBlockedZeroclick) { … }
void PasswordDialogViewTest::ShowUi(const std::string& name) { … }
IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest, InvokeUi_AutoSigninFirstRun) { … }
IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest, InvokeUi_CredentialLeak) { … }
IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest, InvokeUi_PopupAutoSigninPrompt) { … }
IN_PROC_BROWSER_TEST_F(
PasswordDialogViewTest,
InvokeUi_PopupAccountChooserWithSingleCredentialClickSignIn) { … }
IN_PROC_BROWSER_TEST_F(
PasswordDialogViewTest,
InvokeUi_PopupAccountChooserWithMultipleCredentialClickSignIn) { … }
}