#include "components/web_package/signed_web_bundles/signed_web_bundle_id.h"
#include <array>
#include <optional>
#include <string_view>
#include <tuple>
#include <utility>
#include "base/containers/span.h"
#include "base/ranges/algorithm.h"
#include "base/test/bind.h"
#include "base/test/gmock_expected_support.h"
#include "components/web_package/signed_web_bundles/ecdsa_p256_public_key.h"
#include "components/web_package/signed_web_bundles/ed25519_public_key.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace web_package {
namespace {
const std::array<uint8_t, 32> kEd25519PublicKeyBytes(
{ … });
constexpr std::string_view kEd25519SignedWebBundleId = …;
const std::array<uint8_t, 32> kProxyModeBytes(
{ … });
constexpr std::string_view kProxyModeSignedWebBundleId = …;
constexpr std::array<uint8_t, 33> kEcdsaP256PublicKeyBytes = …;
constexpr std::string_view kEcdsaP256SignedWebBundleId = …;
}
class SignedWebBundleIdValidTest
: public ::testing::TestWithParam<
std::tuple<std::string, SignedWebBundleId::Type>> { … };
TEST_P(SignedWebBundleIdValidTest, ParseValidIDs) { … }
INSTANTIATE_TEST_SUITE_P(…);
class SignedWebBundleIdInvalidTest
: public ::testing::TestWithParam<std::pair<std::string, std::string>> { … };
TEST_P(SignedWebBundleIdInvalidTest, ParseInvalidIDs) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST(SignedWebBundleIdTest, Comparators) { … }
TEST(SignedWebBundleIdTest, CreateForEd25519PublicKey) { … }
TEST(SignedWebBundleIdTest, CreateForEcdsaP256PublicKey) { … }
TEST(SignedWebBundleIdTest, CreateForProxyMode) { … }
TEST(SignedWebBundleIdTest, CreateRandomForProxyMode) { … }
}