chromium/media/cdm/library_cdm/clear_key_cdm/cdm_file_io_test.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#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 =;

// Must be > kReadSize in cdm_file_io_impl.cc.
const uint32_t kLargeDataSize =;

// Macros to help add test cases/steps.

// |test_name| is also used as the file name. File name validity tests relies
// on this to work.
#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 implementation.

FileIOTestRunner::FileIOTestRunner(const CreateFileIOCB& create_file_io_cb)
    :{}

FileIOTestRunner::~FileIOTestRunner() {}

// Note: Consecutive expectations (EXPECT*) can happen in any order.
void FileIOTestRunner::AddTests() {}

void FileIOTestRunner::RunAllTests(CompletionCB completion_cb) {}

void FileIOTestRunner::RunNextTest() {}

void FileIOTestRunner::OnTestComplete(bool success) {}

// FileIOTest implementation.

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) {}

}  // namespace media