Merge "Test renewal against same and different server"

This commit is contained in:
TreeHugger Robot
2020-08-19 20:47:27 +00:00
committed by Android (Google) Code Review
2 changed files with 19 additions and 5 deletions

View File

@@ -402,14 +402,26 @@ TEST_F(WvCdmEngineTest, LoadKey) {
holder.SignAndLoadLicense();
}
TEST_F(WvCdmEngineTest, LicenseRenewal) {
// This test generates a renewal and then requests the renewal using the server
// url specified in the license. This is what most apps would do, but you should
// skip this test when you want to set the license and renewal server on the
// command line.
TEST_F(WvCdmEngineTest, LicenseRenewalSpecifiedServer) {
GenerateKeyRequest(binary_key_id(), kCencMimeType);
VerifyNewKeyResponse(config_.license_server(), config_.client_auth());
GenerateRenewalRequest();
VerifyRenewalKeyResponse(
server_url_.empty() ? config_.license_server() : server_url_,
config_.client_auth());
VerifyRenewalKeyResponse(server_url_, config_.client_auth());
}
// This test generates a renewal and then requests the renewal from the same
// server from which we requested the original license.
TEST_F(WvCdmEngineTest, LicenseRenewalSameServer) {
GenerateKeyRequest(binary_key_id(), kCencMimeType);
VerifyNewKeyResponse(config_.license_server(), config_.client_auth());
GenerateRenewalRequest();
VerifyRenewalKeyResponse(config_.license_server(), config_.client_auth());
}
TEST_F(WvCdmEngineTest, ParseDecryptHashStringTest) {

View File

@@ -117,7 +117,9 @@ bool UrlRequest::GetResponse(std::string* message) {
}
ConcatenateChunkedResponse(response, message);
LOGV("HTTP response: (%d): %s", message->size(), message->c_str());
LOGV("HTTP response from %s://%s:%d%s: (%zd): %s", socket_.scheme().c_str(),
socket_.domain_name().c_str(), socket_.port(),
socket_.resource_path().c_str(), message->size(), message->c_str());
return true;
}