#include "base/functional/callback_helpers.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/mock_callback.h"
#include "chrome/browser/ui/autofill/payments/view_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/views/autofill/payments/payments_window_user_consent_dialog_view.h"
#include "chrome/test/interaction/interactive_browser_test.h"
#include "components/autofill/core/browser/metrics/payments/payments_window_metrics.h"
#include "components/autofill/core/browser/ui/payments/payments_window_user_consent_dialog_controller.h"
#include "components/autofill/core/browser/ui/payments/payments_window_user_consent_dialog_controller_impl.h"
#include "content/public/test/browser_test.h"
#include "ui/views/window/dialog_client_view.h"
namespace autofill::payments {
constexpr char kSuppressedScreenshotError[] = …;
constexpr std::string_view
kPaymentsWindowUserConsentDialogResultVcn3dsHistogramName = …;
constexpr std::string_view
kPaymentsWindowUserConsentDialogShownVcn3dsHistogramName = …;
class PaymentsWindowUserConsentDialogBrowserTest
: public InteractiveBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PaymentsWindowUserConsentDialogBrowserTest,
InvokeUi_PaymentsWindowUserConsentDialogDisplays) { … }
IN_PROC_BROWSER_TEST_F(PaymentsWindowUserConsentDialogBrowserTest,
InvokeUi_DialogShownHistogramBucketLogs) { … }
IN_PROC_BROWSER_TEST_F(PaymentsWindowUserConsentDialogBrowserTest,
InvokeUi_DialogAcceptance) { … }
IN_PROC_BROWSER_TEST_F(PaymentsWindowUserConsentDialogBrowserTest,
InvokeUi_DialogAcceptanceHistogramBucketLogs) { … }
IN_PROC_BROWSER_TEST_F(PaymentsWindowUserConsentDialogBrowserTest,
InvokeUi_DialogCancelled) { … }
IN_PROC_BROWSER_TEST_F(PaymentsWindowUserConsentDialogBrowserTest,
InvokeUi_DialogCancelledHistogramBucketLogs) { … }
IN_PROC_BROWSER_TEST_F(PaymentsWindowUserConsentDialogBrowserTest,
InvokeUi_EscKeyPressed) { … }
IN_PROC_BROWSER_TEST_F(PaymentsWindowUserConsentDialogBrowserTest,
InvokeUi_EscKeyPressedHistogramBucketLogs) { … }
IN_PROC_BROWSER_TEST_F(PaymentsWindowUserConsentDialogBrowserTest,
InvokeUi_CanCloseTabWhileDialogShowing) { … }
IN_PROC_BROWSER_TEST_F(PaymentsWindowUserConsentDialogBrowserTest,
InvokeUi_CloseTabWhileDialogShowingHistogramBucketLogs) { … }
IN_PROC_BROWSER_TEST_F(PaymentsWindowUserConsentDialogBrowserTest,
InvokeUi_CanCloseBrowserWhileDialogShowing) { … }
IN_PROC_BROWSER_TEST_F(
PaymentsWindowUserConsentDialogBrowserTest,
InvokeUi_CloseBrowserWhileDialogShowingHistogramBucketLogs) { … }
}