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

Unified Diff: media/test/pipeline_integration_test.cc

Issue 1002193005: Properly determine if a new key was added in AesDecryptor::Update() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix pipeline test Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cdm/aes_decryptor_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/test/pipeline_integration_test.cc
diff --git a/media/test/pipeline_integration_test.cc b/media/test/pipeline_integration_test.cc
index bf502df8bb05558efc08765a5ba1a77f2a3d6cd5..5e546a8416fcc777d6eb88daac08bf8c8f3df116 100644
--- a/media/test/pipeline_integration_test.cc
+++ b/media/test/pipeline_integration_test.cc
@@ -302,6 +302,12 @@ class KeyProvidingApp : public FakeEncryptedMedia::AppBase {
void OnEncryptedMediaInitData(const std::string& init_data_type,
const std::vector<uint8>& init_data,
AesDecryptor* decryptor) override {
+ // Since only 1 session is created, skip the request if the |init_data|
+ // has been seen before (no need to add the same key again).
+ if (init_data == prev_init_data_)
+ return;
+ prev_init_data_ = init_data;
+
if (current_session_id_.empty()) {
if (init_data_type == kCencInitDataType) {
// Since the 'cenc' files are not created with proper 'pssh' boxes,
@@ -340,6 +346,7 @@ class KeyProvidingApp : public FakeEncryptedMedia::AppBase {
}
std::string current_session_id_;
+ std::vector<uint8> prev_init_data_;
};
class RotatingKeyProvidingApp : public KeyProvidingApp {
« no previous file with comments | « media/cdm/aes_decryptor_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698