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

Side by Side Diff: media/cdm/aes_decryptor_unittest.cc

Issue 1673383002: Add allocator interface for use by cdm_adapter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/debug/leak_annotations.h" 11 #include "base/debug/leak_annotations.h"
12 #include "base/json/json_reader.h" 12 #include "base/json/json_reader.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "media/base/cdm_callback_promise.h" 15 #include "media/base/cdm_callback_promise.h"
16 #include "media/base/cdm_config.h" 16 #include "media/base/cdm_config.h"
17 #include "media/base/cdm_key_information.h" 17 #include "media/base/cdm_key_information.h"
18 #include "media/base/decoder_buffer.h" 18 #include "media/base/decoder_buffer.h"
19 #include "media/base/decrypt_config.h" 19 #include "media/base/decrypt_config.h"
20 #include "media/base/decryptor.h" 20 #include "media/base/decryptor.h"
21 #include "media/base/mock_filters.h" 21 #include "media/base/mock_filters.h"
22 #include "media/cdm/aes_decryptor.h" 22 #include "media/cdm/aes_decryptor.h"
23 #include "media/cdm/api/content_decryption_module.h" 23 #include "media/cdm/api/content_decryption_module.h"
24 #include "media/cdm/cdm_adapter.h" 24 #include "media/cdm/cdm_adapter.h"
25 #include "media/cdm/cdm_buffer_allocator_impl.h"
25 #include "media/cdm/external_clear_key_test_helper.h" 26 #include "media/cdm/external_clear_key_test_helper.h"
26 #include "testing/gmock/include/gmock/gmock.h" 27 #include "testing/gmock/include/gmock/gmock.h"
27 #include "testing/gtest/include/gtest/gtest-param-test.h" 28 #include "testing/gtest/include/gtest/gtest-param-test.h"
28 #include "testing/gtest/include/gtest/gtest.h" 29 #include "testing/gtest/include/gtest/gtest.h"
29 #include "url/gurl.h" 30 #include "url/gurl.h"
30 31
31 using ::testing::_; 32 using ::testing::_;
32 using ::testing::Gt; 33 using ::testing::Gt;
33 using ::testing::IsNull; 34 using ::testing::IsNull;
34 using ::testing::NotNull; 35 using ::testing::NotNull;
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 base::Bind(&AesDecryptorTest::OnSessionMessage, 250 base::Bind(&AesDecryptorTest::OnSessionMessage,
250 base::Unretained(this)), 251 base::Unretained(this)),
251 base::Bind(&AesDecryptorTest::OnSessionClosed, 252 base::Bind(&AesDecryptorTest::OnSessionClosed,
252 base::Unretained(this)), 253 base::Unretained(this)),
253 base::Bind(&AesDecryptorTest::OnLegacySessionError, 254 base::Bind(&AesDecryptorTest::OnLegacySessionError,
254 base::Unretained(this)), 255 base::Unretained(this)),
255 base::Bind(&AesDecryptorTest::OnSessionKeysChange, 256 base::Bind(&AesDecryptorTest::OnSessionKeysChange,
256 base::Unretained(this)), 257 base::Unretained(this)),
257 base::Bind(&AesDecryptorTest::OnSessionExpirationUpdate, 258 base::Bind(&AesDecryptorTest::OnSessionExpirationUpdate,
258 base::Unretained(this)), 259 base::Unretained(this)),
259 base::Bind(&AesDecryptorTest::OnCdmCreated, base::Unretained(this))); 260 base::Bind(&AesDecryptorTest::OnCdmCreated, base::Unretained(this)),
261 new CdmBufferAllocatorImpl());
260 262
261 message_loop_.RunUntilIdle(); 263 message_loop_.RunUntilIdle();
262 } 264 }
263 } 265 }
264 266
265 void TearDown() override { 267 void TearDown() override {
266 if (GetParam() == "CdmAdapter") 268 if (GetParam() == "CdmAdapter")
267 helper_.reset(); 269 helper_.reset();
268 } 270 }
269 271
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 INSTANTIATE_TEST_CASE_P(CdmAdapter, 1014 INSTANTIATE_TEST_CASE_P(CdmAdapter,
1013 AesDecryptorTest, 1015 AesDecryptorTest,
1014 testing::Values("CdmAdapter")); 1016 testing::Values("CdmAdapter"));
1015 #endif 1017 #endif
1016 1018
1017 // TODO(jrummell): Once MojoCdm/MojoCdmService/MojoDecryptor/ 1019 // TODO(jrummell): Once MojoCdm/MojoCdmService/MojoDecryptor/
1018 // MojoDecryptorService are implemented, add a third version that tests the 1020 // MojoDecryptorService are implemented, add a third version that tests the
1019 // CDM via mojo. 1021 // CDM via mojo.
1020 1022
1021 } // namespace media 1023 } // namespace media
OLDNEW
« no previous file with comments | « media/BUILD.gn ('k') | media/cdm/cdm_adapter.h » ('j') | media/cdm/cdm_adapter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698