Generate golden data tests for ODK
Generate core message request and responses for golden data tests. This CL does not have any golden data. The golden data will be added to a google3 CL. To turn on dumping of golden data, set the environment variable DUMP_GOLDEN_DATA to "yes". Merged from https://widevine-internal-review.googlesource.com/171750 Change-Id: I7ae2d76ec7330d9131aae98dfd07b7909d10f726
This commit is contained in:
committed by
Robert Shih
parent
cebd90e300
commit
e9b0196a23
39
libwvdrmengine/cdm/core/test/message_dumper.h
Normal file
39
libwvdrmengine/cdm/core/test/message_dumper.h
Normal file
@@ -0,0 +1,39 @@
|
||||
// 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 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 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_
|
||||
Reference in New Issue
Block a user