45 lines
1.5 KiB
C++
45 lines
1.5 KiB
C++
// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary
|
|
// source code may only be used and distributed under the Widevine License
|
|
// Agreement.
|
|
|
|
#ifndef WVCDM_CORE_TEST_MESSAGE_DUMPER_H_
|
|
#define WVCDM_CORE_TEST_MESSAGE_DUMPER_H_
|
|
|
|
#include <fstream>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
#include "log.h"
|
|
#include "wv_cdm_types.h"
|
|
|
|
namespace wvcdm {
|
|
|
|
class MessageDumper : public ::testing::Environment {
|
|
// This dumps messages to a file so that the data can easily be turned
|
|
// into golden data tests for the ODK library.
|
|
public:
|
|
~MessageDumper() override {}
|
|
void SetUp() override;
|
|
void TearDown() override;
|
|
|
|
static void PrintLicenseRequest(const CdmKeyRequest& request);
|
|
static void PrintLicenseResponse(const std::string& response);
|
|
static void DumpLicenseRequest(const CdmKeyRequest& request);
|
|
static void DumpLicense(const std::string& response);
|
|
static void DumpRenewalRequest(const CdmKeyRequest& request);
|
|
static void DumpRenewal(const std::string& response);
|
|
static void PrintProvisioningRequest(const CdmProvisioningRequest& request);
|
|
static void PrintProvisioningResponse(
|
|
const CdmProvisioningResponse& response);
|
|
static void DumpProvisioningRequest(const CdmProvisioningRequest& request);
|
|
static void DumpProvisioning(const CdmProvisioningResponse& response);
|
|
static std::ofstream license_file;
|
|
static std::ofstream renewal_file;
|
|
static std::ofstream provision_file;
|
|
};
|
|
} // namespace wvcdm
|
|
|
|
#endif // WVCDM_CORE_TEST_MESSAGE_DUMPER_H_
|