OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/cdm/aes_decryptor.h" | 5 #include "media/cdm/aes_decryptor.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 .Times(AtMost(1)); | 380 .Times(AtMost(1)); |
381 | 381 |
382 cdm_->UpdateSession(session_id, | 382 cdm_->UpdateSession(session_id, |
383 std::vector<uint8_t>(key.begin(), key.end()), | 383 std::vector<uint8_t>(key.begin(), key.end()), |
384 CreatePromise(expected_result)); | 384 CreatePromise(expected_result)); |
385 } | 385 } |
386 | 386 |
387 bool KeysInfoContains(const std::vector<uint8_t>& expected_key_id, | 387 bool KeysInfoContains(const std::vector<uint8_t>& expected_key_id, |
388 CdmKeyInformation::KeyStatus expected_status = | 388 CdmKeyInformation::KeyStatus expected_status = |
389 CdmKeyInformation::USABLE) { | 389 CdmKeyInformation::USABLE) { |
390 for (auto* key_id : cdm_client_.keys_info()) { | 390 for (auto& key_id : cdm_client_.keys_info()) { |
391 if (key_id->key_id == expected_key_id && | 391 if (key_id->key_id == expected_key_id && |
392 key_id->status == expected_status) { | 392 key_id->status == expected_status) { |
393 return true; | 393 return true; |
394 } | 394 } |
395 } | 395 } |
396 return false; | 396 return false; |
397 } | 397 } |
398 | 398 |
399 MOCK_METHOD2(BufferDecrypted, void(Decryptor::Status, | 399 MOCK_METHOD2(BufferDecrypted, void(Decryptor::Status, |
400 const scoped_refptr<DecoderBuffer>&)); | 400 const scoped_refptr<DecoderBuffer>&)); |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 INSTANTIATE_TEST_CASE_P(CdmAdapter, | 1052 INSTANTIATE_TEST_CASE_P(CdmAdapter, |
1053 AesDecryptorTest, | 1053 AesDecryptorTest, |
1054 testing::Values("CdmAdapter")); | 1054 testing::Values("CdmAdapter")); |
1055 #endif | 1055 #endif |
1056 | 1056 |
1057 // TODO(jrummell): Once MojoCdm/MojoCdmService/MojoDecryptor/ | 1057 // TODO(jrummell): Once MojoCdm/MojoCdmService/MojoDecryptor/ |
1058 // MojoDecryptorService are implemented, add a third version that tests the | 1058 // MojoDecryptorService are implemented, add a third version that tests the |
1059 // CDM via mojo. | 1059 // CDM via mojo. |
1060 | 1060 |
1061 } // namespace media | 1061 } // namespace media |
OLD | NEW |