#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/cdm/cenc_decryptor.h"
#include <stdint.h>
#include <algorithm>
#include <string>
#include <vector>
#include "base/containers/span.h"
#include "base/time/time.h"
#include "crypto/encryptor.h"
#include "crypto/symmetric_key.h"
#include "media/base/decoder_buffer.h"
#include "media/base/decrypt_config.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media {
namespace {
const uint8_t kKey[] = …;
static_assert …;
const uint8_t kIv[] = …;
static_assert …;
const uint8_t kOneBlock[] = …;
const uint8_t kPartialBlock[] = …;
std::string MakeString(const std::vector<uint8_t>& chars) { … }
std::vector<uint8_t> Combine(const std::vector<std::vector<uint8_t>>& inputs) { … }
std::vector<uint8_t> Repeat(const std::vector<uint8_t>& input, size_t count) { … }
}
class CencDecryptorTest : public testing::Test { … };
TEST_F(CencDecryptorTest, OneBlock) { … }
TEST_F(CencDecryptorTest, ExtraData) { … }
TEST_F(CencDecryptorTest, NoSubsamples) { … }
TEST_F(CencDecryptorTest, BadSubsamples) { … }
TEST_F(CencDecryptorTest, InvalidIv) { … }
TEST_F(CencDecryptorTest, InvalidKey) { … }
TEST_F(CencDecryptorTest, PartialBlock) { … }
TEST_F(CencDecryptorTest, MultipleSubsamples) { … }
TEST_F(CencDecryptorTest, MultipleSubsamplesWithClearBytes) { … }
}