#include "components/payments/content/payment_method_manifest_table.h"
#include <stdint.h>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/containers/contains.h"
#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "components/payments/core/secure_payment_confirmation_credential.h"
#include "components/webdata/common/web_database.h"
#include "content/public/common/content_features.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace payments {
namespace {
std::vector<uint8_t> CreateIdentifier(uint8_t first_byte) { … }
std::vector<uint8_t> CreateCredentialId(uint8_t first_byte = 0) { … }
std::vector<std::vector<uint8_t>> CreateCredentialIdList(
uint8_t first_byte = 0) { … }
std::vector<uint8_t> CreateUserId(uint8_t first_byte = 4) { … }
void ExpectOneValidCredential(
const std::vector<uint8_t>& credential_id,
const std::string& relying_party_id,
const std::vector<uint8_t>& user_id,
std::vector<std::unique_ptr<SecurePaymentConfirmationCredential>>
credentials) { … }
class PaymentMethodManifestTableTest : public testing::Test { … };
TEST_F(PaymentMethodManifestTableTest, GetNonExistManifest) { … }
TEST_F(PaymentMethodManifestTableTest, AddAndGetSingleManifest) { … }
TEST_F(PaymentMethodManifestTableTest, AddAndGetMultipleManifest) { … }
TEST_F(PaymentMethodManifestTableTest, GetNonExistingCredential) { … }
TEST_F(PaymentMethodManifestTableTest, AddAndGetOneValidCredential) { … }
TEST_F(PaymentMethodManifestTableTest, AddingInvalidCredentialReturnsFalse) { … }
TEST_F(PaymentMethodManifestTableTest, UpdatingCredentialReturnsTrue) { … }
TEST_F(PaymentMethodManifestTableTest,
DifferentRelyingPartiesCannotUseSameCredentialIdentifier) { … }
TEST_F(PaymentMethodManifestTableTest, RelyingPartyCanHaveMultipleCredentials) { … }
TEST_F(PaymentMethodManifestTableTest,
SameRelyingPartyAndUserIdOverwritesCredential) { … }
TEST_F(PaymentMethodManifestTableTest, ClearCredentials) { … }
TEST_F(PaymentMethodManifestTableTest,
ClearCredentials_NotDeleteOutOfTimeRange) { … }
TEST_F(PaymentMethodManifestTableTest,
CredentialTableAddDateCreatedAndUserIdColumn) { … }
TEST_F(PaymentMethodManifestTableTest, CredentialTableUserIdMigration) { … }
}
}