#include "components/web_package/signed_web_bundles/signed_web_bundle_integrity_block.h"
#include <utility>
#include "base/containers/span.h"
#include "base/containers/to_vector.h"
#include "base/test/gmock_expected_support.h"
#include "components/web_package/mojom/web_bundle_parser.mojom.h"
#include "components/web_package/signed_web_bundles/ed25519_public_key.h"
#include "components/web_package/signed_web_bundles/ed25519_signature.h"
#include "components/web_package/signed_web_bundles/integrity_block_attributes.h"
#include "components/web_package/signed_web_bundles/signed_web_bundle_signature_stack_entry.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace web_package {
namespace {
ElementsAreArray;
constexpr std::array<uint8_t, 32> kEd25519PublicKey1 = …;
constexpr std::array<uint8_t, 32> kEd25519PublicKey2 = …;
constexpr char kEd25519SignedWebBundleId1[] = …;
constexpr std::array<uint8_t, 64> kEd25519Signature1 = …;
constexpr std::array<uint8_t, 64> kEd25519Signature2 = …;
constexpr uint8_t kAttributesCbor1[] = …;
constexpr uint8_t kAttributesCbor2[] = …;
mojom::BundleIntegrityBlockSignatureStackEntryPtr MakeSignatureStackEntry(
base::span<const uint8_t, 32> public_key,
base::span<const uint8_t, 64> signature,
base::span<const uint8_t> attributes_cbor) { … }
}
TEST(SignedWebBundleIntegrityBlockTest, InvalidSize) { … }
TEST(SignedWebBundleIntegrityBlockTest, EmptySignatureStack) { … }
TEST(SignedWebBundleIntegrityBlockTest, ValidIntegrityBlockWithOneSignature) { … }
TEST(SignedWebBundleIntegrityBlockTest, ValidIntegrityBlockWithTwoSignatures) { … }
TEST(SignedWebBundleIntegrityBlockTest, Comparators) { … }
}