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

Unified Diff: media/mojo/clients/mojo_renderer_unittest.cc

Issue 2491043003: MediaResource refactoring to support multiple streams (Closed)
Patch Set: rebase Created 3 years, 11 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
Index: media/mojo/clients/mojo_renderer_unittest.cc
diff --git a/media/mojo/clients/mojo_renderer_unittest.cc b/media/mojo/clients/mojo_renderer_unittest.cc
index f96a945e2b2b33ad0ac00aeac9199aa1ebcbcc95..d7b9e4a2063e681e718863e20fba96c4d32c83bd 100644
--- a/media/mojo/clients/mojo_renderer_unittest.cc
+++ b/media/mojo/clients/mojo_renderer_unittest.cc
@@ -77,7 +77,8 @@ class MojoRendererTest : public ::testing::Test {
// CreateAudioStream() and CreateVideoStream() overrides expectations for
// expected non-NULL streams.
- EXPECT_CALL(demuxer_, GetStream(_)).WillRepeatedly(Return(nullptr));
+ std::vector<DemuxerStream*> empty;
+ EXPECT_CALL(demuxer_, GetStreams()).WillRepeatedly(Return(empty));
EXPECT_CALL(*mock_renderer_, GetMediaTime())
.WillRepeatedly(Return(base::TimeDelta()));
@@ -105,8 +106,11 @@ class MojoRendererTest : public ::testing::Test {
void CreateAudioStream() {
audio_stream_ = CreateStream(DemuxerStream::AUDIO);
- EXPECT_CALL(demuxer_, GetStream(DemuxerStream::AUDIO))
- .WillRepeatedly(Return(audio_stream_.get()));
+ std::vector<DemuxerStream*> streams;
+ streams.push_back(audio_stream_.get());
+ if (video_stream_)
+ streams.push_back(video_stream_.get());
+ EXPECT_CALL(demuxer_, GetStreams()).WillRepeatedly(Return(streams));
}
void CreateVideoStream(bool is_encrypted = false) {
@@ -114,8 +118,11 @@ class MojoRendererTest : public ::testing::Test {
video_stream_->set_video_decoder_config(
is_encrypted ? TestVideoConfig::NormalEncrypted()
: TestVideoConfig::Normal());
- EXPECT_CALL(demuxer_, GetStream(DemuxerStream::VIDEO))
- .WillRepeatedly(Return(video_stream_.get()));
+ std::vector<DemuxerStream*> streams;
+ if (audio_stream_)
+ streams.push_back(audio_stream_.get());
+ streams.push_back(video_stream_.get());
+ EXPECT_CALL(demuxer_, GetStreams()).WillRepeatedly(Return(streams));
}
void InitializeAndExpect(PipelineStatus status) {

Powered by Google App Engine
This is Rietveld 408576698