Make test URLs more external

This CL changes several test URLs so that they do not reference
internal test servers.

Copied from many CLs on the widevine side.

Change-Id: Ia0e6d6faa19e1841bacaf3b90043aca3a12aaf8a
This commit is contained in:
Fred Gylys-Colwell
2014-05-16 13:14:22 -07:00
parent 1dfd204f22
commit 86e73deb4c
4 changed files with 26 additions and 26 deletions

View File

@@ -112,6 +112,8 @@ struct LicenseInfo {
std::string file_data;
};
// Sample data to test storage and retrieval of license-related data
// The license data and URLs in this test are not real.
size_t kNumberOfLicenses = 3;
LicenseInfo license_test_data[] = {
// license 0
@@ -210,7 +212,7 @@ LicenseInfo license_test_data[] = {
"0112001A16200342120A106B63746C0000000000ECDCBE0000000020DBDF"
"A68F051A20182F029E35047A3841FA176C74E5B387350E8D58DEA6878FF0"
"BEA6CABACA1C2C"),
"https://jmt17.google.com/video-dev/license/GetCencLicense",
"https://test.google.com/license/GetCencLicense",
wvcdm::a2bs_hex(
"0AAF150802100122A8150801121408011210303132333435363738394142"
"434445461A9D0E080112950C0AD70B080112EF090AB002080212103E560E"
@@ -401,8 +403,7 @@ LicenseInfo license_test_data[] = {
"0112001A16200342120A106B63746C00000000CA3A6A75000000002083E5"
"A68F051A20BDA6A56F7CBFD0942198F87C23A34AA5CBD64AFEB134277774"
"CCF8E789D815DD"),
"https://www.youtube.com/api/drm/"
"widevine?video_id=03681262dc412c06&source=YOUTUBE",
"https://test.google.com/license/GetCencLicense",
wvcdm::a2bs_hex(
"0AC7150802100122C0150802121408011210303132333435363738394142"
"434445461A9D0E080112950C0AD70B080112EF090AB002080212103E560E"
@@ -594,7 +595,7 @@ LicenseInfo license_test_data[] = {
"0112001A16200342120A106B63746C000000001FF4944E000000002082E7"
"A68F051A2041EF0A9267D613D17AA90E1D1DA5BE091860E5E296D41D6D0F"
"75E73660C279B3"),
"http://hamid.kir.corp.google.com:8888/drm",
"https://test.google.com/license/GetCencLicense",
wvcdm::a2bs_hex(
"0A9F15080210012298150802121408011210303132333435363738394142"
"434445461A9D0E080112950C0AD70B080112EF090AB002080212103E560E"
@@ -786,9 +787,9 @@ LicenseInfo license_update_test_data[] = {
"0112001A16200342120A106B63746C0000000071FEF30B0000000020F4DF"
"B68F051A2000351030900858FCFD6977B67803ADFD1280AA661E6B0BD30B"
"08B2C467355129"),
"http://hamid.kir.corp.google.com:8888/drm",
"https://test.google.com/license/GetCencLicense",
wvcdm::a2bs_hex(
"0A9F15080210012298150801121408011210303132333435363738394142"
"0AA41508021001229D150801121408011210303132333435363738394142"
"434445461A9D0E080112950C0AD70B080112EF090AB002080212103E560E"
"C5335E346F591BC4D07A7D5076189EDFB68F05228E023082010A02820101"
"00CC1715C81AD3F6F279C686F826E6D7C8961EB13318367D06B4061BBC57"
@@ -877,14 +878,16 @@ LicenseInfo license_update_test_data[] = {
"32610802123B0A190A09393837363534333231120892BE96420F0D5BF320"
"02280112001A16200342120A106B63746C0000000071FEF30B0000000020"
"F4DFB68F051A2000351030900858FCFD6977B67803ADFD1280AA661E6B0B"
"D30B08B2C4673551293A29687474703A2F2F68616D69642E6B69722E636F"
"72702E676F6F676C652E636F6D3A383838382F64726D1220E9BF6AE79B64"
"B788838B5EDDEBEF9E20FD8CFFDEB037DEFEE982DF21A2D32031")},
"D30B08B2C4673551293A2E68747470733A2F2F746573742E676F6F676C65"
"2E636F6D2F6C6963656E73652F47657443656E634C6963656E736512200A"
"1C78D0E574D0827C3AE78A05EEC90BAC31D10686EC19EB0599F75B2D1AB4"
"C5"
)},
// license being released. all fields are identical except for license
// state and hashed file data
{"", DeviceFiles::kLicenseStateReleasing, "", "", "", "", "", "",
wvcdm::a2bs_hex(
"0A9F15080210012298150802121408011210303132333435363738394142"
"0AA41508021001229D150802121408011210303132333435363738394142"
"434445461A9D0E080112950C0AD70B080112EF090AB002080212103E560E"
"C5335E346F591BC4D07A7D5076189EDFB68F05228E023082010A02820101"
"00CC1715C81AD3F6F279C686F826E6D7C8961EB13318367D06B4061BBC57"
@@ -973,9 +976,10 @@ LicenseInfo license_update_test_data[] = {
"32610802123B0A190A09393837363534333231120892BE96420F0D5BF320"
"02280112001A16200342120A106B63746C0000000071FEF30B0000000020"
"F4DFB68F051A2000351030900858FCFD6977B67803ADFD1280AA661E6B0B"
"D30B08B2C4673551293A29687474703A2F2F68616D69642E6B69722E636F"
"72702E676F6F676C652E636F6D3A383838382F64726D1220003650AD34C0"
"CB1D348F83B6694E4983DA8BCF9AEFAA4A4B23022DA08CF3DA44")}};
"D30B08B2C4673551293A2E68747470733A2F2F746573742E676F6F676C65"
"2E636F6D2F6C6963656E73652F47657443656E634C6963656E736512208F"
"7186A244EF561E3B07DC459BC681A0798B180667EA448327F6BBBD30212A"
"49")}};
} // namespace

View File

@@ -8,6 +8,7 @@
#include "url_request.h"
namespace {
// Arbitrary URL for tests.
const std::string kHttpsTestServer("https://www.google.com");
std::string gTestServer(kHttpsTestServer);
std::string gTestData("Hello");
@@ -122,14 +123,15 @@ TEST_F(HttpSocketTest, GetDomainNameAndPathFromUrlTest) {
EXPECT_TRUE(domain_name_.empty());
EXPECT_TRUE(resource_path_.empty());
socket_.GetDomainNameAndPathFromUrl("http://10.21.200.68:8888/drm",
// Test with arbitrary numeric URL
socket_.GetDomainNameAndPathFromUrl("http://10.11.12.13:8888/drm",
domain_name_, resource_path_);
EXPECT_STREQ("10.21.200.68", domain_name_.c_str());
EXPECT_STREQ("10.11.12.13", domain_name_.c_str());
EXPECT_STREQ("drm", resource_path_.c_str());
socket_.GetDomainNameAndPathFromUrl("http://10.21.200.68:8888", domain_name_,
socket_.GetDomainNameAndPathFromUrl("http://10.11.12.13:8888", domain_name_,
resource_path_);
EXPECT_STREQ("10.21.200.68", domain_name_.c_str());
EXPECT_STREQ("10.11.12.13", domain_name_.c_str());
EXPECT_TRUE(resource_path_.empty());
}

View File

@@ -48,7 +48,6 @@ void LicenseRequest::GetDrmMessage(const std::string& response,
// non-Google Play webservers. Need to clean this up. Possibly test
// for GLS and decide which part is the drm message
drm_msg = response.substr(header_end_pos);
LOGE("drm msg not found");
}
} else {
LOGE("response body not found");
@@ -82,5 +81,4 @@ void LicenseRequest::GetHeartbeatUrl(const std::string& response,
}
}
} // namespace wvcdm

View File

@@ -56,8 +56,10 @@ class PolicyEngineTest : public ::testing::Test {
policy->set_license_duration_seconds(license_duration_);
policy->set_renewal_recovery_duration_seconds(license_duration_ -
license_renewal_delay_); // 10 minutes
// Note: not a real URL - used for testing Policy/PolicyEngine interfaces
policy->set_renewal_server_url(
"https://jmt17.google.com/video-dev/license/GetCencLicense");
"https://test.google.com/license/GetCencLicense");
policy->set_renewal_delay_seconds(license_renewal_delay_);
policy->set_renewal_retry_interval_seconds(
license_renewal_retry_interval_);
@@ -151,9 +153,6 @@ TEST_F(PolicyEngineTest, PlaybackFails_RentalDurationExpired) {
EXPECT_FALSE(policy_engine_->can_decrypt());
}
// TODO(edwinwong, rfrias): tests needed when begin license usage when received
// is enabled
TEST_F(PolicyEngineTest, PlaybackFails_PlaybackDurationExpired) {
EXPECT_CALL(*mock_clock_, GetCurrentTime())
.WillOnce(Return(license_start_time_ + 1))
@@ -321,9 +320,6 @@ TEST_F(PolicyEngineTest, PlaybackOk_Durations0) {
EXPECT_TRUE(policy_engine_->can_decrypt());
}
// TODO(edwinwong, rfrias): renewal url test needed
TEST_F(PolicyEngineTest, PlaybackFailed_CanRenewFalse) {
EXPECT_CALL(*mock_clock_, GetCurrentTime())
.WillOnce(Return(license_start_time_ + 1))