#include "third_party/blink/renderer/modules/payments/secure_payment_confirmation_helper.h"
#include "base/compiler_specific.h"
#include "base/containers/span.h"
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/payments/payment_request.mojom-blink.h"
#include "third_party/blink/renderer/bindings/core/v8/script_value.h"
#include "third_party/blink/renderer/bindings/core/v8/to_v8_traits.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_arraybuffer_arraybufferview.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_authentication_extensions_client_inputs.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_authentication_extensions_prf_inputs.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_authentication_extensions_prf_values.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_network_or_issuer_information.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_payment_credential_instrument.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_secure_payment_confirmation_request.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/testing/task_environment.h"
namespace blink {
namespace {
static const uint8_t kPrfInputData[] = …;
WTF::Vector<uint8_t> CreateVector(const uint8_t* buffer,
const unsigned length) { … }
static V8UnionArrayBufferOrArrayBufferView* ArrayBufferOrView(
const uint8_t* data,
size_t size) { … }
static AuthenticationExtensionsPRFInputs* CreatePrfInputs(
v8::Isolate* isolate) { … }
}
TEST(SecurePaymentConfirmationHelperTest, Parse_Success) { … }
TEST(SecurePaymentConfirmationHelperTest, Parse_OptionalFields) { … }
TEST(SecurePaymentConfirmationHelperTest, Parse_EmptyIdCredentialIds) { … }
TEST(SecurePaymentConfirmationHelperTest, Parse_EmptyId) { … }
TEST(SecurePaymentConfirmationHelperTest, Parse_EmptyChallenge) { … }
TEST(SecurePaymentConfirmationHelperTest, Parse_EmptyInstrumentDisplayName) { … }
TEST(SecurePaymentConfirmationHelperTest, Parse_EmptyInstrumentIcon) { … }
TEST(SecurePaymentConfirmationHelperTest, Parse_InvalidInstrumentIcon) { … }
TEST(SecurePaymentConfirmationHelperTest, Parse_InvalidRpId) { … }
TEST(SecurePaymentConfirmationHelperTest,
Parse_MissingPayeeNameAndPayeeOrigin) { … }
TEST(SecurePaymentConfirmationHelperTest, Parse_EmptyPayeeName) { … }
TEST(SecurePaymentConfirmationHelperTest, Parse_EmptyPayeeOrigin) { … }
TEST(SecurePaymentConfirmationHelperTest, Parse_InvalidPayeeOrigin) { … }
TEST(SecurePaymentConfirmationHelperTest, Parse_NotHttpsPayeeOrigin) { … }
TEST(SecurePaymentConfirmationHelperTest, Parse_Extensions) { … }
TEST(SecurePaymentConfirmationHelperTest, Parse_EmptyNetworkName) { … }
TEST(SecurePaymentConfirmationHelperTest, Parse_EmptyNetworkIcon) { … }
TEST(SecurePaymentConfirmationHelperTest, Parse_InvalidNetworkIcon) { … }
TEST(SecurePaymentConfirmationHelperTest, Parse_EmptyIssuerName) { … }
TEST(SecurePaymentConfirmationHelperTest, Parse_EmptyIssuerIcon) { … }
TEST(SecurePaymentConfirmationHelperTest, Parse_InvalidIssuerIcon) { … }
}