chromium/chrome/browser/ui/views/payments/secure_payment_confirmation_no_creds_dialog_view_browsertest.cc

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

#include "chrome/browser/ui/views/payments/secure_payment_confirmation_no_creds_dialog_view.h"

#include "base/functional/callback_helpers.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/test/test_browser_dialog.h"
#include "components/payments/content/secure_payment_confirmation_no_creds_model.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/test/browser_test.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features_generated.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/events/base_event_utils.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/link.h"
#include "ui/views/controls/styled_label.h"
#include "ui/views/test/mock_input_event_activation_protector.h"
#include "ui/views/window/dialog_client_view.h"

namespace payments {

HasSubstr;

class SecurePaymentConfirmationNoCredsDialogViewTest
    : public DialogBrowserTest,
      public SecurePaymentConfirmationNoCredsDialogView::ObserverForTest {};

IN_PROC_BROWSER_TEST_F(SecurePaymentConfirmationNoCredsDialogViewTest,
                       InvokeUi_default) {}

IN_PROC_BROWSER_TEST_F(SecurePaymentConfirmationNoCredsDialogViewTest,
                       ViewMatchesModel) {}

// Test that the 'Continue' button is protected against accidental inputs.
IN_PROC_BROWSER_TEST_F(SecurePaymentConfirmationNoCredsDialogViewTest,
                       ContinueButtonIgnoresAccidentalInputs) {}

// Test that the opt out link is shown when requested, and that clicking it
// correctly closes the dialog via the expected path.
IN_PROC_BROWSER_TEST_F(SecurePaymentConfirmationNoCredsDialogViewTest, OptOut) {}

class SecurePaymentConfirmationNoCredsDialogViewWithInlineNetworkAndIssuerTest
    : public SecurePaymentConfirmationNoCredsDialogViewTest {};

// Test that the cart icon is still shown even when the inline network/issuer
// flag is set.
IN_PROC_BROWSER_TEST_F(
    SecurePaymentConfirmationNoCredsDialogViewWithInlineNetworkAndIssuerTest,
    CartIconStillShows) {}

}  // namespace payments