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

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

Issue 2667283002: Refactor MediaResource to be multi-stream capable (Closed)
Patch Set: 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
« no previous file with comments | « media/mojo/clients/mojo_renderer.cc ('k') | media/mojo/services/media_resource_shim.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..93ca0487b97d724a11ac7b55b2c069c23f4dd9ad 100644
--- a/media/mojo/clients/mojo_renderer_unittest.cc
+++ b/media/mojo/clients/mojo_renderer_unittest.cc
@@ -77,7 +77,7 @@ class MojoRendererTest : public ::testing::Test {
// CreateAudioStream() and CreateVideoStream() overrides expectations for
// expected non-NULL streams.
- EXPECT_CALL(demuxer_, GetStream(_)).WillRepeatedly(Return(nullptr));
+ EXPECT_CALL(demuxer_, GetStreams()).WillRepeatedly(Return(streams_));
EXPECT_CALL(*mock_renderer_, GetMediaTime())
.WillRepeatedly(Return(base::TimeDelta()));
@@ -105,8 +105,8 @@ class MojoRendererTest : public ::testing::Test {
void CreateAudioStream() {
audio_stream_ = CreateStream(DemuxerStream::AUDIO);
- EXPECT_CALL(demuxer_, GetStream(DemuxerStream::AUDIO))
- .WillRepeatedly(Return(audio_stream_.get()));
+ streams_.push_back(audio_stream_.get());
+ EXPECT_CALL(demuxer_, GetStreams()).WillRepeatedly(Return(streams_));
}
void CreateVideoStream(bool is_encrypted = false) {
@@ -114,8 +114,9 @@ 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;
+ streams_.push_back(audio_stream_.get());
+ EXPECT_CALL(demuxer_, GetStreams()).WillRepeatedly(Return(streams_));
}
void InitializeAndExpect(PipelineStatus status) {
@@ -210,6 +211,7 @@ class MojoRendererTest : public ::testing::Test {
StrictMock<MockDemuxer> demuxer_;
std::unique_ptr<StrictMock<MockDemuxerStream>> audio_stream_;
std::unique_ptr<StrictMock<MockDemuxerStream>> video_stream_;
+ std::vector<DemuxerStream*> streams_;
// Service side mocks and helpers.
StrictMock<MockRenderer>* mock_renderer_;
« no previous file with comments | « media/mojo/clients/mojo_renderer.cc ('k') | media/mojo/services/media_resource_shim.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698