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> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/debug/leak_annotations.h" | 13 #include "base/debug/leak_annotations.h" |
14 #include "base/json/json_reader.h" | 14 #include "base/json/json_reader.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/run_loop.h" |
16 #include "base/values.h" | 17 #include "base/values.h" |
17 #include "media/base/cdm_callback_promise.h" | 18 #include "media/base/cdm_callback_promise.h" |
18 #include "media/base/cdm_config.h" | 19 #include "media/base/cdm_config.h" |
19 #include "media/base/cdm_key_information.h" | 20 #include "media/base/cdm_key_information.h" |
20 #include "media/base/decoder_buffer.h" | 21 #include "media/base/decoder_buffer.h" |
21 #include "media/base/decrypt_config.h" | 22 #include "media/base/decrypt_config.h" |
22 #include "media/base/decryptor.h" | 23 #include "media/base/decryptor.h" |
23 #include "media/base/mock_filters.h" | 24 #include "media/base/mock_filters.h" |
24 #include "media/cdm/api/content_decryption_module.h" | 25 #include "media/cdm/api/content_decryption_module.h" |
25 #include "media/cdm/cdm_adapter.h" | 26 #include "media/cdm/cdm_adapter.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 base::Bind(&AesDecryptorTest::OnSessionClosed, | 258 base::Bind(&AesDecryptorTest::OnSessionClosed, |
258 base::Unretained(this)), | 259 base::Unretained(this)), |
259 base::Bind(&AesDecryptorTest::OnLegacySessionError, | 260 base::Bind(&AesDecryptorTest::OnLegacySessionError, |
260 base::Unretained(this)), | 261 base::Unretained(this)), |
261 base::Bind(&AesDecryptorTest::OnSessionKeysChange, | 262 base::Bind(&AesDecryptorTest::OnSessionKeysChange, |
262 base::Unretained(this)), | 263 base::Unretained(this)), |
263 base::Bind(&AesDecryptorTest::OnSessionExpirationUpdate, | 264 base::Bind(&AesDecryptorTest::OnSessionExpirationUpdate, |
264 base::Unretained(this)), | 265 base::Unretained(this)), |
265 base::Bind(&AesDecryptorTest::OnCdmCreated, base::Unretained(this))); | 266 base::Bind(&AesDecryptorTest::OnCdmCreated, base::Unretained(this))); |
266 | 267 |
267 message_loop_.RunUntilIdle(); | 268 base::RunLoop().RunUntilIdle(); |
268 } | 269 } |
269 } | 270 } |
270 | 271 |
271 void TearDown() override { | 272 void TearDown() override { |
272 if (GetParam() == "CdmAdapter") | 273 if (GetParam() == "CdmAdapter") |
273 helper_.reset(); | 274 helper_.reset(); |
274 } | 275 } |
275 | 276 |
276 void OnCdmCreated(const scoped_refptr<MediaKeys>& cdm, | 277 void OnCdmCreated(const scoped_refptr<MediaKeys>& cdm, |
277 const std::string& error_message) { | 278 const std::string& error_message) { |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 INSTANTIATE_TEST_CASE_P(CdmAdapter, | 1021 INSTANTIATE_TEST_CASE_P(CdmAdapter, |
1021 AesDecryptorTest, | 1022 AesDecryptorTest, |
1022 testing::Values("CdmAdapter")); | 1023 testing::Values("CdmAdapter")); |
1023 #endif | 1024 #endif |
1024 | 1025 |
1025 // TODO(jrummell): Once MojoCdm/MojoCdmService/MojoDecryptor/ | 1026 // TODO(jrummell): Once MojoCdm/MojoCdmService/MojoDecryptor/ |
1026 // MojoDecryptorService are implemented, add a third version that tests the | 1027 // MojoDecryptorService are implemented, add a third version that tests the |
1027 // CDM via mojo. | 1028 // CDM via mojo. |
1028 | 1029 |
1029 } // namespace media | 1030 } // namespace media |
OLD | NEW |