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

Side by Side Diff: media/test/pipeline_integration_test.cc

Issue 1068823003: Pass security origin to AesDecryptor() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add GN dependency 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 unified diff | Download patch
« no previous file with comments | « media/test/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "media/base/cdm_callback_promise.h" 10 #include "media/base/cdm_callback_promise.h"
11 #include "media/base/cdm_context.h" 11 #include "media/base/cdm_context.h"
12 #include "media/base/cdm_key_information.h" 12 #include "media/base/cdm_key_information.h"
13 #include "media/base/decoder_buffer.h" 13 #include "media/base/decoder_buffer.h"
14 #include "media/base/media.h" 14 #include "media/base/media.h"
15 #include "media/base/media_keys.h" 15 #include "media/base/media_keys.h"
16 #include "media/base/media_switches.h" 16 #include "media/base/media_switches.h"
17 #include "media/base/test_data_util.h" 17 #include "media/base/test_data_util.h"
18 #include "media/cdm/aes_decryptor.h" 18 #include "media/cdm/aes_decryptor.h"
19 #include "media/cdm/json_web_key.h" 19 #include "media/cdm/json_web_key.h"
20 #include "media/filters/chunk_demuxer.h" 20 #include "media/filters/chunk_demuxer.h"
21 #include "media/renderers/renderer_impl.h" 21 #include "media/renderers/renderer_impl.h"
22 #include "media/test/pipeline_integration_test_base.h" 22 #include "media/test/pipeline_integration_test_base.h"
23 #include "testing/gmock/include/gmock/gmock.h" 23 #include "testing/gmock/include/gmock/gmock.h"
24 #include "url/gurl.h"
24 25
25 #if defined(MOJO_RENDERER) 26 #if defined(MOJO_RENDERER)
26 #include "media/mojo/services/mojo_renderer_impl.h" 27 #include "media/mojo/services/mojo_renderer_impl.h"
27 #include "third_party/mojo/src/mojo/public/cpp/application/application_impl.h" 28 #include "third_party/mojo/src/mojo/public/cpp/application/application_impl.h"
28 #include "third_party/mojo/src/mojo/public/cpp/application/application_test_base .h" 29 #include "third_party/mojo/src/mojo/public/cpp/application/application_test_base .h"
29 #include "third_party/mojo/src/mojo/public/cpp/application/connect.h" 30 #include "third_party/mojo/src/mojo/public/cpp/application/connect.h"
30 31
31 // TODO(dalecurtis): The mojo renderer is in another process, so we have no way 32 // TODO(dalecurtis): The mojo renderer is in another process, so we have no way
32 // currently to get hashes for video and audio samples. This also means that 33 // currently to get hashes for video and audio samples. This also means that
33 // real audio plays out for each test. 34 // real audio plays out for each test.
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 const std::string& error_message) { 163 const std::string& error_message) {
163 FAIL() << "Unexpected Key Error"; 164 FAIL() << "Unexpected Key Error";
164 } 165 }
165 166
166 virtual void OnEncryptedMediaInitData(EmeInitDataType init_data_type, 167 virtual void OnEncryptedMediaInitData(EmeInitDataType init_data_type,
167 const std::vector<uint8>& init_data, 168 const std::vector<uint8>& init_data,
168 AesDecryptor* decryptor) = 0; 169 AesDecryptor* decryptor) = 0;
169 }; 170 };
170 171
171 FakeEncryptedMedia(AppBase* app) 172 FakeEncryptedMedia(AppBase* app)
172 : decryptor_(base::Bind(&FakeEncryptedMedia::OnSessionMessage, 173 : decryptor_(GURL::EmptyGURL(),
174 base::Bind(&FakeEncryptedMedia::OnSessionMessage,
173 base::Unretained(this)), 175 base::Unretained(this)),
174 base::Bind(&FakeEncryptedMedia::OnSessionClosed, 176 base::Bind(&FakeEncryptedMedia::OnSessionClosed,
175 base::Unretained(this)), 177 base::Unretained(this)),
176 base::Bind(&FakeEncryptedMedia::OnSessionKeysChange, 178 base::Bind(&FakeEncryptedMedia::OnSessionKeysChange,
177 base::Unretained(this))), 179 base::Unretained(this))),
178 cdm_context_(&decryptor_), 180 cdm_context_(&decryptor_),
179 app_(app) {} 181 app_(app) {}
180 182
181 CdmContext* GetCdmContext() { return &cdm_context_; } 183 CdmContext* GetCdmContext() { return &cdm_context_; }
182 184
(...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after
1740 1742
1741 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { 1743 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) {
1742 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); 1744 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm"));
1743 Play(); 1745 Play();
1744 ASSERT_TRUE(WaitUntilOnEnded()); 1746 ASSERT_TRUE(WaitUntilOnEnded());
1745 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), 1747 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000),
1746 demuxer_->GetStartTime()); 1748 demuxer_->GetStartTime());
1747 } 1749 }
1748 1750
1749 } // namespace media 1751 } // namespace media
OLDNEW
« no previous file with comments | « media/test/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698