#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/cdm/library_cdm/clear_key_cdm/cdm_file_io_test.h"
#include <algorithm>
#include <limits>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
namespace media {
#define FILE_IO_DVLOG(level) …
const uint8_t kData[] = …;
const uint32_t kDataSize = …;
const uint8_t kBigData[] = …;
const uint32_t kBigDataSize = …;
const uint32_t kLargeDataSize = …;
#define START_TEST_CASE(test_name) …
#define ADD_TEST_STEP(type, status, data, data_size) …
#define END_TEST_CASE …
#define CREATE_FILE_IO …
#define OPEN_FILE …
#define EXPECT_FILE_OPENED(status) …
#define READ_FILE …
#define EXPECT_FILE_READ(status, data, data_size) …
#define EXPECT_FILE_READ_EITHER(status, data, data_size, data2, data2_size) …
#define WRITE_FILE(data, data_size) …
#define EXPECT_FILE_WRITTEN(status) …
#define CLOSE_FILE …
FileIOTestRunner::FileIOTestRunner(const CreateFileIOCB& create_file_io_cb)
: … { … }
FileIOTestRunner::~FileIOTestRunner() { … }
void FileIOTestRunner::AddTests() { … }
void FileIOTestRunner::RunAllTests(CompletionCB completion_cb) { … }
void FileIOTestRunner::RunNextTest() { … }
void FileIOTestRunner::OnTestComplete(bool success) { … }
FileIOTest::FileIOTest(const CreateFileIOCB& create_file_io_cb,
const std::string& test_name)
: … { … }
FileIOTest::~FileIOTest() = default;
void FileIOTest::AddTestStep(StepType type,
Status status,
const uint8_t* data,
uint32_t data_size) { … }
void FileIOTest::AddResultReadEither(Status status,
const uint8_t* data,
uint32_t data_size,
const uint8_t* data2,
uint32_t data2_size) { … }
void FileIOTest::Run(CompletionCB completion_cb) { … }
void FileIOTest::OnOpenComplete(Status status) { … }
void FileIOTest::OnReadComplete(Status status,
const uint8_t* data,
uint32_t data_size) { … }
void FileIOTest::OnWriteComplete(Status status) { … }
bool FileIOTest::IsResult(const TestStep& test_step) { … }
bool FileIOTest::MatchesResult(const TestStep& a, const TestStep& b) { … }
void FileIOTest::RunNextStep() { … }
void FileIOTest::OnResult(const TestStep& result) { … }
bool FileIOTest::CheckResult(const TestStep& result) { … }
void FileIOTest::OnTestComplete(bool success) { … }
}