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

Side by Side Diff: chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc

Issue 1407253007: [Chromecast] Allow CMA backend to notify of key expiry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK for |cdm_| instead of conditional Created 5 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <vector> 5 #include <vector>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 void Start(); 93 void Start();
94 94
95 // MediaPipelineBackend::Delegate implementation: 95 // MediaPipelineBackend::Delegate implementation:
96 void OnVideoResolutionChanged(MediaPipelineBackend::VideoDecoder* decoder, 96 void OnVideoResolutionChanged(MediaPipelineBackend::VideoDecoder* decoder,
97 const Size& size) override {} 97 const Size& size) override {}
98 void OnPushBufferComplete(MediaPipelineBackend::Decoder* decoder, 98 void OnPushBufferComplete(MediaPipelineBackend::Decoder* decoder,
99 MediaPipelineBackend::BufferStatus status) override; 99 MediaPipelineBackend::BufferStatus status) override;
100 void OnEndOfStream(MediaPipelineBackend::Decoder* decoder) override; 100 void OnEndOfStream(MediaPipelineBackend::Decoder* decoder) override;
101 void OnDecoderError(MediaPipelineBackend::Decoder* decoder) override; 101 void OnDecoderError(MediaPipelineBackend::Decoder* decoder) override;
102 void OnKeyStatusChanged(const std::string& key_id,
103 CastKeyStatus key_status,
104 uint32_t system_code) override;
102 105
103 private: 106 private:
104 void Initialize(); 107 void Initialize();
105 108
106 void LoadAudioStream(const std::string& filename); 109 void LoadAudioStream(const std::string& filename);
107 void LoadVideoStream(const std::string& filename, bool raw_h264); 110 void LoadVideoStream(const std::string& filename, bool raw_h264);
108 111
109 void FeedAudioBuffer(); 112 void FeedAudioBuffer();
110 void FeedVideoBuffer(); 113 void FeedVideoBuffer();
111 114
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 ASSERT_TRUE(success); 338 ASSERT_TRUE(success);
336 base::MessageLoop::current()->QuitWhenIdle(); 339 base::MessageLoop::current()->QuitWhenIdle();
337 } 340 }
338 } 341 }
339 342
340 void AudioVideoPipelineDeviceTest::OnDecoderError( 343 void AudioVideoPipelineDeviceTest::OnDecoderError(
341 MediaPipelineBackend::Decoder* decoder) { 344 MediaPipelineBackend::Decoder* decoder) {
342 ASSERT_TRUE(false); 345 ASSERT_TRUE(false);
343 } 346 }
344 347
348 void AudioVideoPipelineDeviceTest::OnKeyStatusChanged(const std::string& key_id,
349 CastKeyStatus key_status,
350 uint32_t system_code) {
351 ASSERT_TRUE(false);
352 }
353
345 void AudioVideoPipelineDeviceTest::OnPushBufferComplete( 354 void AudioVideoPipelineDeviceTest::OnPushBufferComplete(
346 MediaPipelineBackend::Decoder* decoder, 355 MediaPipelineBackend::Decoder* decoder,
347 MediaPipelineBackend::BufferStatus status) { 356 MediaPipelineBackend::BufferStatus status) {
348 EXPECT_NE(status, MediaPipelineBackend::kBufferFailed); 357 EXPECT_NE(status, MediaPipelineBackend::kBufferFailed);
349 358
350 if (decoder == audio_decoder_) { 359 if (decoder == audio_decoder_) {
351 if (audio_feeding_completed_) 360 if (audio_feeding_completed_)
352 return; 361 return;
353 362
354 base::ThreadTaskRunnerHandle::Get()->PostTask( 363 base::ThreadTaskRunnerHandle::Get()->PostTask(
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 TEST_F(AudioVideoPipelineDeviceTest, WebmPlayback) { 484 TEST_F(AudioVideoPipelineDeviceTest, WebmPlayback) {
476 scoped_ptr<base::MessageLoop> message_loop(new base::MessageLoop()); 485 scoped_ptr<base::MessageLoop> message_loop(new base::MessageLoop());
477 486
478 ConfigureForFile("bear-640x360.webm"); 487 ConfigureForFile("bear-640x360.webm");
479 Start(); 488 Start();
480 message_loop->Run(); 489 message_loop->Run();
481 } 490 }
482 491
483 } // namespace media 492 } // namespace media
484 } // namespace chromecast 493 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698