chromium/third_party/blink/renderer/modules/payments/payment_response_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.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

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

#include <memory>
#include <utility>

#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/bindings/core/v8/script_value.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/bindings/core/v8/v8_object_builder.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_payment_validation_errors.h"
#include "third_party/blink/renderer/modules/credentialmanagement/public_key_credential.h"
#include "third_party/blink/renderer/modules/payments/payment_address.h"
#include "third_party/blink/renderer/modules/payments/payment_state_resolver.h"
#include "third_party/blink/renderer/modules/payments/payment_test_helper.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"

namespace blink {
namespace {

class MockPaymentStateResolver final
    : public GarbageCollected<MockPaymentStateResolver>,
      public PaymentStateResolver {};

TEST(PaymentResponseTest, DataCopiedOver) {}

MATCHER_P(ArrayBufferEqualTo, other_buffer, "equal to") {}

// Calls getClientExtensionResults on the given public_key_credential.
static v8::Local<v8::Object> GetClientExtensionResults(
    V8TestingScope& scope,
    v8::Local<v8::Object> public_key_credential) {}

// Gets a v8 object property of array_buffer type.
static v8::Local<v8::ArrayBuffer> GetArrayBuffer(V8TestingScope& scope,
                                                 v8::Local<v8::Object>& object,
                                                 const char* property_key) {}

TEST(PaymentResponseTest, PaymentResponseDetailsContainsSpcExtensionsPRF) {}

TEST(PaymentResponseTest,
     PaymentResponseDetailsWithUnexpectedJSONFormatString) {}

TEST(PaymentResponseTest, PaymentResponseDetailsRetrunsTheSameObject) {}

TEST(PaymentResponseTest, CompleteCalledWithSuccess) {}

TEST(PaymentResponseTest, CompleteCalledWithFailure) {}

TEST(PaymentResponseTest, JSONSerializerTest) {}

}  // namespace
}  // namespace blink