Source release 19.5.0

This commit is contained in:
Cong Lin
2025-04-02 10:27:18 -07:00
parent 4407acee62
commit f7ec4fdeff
295 changed files with 32196 additions and 21748 deletions

View File

@@ -24,7 +24,7 @@
#include "test_base.h"
#include "test_host.h"
using namespace widevine;
using namespace CDM_NAMESPACE;
// TODO(b/195338975): document how a partner should modify this so that they can
// use a real host.

View File

@@ -46,7 +46,7 @@ using namespace testing;
using namespace wvcdm;
using namespace wvutil;
namespace widevine {
namespace CDM_NAMESPACE {
using video_widevine::LicenseError;
using video_widevine::SignedMessage;
@@ -2815,4 +2815,4 @@ TEST_F(CdmProv40IndividualizationTest, IsProvisioned) {
} // namespace
} // namespace widevine
} // namespace CDM_NAMESPACE

View File

@@ -16,7 +16,7 @@
#include "test_base.h"
#include "test_host.h"
using namespace widevine;
using namespace CDM_NAMESPACE;
TestHost* g_host = nullptr;

View File

@@ -4,7 +4,7 @@
#include "cdm_test_printers.h"
namespace widevine {
namespace CDM_NAMESPACE {
void PrintTo(const Cdm::MessageType& value, ::std::ostream* os) {
switch (value) {
@@ -115,4 +115,4 @@ void PrintTo(const Cdm::KeyStatus& value, ::std::ostream* os) {
}
}
} // namespace widevine
} // namespace CDM_NAMESPACE

View File

@@ -10,12 +10,12 @@
#include <iostream>
#include "cdm.h"
namespace widevine {
namespace CDM_NAMESPACE {
void PrintTo(const Cdm::MessageType& value, ::std::ostream* os);
void PrintTo(const Cdm::Status& value, ::std::ostream* os);
void PrintTo(const Cdm::KeyStatus& value, ::std::ostream* os);
} // namespace widevine
} // namespace CDM_NAMESPACE
#endif // WVCDM_CDM_TEST_CDM_TEST_PRINTERS_H_

View File

@@ -19,10 +19,10 @@
#include "test_base.h"
#include "test_host.h"
widevine::StderrLogger g_stderr_logger;
CDM_NAMESPACE::StderrLogger g_stderr_logger;
std::string g_sandbox_id;
namespace widevine {
namespace CDM_NAMESPACE {
namespace {
constexpr char kSandboxIdParam[] = "--sandbox_id=";
constexpr char kCertPathParam[] = "--cert_path=";
@@ -121,4 +121,4 @@ int Main(Cdm::IStorage* storage, Cdm::IClock* clock, Cdm::ITimer* timer,
return RUN_ALL_TESTS();
}
} // namespace widevine
} // namespace CDM_NAMESPACE

View File

@@ -8,13 +8,13 @@
#include <iostream>
#include "cdm.h"
namespace widevine {
namespace CDM_NAMESPACE {
// Run all CDM tests using the specified storage, clock, and timer. It parses
// standard command line arguments, sets some default test client info,
// initializes a CDM object, and then runs all the tests.
// Returns 0 on success.
int Main(Cdm::IStorage* storage, Cdm::IClock* clock, Cdm::ITimer* timer,
Cdm::ILogger* logger, int argc, char** argv);
} // namespace widevine
} // namespace CDM_NAMESPACE
#endif // WVCDM_CDM_TEST_CDM_TEST_RUNNER_H_

View File

@@ -30,9 +30,9 @@
#define WALL_NOW std::chrono::high_resolution_clock::now()
TestHost* g_host = nullptr;
widevine::StderrLogger g_stderr_logger;
CDM_NAMESPACE::StderrLogger g_stderr_logger;
namespace widevine {
namespace CDM_NAMESPACE {
namespace {
@@ -342,4 +342,4 @@ int PerfTestMain(InitFuncType init_func, CreateFuncType create) {
#endif
}
} // namespace widevine
} // namespace CDM_NAMESPACE

View File

@@ -9,7 +9,7 @@
#include "cdm.h"
namespace widevine {
namespace CDM_NAMESPACE {
using InitFuncType = Cdm::Status (*)(Cdm::SecureOutputType, Cdm::IStorage*,
Cdm::IClock*, Cdm::ITimer*, Cdm::ILogger*,
@@ -19,6 +19,6 @@ using CreateFuncType =
int PerfTestMain(InitFuncType init_func, CreateFuncType create_func);
} // namespace widevine
} // namespace CDM_NAMESPACE
#endif // WVCDM_CDM_TEST_PERF_TEST_H_

View File

@@ -16,7 +16,7 @@
#include "perf_test.h"
#include "test_host.h"
namespace widevine {
namespace CDM_NAMESPACE {
constexpr char kInitName[] =
"_ZN8widevine3Cdm10initializeENS0_16SecureOutputTypeEPNS0_8IStorageEPNS0_"
@@ -42,7 +42,7 @@ std::tuple<InitFuncType, CreateFuncType> LoadCdm(const char* path) {
return std::make_tuple(init, create);
}
} // namespace widevine
} // namespace CDM_NAMESPACE
namespace wvutil {
@@ -57,6 +57,6 @@ int main(int argc, char** argv) {
return 1;
}
auto funcs = widevine::LoadCdm(argv[1]);
return widevine::PerfTestMain(std::get<0>(funcs), std::get<1>(funcs));
auto funcs = CDM_NAMESPACE::LoadCdm(argv[1]);
return CDM_NAMESPACE::PerfTestMain(std::get<0>(funcs), std::get<1>(funcs));
}

View File

@@ -20,7 +20,8 @@
int argc = 1;
testing::InitGoogleTest(&argc, argv);
XCTAssertEqual(widevine::PerfTestMain(&widevine::Cdm::initialize, &widevine::Cdm::create), 0);
XCTAssertEqual(
CDM_NAMESPACE::PerfTestMain(&CDM_NAMESPACE::Cdm::initialize, &CDM_NAMESPACE::Cdm::create), 0);
}
@end

View File

@@ -12,7 +12,7 @@
#include "file_store.h"
#include "log.h"
using namespace widevine;
using namespace CDM_NAMESPACE;
using video_widevine_client::sdk::SavedStorage;
namespace {

View File

@@ -16,11 +16,11 @@
// This provides a host environment for running CDM tests. It implements the
// IStorage, IClock and ITimer interfaces that a host would normally implement,
// while allowing them to be manipulated by the test.
class TestHost : public widevine::Cdm::IClock,
public widevine::Cdm::ITimer,
class TestHost : public CDM_NAMESPACE::Cdm::IClock,
public CDM_NAMESPACE::Cdm::ITimer,
public wvutil::TestSleep::CallBack {
public:
class Storage : public widevine::Cdm::IStorage {
class Storage : public CDM_NAMESPACE::Cdm::IStorage {
public:
typedef std::map<std::string, std::string> StorageMap;
@@ -36,7 +36,7 @@ class TestHost : public widevine::Cdm::IClock,
void ResetFiles(const StorageMap& files) { files_ = files; };
const StorageMap& files() const { return files_; }
// widevine::Cdm::IStorage
// CDM_NAMESPACE::Cdm::IStorage
bool read(const std::string& name, std::string* data) override;
bool write(const std::string& name, const std::string& data) override;
bool exists(const std::string& name) override;
@@ -62,10 +62,10 @@ class TestHost : public widevine::Cdm::IClock,
Storage& global_storage() { return global_storage_; }
Storage& per_origin_storage() { return per_origin_storage_; }
// widevine::Cdm::IClock
// CDM_NAMESPACE::Cdm::IClock
int64_t now() override;
// widevine::Cdm::ITimer
// CDM_NAMESPACE::Cdm::ITimer
void setTimeout(int64_t delay_ms, IClient* client, void* context) override;
void cancel(IClient* client) override;
@@ -107,7 +107,7 @@ class TestHost : public widevine::Cdm::IClock,
// Owned and managed by the test runner.
extern TestHost* g_host;
extern widevine::StderrLogger g_stderr_logger;
extern CDM_NAMESPACE::StderrLogger g_stderr_logger;
extern std::string g_sandbox_id;
#endif // WVCDM_CDM_TEST_TEST_HOST_H_

View File

@@ -15,9 +15,9 @@ int main(int argc, char** argv) {
const char* bundle_version = argv[1];
fprintf(stderr, "Header: " CDM_VERSION "\n");
fprintf(stderr, "Library: %s\n", widevine::Cdm::version());
fprintf(stderr, "Library: %s\n", CDM_NAMESPACE::Cdm::version());
fprintf(stderr, "Bundle: %s\n", bundle_version);
if (strcmp(CDM_VERSION, widevine::Cdm::version()) ||
if (strcmp(CDM_VERSION, CDM_NAMESPACE::Cdm::version()) ||
strcmp(CDM_VERSION, bundle_version)) {
fprintf(stderr, "ERROR: Mismatched version\n");
return 1;

View File

@@ -17,10 +17,10 @@
- (void)testVersion {
fprintf(stderr, "Header: " CDM_VERSION "\n");
fprintf(stderr, "Library: %s\n", widevine::Cdm::version());
fprintf(stderr, "Library: %s\n", CDM_NAMESPACE::Cdm::version());
fprintf(stderr, "Bundle: " EXPECTED_CDM_VERSION "\n");
XCTAssertEqual(STR(CDM_VERSION), STR(widevine::Cdm::version()));
XCTAssertEqual(STR(CDM_VERSION), STR(CDM_NAMESPACE::Cdm::version()));
XCTAssertEqual(STR(CDM_VERSION), STR(EXPECTED_CDM_VERSION));
}