#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/platform/loader/fetch/cached_metadata.h"
#include "base/containers/span.h"
#include "mojo/public/cpp/base/big_buffer.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace blink {
namespace {
const uint32_t kTestDataTypeId = …;
const uint64_t kTestTag = …;
const uint8_t kTestData[] = …;
Vector<uint8_t> CreateTestSerializedDataWithMarker(uint32_t marker) { … }
Vector<uint8_t> CreateTestSerializedData() { … }
void CheckTestCachedMetadata(scoped_refptr<CachedMetadata> cached_metadata) { … }
TEST(CachedMetadataTest, GetSerializedDataHeader) { … }
TEST(CachedMetadataTest, CreateFromBufferWithDataTypeIdAndTag) { … }
TEST(CachedMetadataTest, CreateFromSerializedDataBuffer) { … }
TEST(CachedMetadataTest, CreateFromSerializedDataVector) { … }
TEST(CachedMetadataTest, CreateFromSerializedDataBigBuffer) { … }
TEST(CachedMetadataTest, CreateFromSerializedDataTooSmall) { … }
TEST(CachedMetadataTest, CreateFromSerializedDataWithInvalidMarker) { … }
}
}