| Index: media/cdm/cdm_adapter_unittest.cc
|
| diff --git a/media/cdm/cdm_adapter_unittest.cc b/media/cdm/cdm_adapter_unittest.cc
|
| index efeac87fd4a5f2944448d95d281536a47867a584..bc11ad533b5b64323a5d68108518e3407dac624a 100644
|
| --- a/media/cdm/cdm_adapter_unittest.cc
|
| +++ b/media/cdm/cdm_adapter_unittest.cc
|
| @@ -29,7 +29,7 @@ MATCHER(IsNotEmpty, "") {
|
| namespace media {
|
|
|
| // Random key ID used to create a session.
|
| -const uint8 kKeyId[] = {
|
| +const uint8_t kKeyId[] = {
|
| // base64 equivalent is AQIDBAUGBwgJCgsMDQ4PEA
|
| 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
|
| 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
|
| @@ -37,7 +37,7 @@ const uint8 kKeyId[] = {
|
|
|
| const char kKeyIdAsJWK[] = "{\"kids\": [\"AQIDBAUGBwgJCgsMDQ4PEA\"]}";
|
|
|
| -const uint8 kKeyIdAsPssh[] = {
|
| +const uint8_t kKeyIdAsPssh[] = {
|
| 0x00, 0x00, 0x00, 0x00, 'p', 's', 's', 'h', // size = 0
|
| 0x01, // version = 1
|
| 0x00, 0x00, 0x00, // flags
|
| @@ -97,7 +97,7 @@ class CdmAdapterTest : public testing::Test {
|
| // when the promise is resolved. |expected_result| tests that
|
| // CreateSessionAndGenerateRequest() succeeds or generates an error.
|
| void CreateSessionAndExpect(EmeInitDataType data_type,
|
| - const std::vector<uint8>& key_id,
|
| + const std::vector<uint8_t>& key_id,
|
| ExpectedResult expected_result) {
|
| DCHECK(!key_id.empty());
|
|
|
| @@ -141,7 +141,7 @@ class CdmAdapterTest : public testing::Test {
|
| }
|
|
|
| adapter_->UpdateSession(session_id,
|
| - std::vector<uint8>(key.begin(), key.end()),
|
| + std::vector<uint8_t>(key.begin(), key.end()),
|
| CreatePromise(expected_result));
|
| RunUntilIdle();
|
| }
|
| @@ -203,7 +203,7 @@ class CdmAdapterTest : public testing::Test {
|
| MOCK_METHOD1(OnResolveWithSession, void(const std::string& session_id));
|
| MOCK_METHOD3(OnReject,
|
| void(MediaKeys::Exception exception_code,
|
| - uint32 system_code,
|
| + uint32_t system_code,
|
| const std::string& error_message));
|
|
|
| // Methods used for the events possibly generated by CdmAdapater.
|
| @@ -257,7 +257,7 @@ TEST_F(CdmAdapterTest, BadLibraryPath) {
|
| TEST_F(CdmAdapterTest, CreateWebmSession) {
|
| InitializeAndExpect(ExternalClearKeyLibrary(), SUCCESS);
|
|
|
| - std::vector<uint8> key_id(kKeyId, kKeyId + arraysize(kKeyId));
|
| + std::vector<uint8_t> key_id(kKeyId, kKeyId + arraysize(kKeyId));
|
| CreateSessionAndExpect(EmeInitDataType::WEBM, key_id, SUCCESS);
|
| }
|
|
|
| @@ -265,16 +265,16 @@ TEST_F(CdmAdapterTest, CreateKeyIdsSession) {
|
| InitializeAndExpect(ExternalClearKeyLibrary(), SUCCESS);
|
|
|
| // Don't include the trailing /0 from the string in the data passed in.
|
| - std::vector<uint8> key_id(kKeyIdAsJWK,
|
| - kKeyIdAsJWK + arraysize(kKeyIdAsJWK) - 1);
|
| + std::vector<uint8_t> key_id(kKeyIdAsJWK,
|
| + kKeyIdAsJWK + arraysize(kKeyIdAsJWK) - 1);
|
| CreateSessionAndExpect(EmeInitDataType::KEYIDS, key_id, SUCCESS);
|
| }
|
|
|
| TEST_F(CdmAdapterTest, CreateCencSession) {
|
| InitializeAndExpect(ExternalClearKeyLibrary(), SUCCESS);
|
|
|
| - std::vector<uint8> key_id(kKeyIdAsPssh,
|
| - kKeyIdAsPssh + arraysize(kKeyIdAsPssh));
|
| + std::vector<uint8_t> key_id(kKeyIdAsPssh,
|
| + kKeyIdAsPssh + arraysize(kKeyIdAsPssh));
|
| #if defined(USE_PROPRIETARY_CODECS)
|
| CreateSessionAndExpect(EmeInitDataType::CENC, key_id, SUCCESS);
|
| #else
|
| @@ -286,7 +286,7 @@ TEST_F(CdmAdapterTest, CreateSessionWithBadData) {
|
| InitializeAndExpect(ExternalClearKeyLibrary(), SUCCESS);
|
|
|
| // Use |kKeyId| but specify KEYIDS format.
|
| - std::vector<uint8> key_id(kKeyId, kKeyId + arraysize(kKeyId));
|
| + std::vector<uint8_t> key_id(kKeyId, kKeyId + arraysize(kKeyId));
|
| CreateSessionAndExpect(EmeInitDataType::KEYIDS, key_id, FAILURE);
|
| }
|
|
|
| @@ -294,14 +294,14 @@ TEST_F(CdmAdapterTest, LoadSession) {
|
| InitializeAndExpect(ExternalClearKeyLibrary(), SUCCESS);
|
|
|
| // LoadSession() is not supported by AesDecryptor.
|
| - std::vector<uint8> key_id(kKeyId, kKeyId + arraysize(kKeyId));
|
| + std::vector<uint8_t> key_id(kKeyId, kKeyId + arraysize(kKeyId));
|
| CreateSessionAndExpect(EmeInitDataType::KEYIDS, key_id, FAILURE);
|
| }
|
|
|
| TEST_F(CdmAdapterTest, UpdateSession) {
|
| InitializeAndExpect(ExternalClearKeyLibrary(), SUCCESS);
|
|
|
| - std::vector<uint8> key_id(kKeyId, kKeyId + arraysize(kKeyId));
|
| + std::vector<uint8_t> key_id(kKeyId, kKeyId + arraysize(kKeyId));
|
| CreateSessionAndExpect(EmeInitDataType::WEBM, key_id, SUCCESS);
|
|
|
| UpdateSessionAndExpect(SessionId(), kKeyAsJWK, SUCCESS, true);
|
| @@ -310,7 +310,7 @@ TEST_F(CdmAdapterTest, UpdateSession) {
|
| TEST_F(CdmAdapterTest, UpdateSessionWithBadData) {
|
| InitializeAndExpect(ExternalClearKeyLibrary(), SUCCESS);
|
|
|
| - std::vector<uint8> key_id(kKeyId, kKeyId + arraysize(kKeyId));
|
| + std::vector<uint8_t> key_id(kKeyId, kKeyId + arraysize(kKeyId));
|
| CreateSessionAndExpect(EmeInitDataType::WEBM, key_id, SUCCESS);
|
|
|
| UpdateSessionAndExpect(SessionId(), "random data", FAILURE, true);
|
|
|