This is a merge from the widevine repository of http://go/wvgerrit/13923 Switch openssl to use the EVP interface for aes-ctr-128 http://go/wvgerrit/13979 Add Test Certificate to OEMCrypto Mock http://go/wvgerrit/13978 Add Test Keybox to Level 3 OEMCrypto http://go/wvgerrit/13873 Enable OEMCrypto Unit Tests This CL adds a main program to oemcrypto_test.cpp, which filters out tests that are not supported on the specified platform. It also adds LoadTestKeybox to the mock. This allows oemcrypto unit tests to be run on devices that have production keybox. It also allows the same set of unit tests to work on Android and on non-Android platforms. b/18962381 Use test certificate (partial fix) b/19867990 Separate cast receiver tests Change-Id: If89c31530103ed85aa37d7379bd5b4dc2a927f38
44 lines
1.3 KiB
C++
44 lines
1.3 KiB
C++
#include <gtest/gtest.h>
|
|
#include <iostream>
|
|
|
|
#include "log.h"
|
|
#include "oemcrypto_test.h"
|
|
#include "OEMCryptoCENC.h"
|
|
#include "properties.h"
|
|
|
|
static void acknowledge_cast() {
|
|
std::cout
|
|
<< "==================================================================\n"
|
|
<< "= This device is expected to load x509 certs as a cast receiver. =\n"
|
|
<< "==================================================================\n";
|
|
}
|
|
|
|
int main(int argc, char** argv) {
|
|
::testing::InitGoogleTest(&argc, argv);
|
|
wvcdm::Properties::Init();
|
|
wvcdm::g_cutoff = wvcdm::LOG_INFO;
|
|
bool is_cast_receiver = false;
|
|
bool force_load_test_keybox = false;
|
|
bool filter_tests = true;
|
|
for(int i=0; i < argc; i++) {
|
|
if (!strcmp(argv[i], "--cast")) {
|
|
acknowledge_cast();
|
|
is_cast_receiver = true;
|
|
}
|
|
if (!strcmp(argv[i], "--force_load_test_keybox")) {
|
|
force_load_test_keybox = true;
|
|
}
|
|
if (!strcmp(argv[i], "--no_filter")) {
|
|
filter_tests = false;
|
|
}
|
|
}
|
|
wvoec::global_features.Initialize(is_cast_receiver, force_load_test_keybox);
|
|
// If the user requests --no_filter, we don't change the filter, otherwise, we
|
|
// filter out features that are not supported.
|
|
if (filter_tests) {
|
|
::testing::GTEST_FLAG(filter)
|
|
= wvoec::global_features.RestrictFilter(::testing::GTEST_FLAG(filter));
|
|
}
|
|
return RUN_ALL_TESTS();
|
|
}
|