Add a metric decorator around cdm engine
[ Merge from http://go/wvgerrit/69105 ] This adds a metric collecting decorator class around cdm engine. This implementation uses a templated decorator. The decorator enables: 1) Wrapping the CDM Engine methods to capture timing and error information. 2) Allows use of a mock CDM Engine for testing. Test: Unit tests. GPlay manual testing and GTS tests. BUG: http://b/64724336 Change-Id: I5e4a0f552974fab1939bc7ab02719a1f5849cf3f
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
#include "test_printers.h"
|
||||
#include "url_request.h"
|
||||
|
||||
using wvcdm::metrics::EngineMetrics;
|
||||
|
||||
namespace wvcdm {
|
||||
namespace {
|
||||
void show_menu(char* prog_name) {
|
||||
@@ -262,8 +264,10 @@ void WvCdmTestBase::Provision() {
|
||||
|
||||
CdmSessionId session_id;
|
||||
FileSystem file_system;
|
||||
|
||||
// TODO(fredgc): provision for different SPOIDs.
|
||||
CdmEngine cdm_engine(&file_system);
|
||||
CdmEngine cdm_engine(&file_system,
|
||||
std::shared_ptr<EngineMetrics>(new EngineMetrics));
|
||||
|
||||
CdmResponseType result = cdm_engine.GetProvisioningRequest(
|
||||
cert_type, cert_authority, config_.provisioning_service_certificate(),
|
||||
@@ -325,7 +329,8 @@ void WvCdmTestBase::Provision() {
|
||||
void WvCdmTestBase::EnsureProvisioned() {
|
||||
CdmSessionId session_id;
|
||||
FileSystem file_system;
|
||||
CdmEngine cdm_engine(&file_system);
|
||||
CdmEngine cdm_engine(&file_system,
|
||||
std::shared_ptr<EngineMetrics>(new EngineMetrics));
|
||||
CdmResponseType status =
|
||||
cdm_engine.OpenSession(config_.key_system(), NULL, NULL, &session_id);
|
||||
if (status == NEED_PROVISIONING) {
|
||||
|
||||
Reference in New Issue
Block a user