Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Unified Diff: media/cdm/aes_decryptor_unittest.cc

Issue 1100763002: Inject CanAddURLToHistory into TopSitesImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs
Patch Set: Fix error introduced during rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cdm/aes_decryptor.cc ('k') | media/cdm/cenc_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cdm/aes_decryptor_unittest.cc
diff --git a/media/cdm/aes_decryptor_unittest.cc b/media/cdm/aes_decryptor_unittest.cc
index 3f26239765550b06e72297c5df1f9fc75e7d1171..6fd8cec7873e04d70fbcce08968f67b12b63eda5 100644
--- a/media/cdm/aes_decryptor_unittest.cc
+++ b/media/cdm/aes_decryptor_unittest.cc
@@ -285,9 +285,9 @@ class AesDecryptorTest : public testing::Test {
DCHECK(!key_id.empty());
EXPECT_CALL(*this, OnSessionMessage(IsNotEmpty(), _, IsJSONDictionary(),
GURL::EmptyGURL()));
- decryptor_.CreateSessionAndGenerateRequest(
- MediaKeys::TEMPORARY_SESSION, EmeInitDataType::WEBM, &key_id[0],
- key_id.size(), CreateSessionPromise(RESOLVED));
+ decryptor_.CreateSessionAndGenerateRequest(MediaKeys::TEMPORARY_SESSION,
+ EmeInitDataType::WEBM, key_id,
+ CreateSessionPromise(RESOLVED));
// This expects the promise to be called synchronously, which is the case
// for AesDecryptor.
return session_id_;
@@ -335,8 +335,7 @@ class AesDecryptorTest : public testing::Test {
}
decryptor_.UpdateSession(session_id,
- reinterpret_cast<const uint8*>(key.c_str()),
- key.length(),
+ std::vector<uint8>(key.begin(), key.end()),
CreatePromise(expected_result));
}
@@ -432,29 +431,29 @@ class AesDecryptorTest : public testing::Test {
TEST_F(AesDecryptorTest, CreateSessionWithNullInitData) {
EXPECT_CALL(*this,
OnSessionMessage(IsNotEmpty(), _, IsEmpty(), GURL::EmptyGURL()));
- decryptor_.CreateSessionAndGenerateRequest(MediaKeys::TEMPORARY_SESSION,
- EmeInitDataType::WEBM, NULL, 0,
- CreateSessionPromise(RESOLVED));
+ decryptor_.CreateSessionAndGenerateRequest(
+ MediaKeys::TEMPORARY_SESSION, EmeInitDataType::WEBM, std::vector<uint8>(),
+ CreateSessionPromise(RESOLVED));
}
TEST_F(AesDecryptorTest, MultipleCreateSession) {
EXPECT_CALL(*this,
OnSessionMessage(IsNotEmpty(), _, IsEmpty(), GURL::EmptyGURL()));
- decryptor_.CreateSessionAndGenerateRequest(MediaKeys::TEMPORARY_SESSION,
- EmeInitDataType::WEBM, NULL, 0,
- CreateSessionPromise(RESOLVED));
+ decryptor_.CreateSessionAndGenerateRequest(
+ MediaKeys::TEMPORARY_SESSION, EmeInitDataType::WEBM, std::vector<uint8>(),
+ CreateSessionPromise(RESOLVED));
EXPECT_CALL(*this,
OnSessionMessage(IsNotEmpty(), _, IsEmpty(), GURL::EmptyGURL()));
- decryptor_.CreateSessionAndGenerateRequest(MediaKeys::TEMPORARY_SESSION,
- EmeInitDataType::WEBM, NULL, 0,
- CreateSessionPromise(RESOLVED));
+ decryptor_.CreateSessionAndGenerateRequest(
+ MediaKeys::TEMPORARY_SESSION, EmeInitDataType::WEBM, std::vector<uint8>(),
+ CreateSessionPromise(RESOLVED));
EXPECT_CALL(*this,
OnSessionMessage(IsNotEmpty(), _, IsEmpty(), GURL::EmptyGURL()));
- decryptor_.CreateSessionAndGenerateRequest(MediaKeys::TEMPORARY_SESSION,
- EmeInitDataType::WEBM, NULL, 0,
- CreateSessionPromise(RESOLVED));
+ decryptor_.CreateSessionAndGenerateRequest(
+ MediaKeys::TEMPORARY_SESSION, EmeInitDataType::WEBM, std::vector<uint8>(),
+ CreateSessionPromise(RESOLVED));
}
TEST_F(AesDecryptorTest, CreateSessionWithCencInitData) {
@@ -475,8 +474,9 @@ TEST_F(AesDecryptorTest, CreateSessionWithCencInitData) {
EXPECT_CALL(*this, OnSessionMessage(IsNotEmpty(), _, IsJSONDictionary(),
GURL::EmptyGURL()));
decryptor_.CreateSessionAndGenerateRequest(
- MediaKeys::TEMPORARY_SESSION, EmeInitDataType::CENC, init_data,
- arraysize(init_data), CreateSessionPromise(RESOLVED));
+ MediaKeys::TEMPORARY_SESSION, EmeInitDataType::CENC,
+ std::vector<uint8>(init_data, init_data + arraysize(init_data)),
+ CreateSessionPromise(RESOLVED));
}
TEST_F(AesDecryptorTest, CreateSessionWithKeyIdsInitData) {
@@ -487,7 +487,7 @@ TEST_F(AesDecryptorTest, CreateSessionWithKeyIdsInitData) {
GURL::EmptyGURL()));
decryptor_.CreateSessionAndGenerateRequest(
MediaKeys::TEMPORARY_SESSION, EmeInitDataType::KEYIDS,
- reinterpret_cast<const uint8*>(init_data), arraysize(init_data) - 1,
+ std::vector<uint8>(init_data, init_data + arraysize(init_data) - 1),
CreateSessionPromise(RESOLVED));
}
« no previous file with comments | « media/cdm/aes_decryptor.cc ('k') | media/cdm/cenc_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698