43 lines
1.3 KiB
C++
43 lines
1.3 KiB
C++
// Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary
|
|
// source code may only be used and distributed under the Widevine
|
|
// License Agreement.
|
|
//
|
|
// Test data for OEMCrypto unit tests.
|
|
//
|
|
#ifndef CDM_OEMCRYPTO_BASIC_TEST_
|
|
#define CDM_OEMCRYPTO_BASIC_TEST_
|
|
|
|
#include <vector>
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
#include "OEMCryptoCENC.h"
|
|
#include "oemcrypto_session_tests_helper.h"
|
|
|
|
namespace wvoec {
|
|
|
|
const char* HDCPCapabilityAsString(OEMCrypto_HDCP_Capability value);
|
|
|
|
std::string MaybeHex(const uint8_t* data, size_t length);
|
|
std::string MaybeHex(const std::vector<uint8_t>& data);
|
|
|
|
/** Tests for just basic client functionality. */
|
|
class OEMCryptoClientTest : public ::testing::Test, public SessionUtil {
|
|
protected:
|
|
OEMCryptoClientTest() {}
|
|
|
|
void SetUp() override;
|
|
void TearDown() override;
|
|
const uint8_t* find(const std::vector<uint8_t>& message,
|
|
const std::vector<uint8_t>& substring);
|
|
OEMCryptoResult CopyBuffer(
|
|
OEMCrypto_SESSION session, OEMCrypto_SharedMemory* input_buffer,
|
|
size_t input_buffer_size,
|
|
const OEMCrypto_DestBufferDesc* dest_buffer_descriptor,
|
|
uint8_t subsample_flags);
|
|
void RecordWvProperty(const std::string& key, const std::string& value);
|
|
};
|
|
} // namespace wvoec
|
|
|
|
#endif // CDM_OEMCRYPTO_BASIC_TEST_
|