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

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

Issue 15772012: Separate MediaKeys interface from Decryptor interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « media/crypto/aes_decryptor_unittest.cc ('k') | media/filters/pipeline_integration_test_base.h » ('j') | 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 "media/filters/pipeline_integration_test_base.h" 5 #include "media/filters/pipeline_integration_test_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
11 #include "media/base/decoder_buffer.h" 11 #include "media/base/decoder_buffer.h"
12 #include "media/base/media_keys.h"
12 #include "media/base/test_data_util.h" 13 #include "media/base/test_data_util.h"
13 #include "media/crypto/aes_decryptor.h" 14 #include "media/crypto/aes_decryptor.h"
14 #include "media/filters/chunk_demuxer.h" 15 #include "media/filters/chunk_demuxer.h"
15 16
16 using testing::AtMost; 17 using testing::AtMost;
17 18
18 namespace media { 19 namespace media {
19 20
20 static const char kSourceId[] = "SourceId"; 21 static const char kSourceId[] = "SourceId";
21 static const char kClearKeySystem[] = "org.w3.clearkey"; 22 static const char kClearKeySystem[] = "org.w3.clearkey";
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 class AppBase { 65 class AppBase {
65 public: 66 public:
66 virtual ~AppBase() {} 67 virtual ~AppBase() {}
67 68
68 virtual void KeyAdded(const std::string& key_system, 69 virtual void KeyAdded(const std::string& key_system,
69 const std::string& session_id) = 0; 70 const std::string& session_id) = 0;
70 71
71 // Errors are not expected unless overridden. 72 // Errors are not expected unless overridden.
72 virtual void KeyError(const std::string& key_system, 73 virtual void KeyError(const std::string& key_system,
73 const std::string& session_id, 74 const std::string& session_id,
74 AesDecryptor::KeyError error_code, 75 MediaKeys::KeyError error_code,
75 int system_code) { 76 int system_code) {
76 FAIL() << "Unexpected Key Error"; 77 FAIL() << "Unexpected Key Error";
77 } 78 }
78 79
79 virtual void KeyMessage(const std::string& key_system, 80 virtual void KeyMessage(const std::string& key_system,
80 const std::string& session_id, 81 const std::string& session_id,
81 const std::string& message, 82 const std::string& message,
82 const std::string& default_url) = 0; 83 const std::string& default_url) = 0;
83 84
84 virtual void NeedKey(const std::string& key_system, 85 virtual void NeedKey(const std::string& key_system,
(...skipping 19 matching lines...) Expand all
104 return &decryptor_; 105 return &decryptor_;
105 } 106 }
106 107
107 // Callbacks for firing key events. Delegate to |app_|. 108 // Callbacks for firing key events. Delegate to |app_|.
108 void KeyAdded(const std::string& key_system, const std::string& session_id) { 109 void KeyAdded(const std::string& key_system, const std::string& session_id) {
109 app_->KeyAdded(key_system, session_id); 110 app_->KeyAdded(key_system, session_id);
110 } 111 }
111 112
112 void KeyError(const std::string& key_system, 113 void KeyError(const std::string& key_system,
113 const std::string& session_id, 114 const std::string& session_id,
114 AesDecryptor::KeyError error_code, 115 MediaKeys::KeyError error_code,
115 int system_code) { 116 int system_code) {
116 app_->KeyError(key_system, session_id, error_code, system_code); 117 app_->KeyError(key_system, session_id, error_code, system_code);
117 } 118 }
118 119
119 void KeyMessage(const std::string& key_system, 120 void KeyMessage(const std::string& key_system,
120 const std::string& session_id, 121 const std::string& session_id,
121 const std::string& message, 122 const std::string& message,
122 const std::string& default_url) { 123 const std::string& default_url) {
123 app_->KeyMessage(key_system, session_id, message, default_url); 124 app_->KeyMessage(key_system, session_id, message, default_url);
124 } 125 }
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 958
958 // Verify that VP8 video with inband text track can be played back. 959 // Verify that VP8 video with inband text track can be played back.
959 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8_WebVTT_WebM) { 960 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8_WebVTT_WebM) {
960 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"), 961 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"),
961 PIPELINE_OK)); 962 PIPELINE_OK));
962 Play(); 963 Play();
963 ASSERT_TRUE(WaitUntilOnEnded()); 964 ASSERT_TRUE(WaitUntilOnEnded());
964 } 965 }
965 966
966 } // namespace media 967 } // namespace media
OLDNEW
« no previous file with comments | « media/crypto/aes_decryptor_unittest.cc ('k') | media/filters/pipeline_integration_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698