chromium/third_party/blink/renderer/modules/payments/payment_request_test.cc

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

#include "third_party/blink/renderer/modules/payments/payment_request.h"

#include <memory>

#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/frame/user_activation_notification_type.mojom-blink.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/events/native_event_listener.h"
#include "third_party/blink/renderer/core/event_type_names.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/testing/dummy_page_holder.h"
#include "third_party/blink/renderer/core/testing/mock_function_scope.h"
#include "third_party/blink/renderer/modules/payments/payment_test_helper.h"
#include "third_party/blink/renderer/platform/bindings/exception_code.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"

namespace blink {
namespace {

TEST(PaymentRequestTest, NoExceptionWithValidData) {}

TEST(PaymentRequestTest, SupportedMethodListRequired) {}

TEST(PaymentRequestTest, NullShippingOptionWhenNoOptionsAvailable) {}

TEST(PaymentRequestTest, NullShippingOptionWhenMultipleOptionsAvailable) {}

TEST(PaymentRequestTest, DontSelectSingleAvailableShippingOptionByDefault) {}

TEST(PaymentRequestTest,
     DontSelectSingleAvailableShippingOptionWhenShippingNotRequested) {}

TEST(PaymentRequestTest,
     DontSelectSingleUnselectedShippingOptionWhenShippingRequested) {}

TEST(PaymentRequestTest,
     SelectSingleSelectedShippingOptionWhenShippingRequested) {}

TEST(PaymentRequestTest,
     SelectOnlySelectedShippingOptionWhenShippingRequested) {}

TEST(PaymentRequestTest,
     SelectLastSelectedShippingOptionWhenShippingRequested) {}

TEST(PaymentRequestTest, NullShippingTypeWhenRequestShippingIsFalse) {}

TEST(PaymentRequestTest,
     DefaultShippingTypeWhenRequestShippingIsTrueWithNoSpecificType) {}

TEST(PaymentRequestTest, DeliveryShippingTypeWhenShippingTypeIsDelivery) {}

TEST(PaymentRequestTest, PickupShippingTypeWhenShippingTypeIsPickup) {}

TEST(PaymentRequestTest, RejectShowPromiseOnInvalidShippingAddress) {}

TEST(PaymentRequestTest, OnShippingOptionChange) {}

TEST(PaymentRequestTest, CannotCallShowTwice) {}

TEST(PaymentRequestTest, CannotShowAfterAborted) {}

TEST(PaymentRequestTest, ShowConsumesUserActivation) {}

TEST(PaymentRequestTest, ActivationlessShow) {}

TEST(PaymentRequestTest, RejectShowPromiseOnErrorPaymentMethodNotSupported) {}

TEST(PaymentRequestTest, RejectShowPromiseOnErrorCancelled) {}

TEST(PaymentRequestTest, RejectShowPromiseOnUpdateDetailsFailure) {}

TEST(PaymentRequestTest, IgnoreUpdatePaymentDetailsAfterShowPromiseResolved) {}

TEST(PaymentRequestTest, RejectShowPromiseOnNonPaymentDetailsUpdate) {}

TEST(PaymentRequestTest, RejectShowPromiseOnInvalidPaymentDetailsUpdate) {}

TEST(PaymentRequestTest,
     ClearShippingOptionOnPaymentDetailsUpdateWithoutShippingOptions) {}

TEST(
    PaymentRequestTest,
    ClearShippingOptionOnPaymentDetailsUpdateWithMultipleUnselectedShippingOptions) {}

TEST(PaymentRequestTest, UseTheSelectedShippingOptionFromPaymentDetailsUpdate) {}

TEST(PaymentRequestTest, NoExceptionWithErrorMessageInUpdate) {}

TEST(PaymentRequestTest,
     ShouldResolveWithExceptionIfIDsOfShippingOptionsAreDuplicated) {}

TEST(PaymentRequestTest, DetailsIdIsSet) {}

// An event listener that owns a page and destroys it when the event is invoked.
class PageDeleter final : public NativeEventListener {};

TEST(PaymentRequestTest, NoCrashWhenPaymentMethodChangeEventDestroysContext) {}

TEST(PaymentRequestTest, SPCActivationlessShow) {}

TEST(PaymentRequestTest, SPCActivationlessNotConsumedWithActivation) {}

}  // namespace
}  // namespace blink