Files
android/libwvdrmengine/cdm/core/test/message_dumper.h
Vicky Min 4129b3ac9f Cherry pick 18.4 changes to udc-widevine-dev
Get the udc-widevine-dev Android branch and oemcrypto-v18 cdm branch in
sync. The commit ID for 18.4 on oemcrypto-v18 is
https://widevine-internal.git.corp.google.com/cdm/+/a2f23a2281e5e06dc2867585bdc516fa132b639.

Merged from go/wvgerrit/190151

Bug: 290252845
Test: unit tests passing on Panther device
Change-Id: I63fa3f1c784f737ca1480e5febe4f3f5a8a49948
2024-02-05 18:08:40 +00:00

40 lines
1.2 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 <gtest/gtest.h>
#include <fstream>
#include <string>
#include <vector>
#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_