#include "components/payments/content/secure_payment_confirmation_app_factory.h"
#include <vector>
#include "base/base64.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/scoped_feature_list.h"
#include "components/payments/content/mock_payment_app_factory_delegate.h"
#include "components/payments/content/mock_payment_manifest_web_data_service.h"
#include "components/payments/core/features.h"
#include "components/webauthn/core/browser/mock_internal_authenticator.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 "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/payments/payment_request.mojom.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace payments {
namespace {
RunOnceCallback;
_;
ByMove;
Eq;
Return;
ReturnRef;
static constexpr char kChallengeBase64[] = …;
static constexpr char kCredentialIdBase64[] = …;
class SecurePaymentConfirmationAppFactoryTest : public testing::Test { … };
TEST_F(SecurePaymentConfirmationAppFactoryTest,
SecureConfirmationPaymentRequest_IsValid) { … }
TEST_F(SecurePaymentConfirmationAppFactoryTest,
SecureConfirmationPaymentRequest_EmptyCredentialIds) { … }
TEST_F(SecurePaymentConfirmationAppFactoryTest,
SecureConfirmationPaymentRequest_EmptyId) { … }
TEST_F(SecurePaymentConfirmationAppFactoryTest,
SecureConfirmationPaymentRequest_EmptyChallenge) { … }
TEST_F(SecurePaymentConfirmationAppFactoryTest,
SecureConfirmationPaymentRequest_EmptyDisplayName) { … }
TEST_F(SecurePaymentConfirmationAppFactoryTest,
SecureConfirmationPaymentRequest_EmptyInstrumentIcon) { … }
TEST_F(SecurePaymentConfirmationAppFactoryTest,
SecureConfirmationPaymentRequest_InvalidInstrumentIcon) { … }
TEST_F(SecurePaymentConfirmationAppFactoryTest,
SecureConfirmationPaymentRequest_InvalidRpId) { … }
TEST_F(SecurePaymentConfirmationAppFactoryTest,
SecureConfirmationPaymentRequest_MissingPayeeNameAndPayeeOrigin) { … }
TEST_F(SecurePaymentConfirmationAppFactoryTest,
SecureConfirmationPaymentRequest_EmptyPayeeName) { … }
TEST_F(SecurePaymentConfirmationAppFactoryTest,
SecureConfirmationPaymentRequest_NonHttpsPayeeOrigin) { … }
TEST_F(SecurePaymentConfirmationAppFactoryTest,
SecureConfirmationPaymentRequest_EmptyNetworkName) { … }
TEST_F(SecurePaymentConfirmationAppFactoryTest,
SecureConfirmationPaymentRequest_EmptyNetworkIcon) { … }
TEST_F(SecurePaymentConfirmationAppFactoryTest,
SecureConfirmationPaymentRequest_InvalidNetworkIcon) { … }
TEST_F(SecurePaymentConfirmationAppFactoryTest,
SecureConfirmationPaymentRequest_EmptyIssuerName) { … }
TEST_F(SecurePaymentConfirmationAppFactoryTest,
SecureConfirmationPaymentRequest_EmptyIssuerIcon) { … }
TEST_F(SecurePaymentConfirmationAppFactoryTest,
SecureConfirmationPaymentRequest_InvalidIssuerIcon) { … }
class SecurePaymentConfirmationAppFactoryUsingCredentialStoreAPIsTest
: public SecurePaymentConfirmationAppFactoryTest { … };
TEST_F(
SecurePaymentConfirmationAppFactoryUsingCredentialStoreAPIsTest,
CorrectlyCalculatesThirdPartyPaymentRequirement_OriginDifferentFromRpId) { … }
TEST_F(SecurePaymentConfirmationAppFactoryUsingCredentialStoreAPIsTest,
CorrectlyCalculatesThirdPartyPaymentRequirement_OriginSameAsRpId) { … }
TEST_F(SecurePaymentConfirmationAppFactoryUsingCredentialStoreAPIsTest,
CorrectlyCalculatesThirdPartyPaymentRequirement_OriginSameDomainAsRpId) { … }
TEST_F(SecurePaymentConfirmationAppFactoryUsingCredentialStoreAPIsTest,
AppDisabledIfCredentialStoreAPIsUnavailable) { … }
}
}