chromium/chrome/browser/ui/views/autofill/payments/autofill_progress_dialog_views_browsertest.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/mock_callback.h"
#include "chrome/browser/ui/autofill/chrome_autofill_client.h"
#include "chrome/browser/ui/autofill/payments/chrome_payments_autofill_client.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/test/test_browser_dialog.h"
#include "chrome/browser/ui/views/autofill/payments/autofill_progress_dialog_views.h"
#include "components/autofill/core/browser/autofill_progress_dialog_type.h"
#include "components/autofill/core/browser/metrics/autofill_metrics.h"
#include "components/autofill/core/browser/ui/payments/autofill_progress_dialog_controller_impl.h"
#include "components/autofill/core/browser/ui/payments/autofill_progress_dialog_view.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test.h"
#include "ui/views/test/widget_test.h"

namespace autofill {

class AutofillProgressDialogViewsBrowserTest
    : public DialogBrowserTest,
      public testing::WithParamInterface<std::string> {};

IN_PROC_BROWSER_TEST_P(AutofillProgressDialogViewsBrowserTest,
                       InvokeUi_VirtualCardUnmask) {}

// Ensures closing current tab while dialog being visible is correctly handle
// and the browser won't crash.
IN_PROC_BROWSER_TEST_P(AutofillProgressDialogViewsBrowserTest,
                       CloseTabWhileDialogShowing) {}

// Ensures closing browser while dialog being visible is correctly handled and
// the browser won't crash.
IN_PROC_BROWSER_TEST_P(AutofillProgressDialogViewsBrowserTest,
                       CloseBrowserWhileDialogShowing) {}

// Ensures clicking on the cancel button is correctly handled.
IN_PROC_BROWSER_TEST_P(AutofillProgressDialogViewsBrowserTest,
                       ClickCancelButton) {}

// Ensures the dialog closing with confirmation works properly.
IN_PROC_BROWSER_TEST_P(AutofillProgressDialogViewsBrowserTest,
                       CloseDialogWithConfirmation) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace autofill