chromium/components/payments/content/payment_request_state_unittest.cc

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

#include "components/payments/content/payment_request_state.h"

#include <string>
#include <utility>

#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "base/uuid.h"
#include "components/autofill/core/browser/address_data_manager.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/country_type.h"
#include "components/autofill/core/browser/data_model/autofill_profile.h"
#include "components/autofill/core/browser/test_personal_data_manager.h"
#include "components/payments/content/payment_app_factory.h"
#include "components/payments/content/payment_app_service.h"
#include "components/payments/content/payment_request_spec.h"
#include "components/payments/content/test_content_payment_request_delegate.h"
#include "components/payments/content/test_payment_app.h"
#include "components/payments/core/const_csp_checker.h"
#include "components/payments/core/journey_logger.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_web_contents_factory.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/payments/payment_request.mojom.h"

namespace payments {
namespace {

class TestAppFactory : public PaymentAppFactory {};

class PaymentRequestStateTest : public testing::Test,
                                public PaymentRequestState::Observer,
                                public PaymentRequestState::Delegate {};

TEST_F(PaymentRequestStateTest, CanMakePayment) {}

TEST_F(PaymentRequestStateTest, CanMakePayment_NoEnrolledInstrument) {}

TEST_F(PaymentRequestStateTest, CanMakePayment_UnsupportedPaymentMethod) {}

// Test selecting a contact info profile will make the user ready to pay.
TEST_F(PaymentRequestStateTest, ReadyToPay_ContactInfo) {}

TEST_F(PaymentRequestStateTest, ReadyToPay_DefaultSelections) {}

TEST_F(PaymentRequestStateTest, RetryWithPayerErrors) {}

TEST_F(PaymentRequestStateTest, RetryWithShippingAddressErrors) {}

// Testing that only supported instruments are shown. In this test the merchant
// requests https://payments.example payment method, which is not supported.
TEST_F(PaymentRequestStateTest, UnsupportedMethod) {}

TEST_F(PaymentRequestStateTest, SelectedShippingAddressMessage_Normalized) {}

TEST_F(PaymentRequestStateTest, JaLatnShippingAddress) {}

}  // namespace
}  // namespace payments