Files
ce_cdm/cdm/test/cdm_test_main.cpp
John "Juce" Bruce b2c35151ad Source release 18.1.0
2023-06-23 15:45:08 -07:00

45 lines
1.3 KiB
C++

// Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary
// source code may only be used and distributed under the Widevine License
// Agreement.
#include <assert.h>
#include <gtest/gtest.h>
#include <string.h>
#include <time.h>
#include <algorithm>
#include <string>
#include <vector>
#include "cdm.h"
#include "cdm_test_runner.h"
#include "log.h"
#include "test_base.h"
#include "test_host.h"
using namespace widevine;
TestHost* g_host = nullptr;
int main(int argc, char** argv) {
g_host = new TestHost();
// TODO(b/195338975): document that using a real IStorage means you should not
// run the tests in $CDM_DIR/cdm/test/cdm_test.cpp
// Partners will want to replace this with a real IStorage.
Cdm::IStorage* const storage = &g_host->global_storage();
// Partners may also want to replace this with real implementations of IClock
// and ITimer. If so, make not to set the command line argument
// "--fake_sleep".
Cdm::IClock* const clock = g_host;
Cdm::ITimer* const timer = g_host;
// Partners who prefer their logs to go somewhere other than stderr may want
// to replace this implementation.
Cdm::ILogger* const logger = &g_stderr_logger;
const int test_results = Main(storage, clock, timer, logger, argc, argv);
return test_results;
}