Source release 19.4.0

This commit is contained in:
Vicky Min
2024-11-27 00:07:23 +00:00
parent 11c108a8da
commit 22759672a8
72 changed files with 5321 additions and 2622 deletions

View File

@@ -92,6 +92,7 @@
],
'xcode_settings': {
'BUNDLE_LOADER': '$(TEST_HOST)',
'INFOPLIST_FILE': 'test/info.plist',
'TEST_HOST': '<(PRODUCT_DIR)/dummy_app.app/dummy_app',
'WRAPPER_EXTENSION': 'xctest',
},

View File

@@ -200,7 +200,7 @@
],
}],
'conditions': [
['supports_dynamic_perf_test', {
['supports_dynamic_perf_test and prebuilt_cdm_path!=""', {
'targets': [{
'target_name': 'widevine_perf_test_xctest',
'type': 'loadable_module',

View File

@@ -10,7 +10,7 @@
# define CDM_VERSION_MAJOR 19
#endif
#ifndef CDM_VERSION_MINOR
# define CDM_VERSION_MINOR 3
# define CDM_VERSION_MINOR 4
#endif
#ifndef CDM_VERSION_PATCH
# define CDM_VERSION_PATCH 0

View File

@@ -53,6 +53,18 @@ using video_widevine::SignedMessage;
namespace {
const std::string kBuildInfoFields[] = {
"platform_version",
"platform",
"form_factor",
"arch_name",
"cdm_version",
"compiler_detected_arch_name",
"logging_enabled_message",
"build_flavor",
};
const std::string kBuildInfoDelimiter = " | ";
const int kHttpOk = 200;
const int kRenewalTestDelayMs = 3 * 60 * 1000;
@@ -526,6 +538,10 @@ class CdmTest : public WvCdmTestBase, public Cdm::IEventListener {
return Cdm::kQuotaExceeded;
}
void RecordWvProperty(const std::string& key, const std::string& value) {
RecordProperty("widevine_metadata_cdm_" + key, value);
}
std::unique_ptr<Cdm> cdm_;
};
@@ -618,22 +634,45 @@ TEST_F(CdmTest, PrintClientInformation) {
const time_t c_now =
std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
cout << "CE CDM Unit Tests for version " CDM_VERSION << endl;
RecordWvProperty("test_version", CDM_VERSION);
cout << "Tests run at " << std::put_time(localtime(&c_now), "%F %T %Z")
<< endl;
// Collect CDM info
Cdm::ClientInfo client_info;
ASSERT_EQ(Cdm::getClientInfo(&client_info), Cdm::kSuccess);
const char* const version = Cdm::version();
cout << endl << "CDM Information:" << endl;
cout << " CDM Version = " << Cdm::version() << endl;
cout << " CDM Version = " << version << endl;
RecordWvProperty("version", version);
cout << " Company Name = " << client_info.company_name << endl;
RecordWvProperty("company_name", client_info.company_name);
cout << " Model Name = " << client_info.model_name << endl;
RecordWvProperty("model_name", client_info.model_name);
cout << " Model Year = " << client_info.model_year << endl;
RecordWvProperty("model_year", client_info.model_year);
cout << " Device Name = " << client_info.device_name << endl;
RecordWvProperty("device_name", client_info.device_name);
cout << " Product Name = " << client_info.product_name << endl;
RecordWvProperty("product_name", client_info.product_name);
cout << " Arch Name = " << client_info.arch_name << endl;
RecordWvProperty("arch_name", client_info.arch_name);
cout << " Build Info = " << client_info.build_info << endl;
RecordWvProperty("build_info", client_info.build_info);
// Parse out and log the pieces of the build info
size_t start = 0;
for (const std::string& field : kBuildInfoFields) {
ASSERT_LT(start, client_info.build_info.size());
size_t end = client_info.build_info.find(kBuildInfoDelimiter, start);
if (end == std::string::npos) end = client_info.build_info.size();
const std::string value = client_info.build_info.substr(start, end - start);
EXPECT_FALSE(value.empty());
RecordWvProperty("build_info_" + field, value);
start = end + kBuildInfoDelimiter.length();
}
ASSERT_GE(start, client_info.build_info.size());
// Collect OEMCrypto info
ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_Initialize());
@@ -659,6 +698,8 @@ TEST_F(CdmTest, PrintClientInformation) {
std::string oec_build_info;
EXPECT_EQ(cdm_->getOemCryptoBuildInfo(&oec_build_info), Cdm::kSuccess);
// We don't log the OEMCrypto info through RecordProperty() because the
// OEMCrypto tests are responsible for that.
cout << endl << "OEMCrypto Information:" << endl;
cout << " OEMCrypto Version = " << oec_major << "." << oec_minor << endl;
cout << " Robustness Level = " << describe(robustness_level) << endl;

View File

@@ -49,12 +49,12 @@ const std::unordered_set<std::string> kGlobalFilenames = {
TestHost::TestHost() : global_storage_(true), per_origin_storage_(false) {
Reset();
}
TestHost::~TestHost() { wvutil::TestSleep::set_callback(nullptr); }
TestHost::~TestHost() { wvutil::TestSleep::RemoveCallback(this); }
void TestHost::Reset() {
auto now = std::chrono::system_clock().now();
now_ = now.time_since_epoch() / std::chrono::milliseconds(1);
wvutil::TestSleep::set_callback(this);
wvutil::TestSleep::AddCallback(this);
// Surprisingly, std::priority_queue has no clear().
while (!timers_.empty()) {