chromium/chrome/browser/ui/views/autofill/payments/card_unmask_otp_input_dialog_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/test/metrics/histogram_tester.h"
#include "build/build_config.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/card_unmask_otp_input_dialog_views.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.h"
#include "components/autofill/core/browser/ui/payments/card_unmask_otp_input_dialog_controller_impl.h"
#include "content/public/test/browser_test.h"

namespace autofill {

namespace {
const int kDefaultOtpLength =;
}  // namespace

class CardUnmaskOtpInputDialogBrowserTest
    : public DialogBrowserTest,
      public testing::WithParamInterface<CardUnmaskChallengeOptionType> {};

// Ensures the UI can be shown.
IN_PROC_BROWSER_TEST_P(CardUnmaskOtpInputDialogBrowserTest,
                       InvokeUi_CardUnmaskOtpInputDialogDisplays) {}

// Ensures closing tab while dialog being visible is correctly handled.
IN_PROC_BROWSER_TEST_P(CardUnmaskOtpInputDialogBrowserTest,
                       CanCloseTabWhileDialogShowing) {}

// Ensures closing browser while dialog being visible is correctly handled.
IN_PROC_BROWSER_TEST_P(CardUnmaskOtpInputDialogBrowserTest,
                       CanCloseBrowserWhileDialogShowing) {}

// Ensures activating the new code link sets it to invalid for a set period of
// time.
#if BUILDFLAG(IS_WIN)
// Triggering logic required for Windows OS runs: https://crbug.com/1254686
#define MAYBE_LinkInvalidatesOnActivation
#else
#define MAYBE_LinkInvalidatesOnActivation
#endif
IN_PROC_BROWSER_TEST_P(CardUnmaskOtpInputDialogBrowserTest,
                       MAYBE_LinkInvalidatesOnActivation) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace autofill