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

Unified Diff: media/base/filter_collection_unittest.cc

Issue 10836167: Move VideoDecoder initialization into VideoRendererBase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 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/base/filter_collection_unittest.cc
diff --git a/media/base/filter_collection_unittest.cc b/media/base/filter_collection_unittest.cc
index 70624a1c86ff328eaaf58be8b4bf95f590612f12..514d96c6c71478871ae9d384448d4309112432ef 100644
--- a/media/base/filter_collection_unittest.cc
+++ b/media/base/filter_collection_unittest.cc
@@ -20,54 +20,22 @@ class FilterCollectionTest : public ::testing::Test {
DISALLOW_COPY_AND_ASSIGN(FilterCollectionTest);
};
-TEST_F(FilterCollectionTest, TestIsEmptyAndClear) {
- EXPECT_TRUE(collection_.IsEmpty());
-
- collection_.AddAudioDecoder(mock_filters_.audio_decoder());
-
- EXPECT_FALSE(collection_.IsEmpty());
-
- collection_.Clear();
-
- EXPECT_TRUE(collection_.IsEmpty());
-}
-
TEST_F(FilterCollectionTest, SelectXXXMethods) {
scoped_refptr<AudioDecoder> audio_decoder;
- scoped_refptr<VideoDecoder> video_decoder;
-
- collection_.AddVideoDecoder(mock_filters_.video_decoder());
- EXPECT_FALSE(collection_.IsEmpty());
- // Verify that the video decoder will not be returned if we
- // ask for a different type.
collection_.SelectAudioDecoder(&audio_decoder);
EXPECT_FALSE(audio_decoder);
- EXPECT_FALSE(collection_.IsEmpty());
- // Verify that we can actually retrieve the video decoder
- // and that it is removed from the collection.
- collection_.SelectVideoDecoder(&video_decoder);
- EXPECT_TRUE(video_decoder);
- EXPECT_TRUE(collection_.IsEmpty());
-
- // Add a video decoder and audio decoder.
- collection_.AddVideoDecoder(mock_filters_.video_decoder());
+ // Add an audio decoder.
collection_.AddAudioDecoder(mock_filters_.audio_decoder());
// Verify that we can select the audio decoder.
collection_.SelectAudioDecoder(&audio_decoder);
EXPECT_TRUE(audio_decoder);
- EXPECT_FALSE(collection_.IsEmpty());
// Verify that we can't select it again since only one has been added.
collection_.SelectAudioDecoder(&audio_decoder);
EXPECT_FALSE(audio_decoder);
-
- // Verify that we can select the video decoder and that doing so will
- // empty the collection again.
- collection_.SelectVideoDecoder(&video_decoder);
- EXPECT_TRUE(collection_.IsEmpty());
}
TEST_F(FilterCollectionTest, MultipleFiltersOfSameType) {
@@ -83,13 +51,11 @@ TEST_F(FilterCollectionTest, MultipleFiltersOfSameType) {
collection_.SelectAudioDecoder(&audio_decoder);
EXPECT_TRUE(audio_decoder);
EXPECT_EQ(audio_decoder, audio_decoder_a);
- EXPECT_FALSE(collection_.IsEmpty());
// Verify that second SelectAudioDecoder() returns audio_decoder_b.
collection_.SelectAudioDecoder(&audio_decoder);
EXPECT_TRUE(audio_decoder);
EXPECT_EQ(audio_decoder, audio_decoder_b);
- EXPECT_TRUE(collection_.IsEmpty());
// Verify that third SelectAudioDecoder() returns nothing.
collection_.SelectAudioDecoder(&audio_decoder);
« no previous file with comments | « media/base/filter_collection.cc ('k') | media/base/media_log.cc » ('j') | media/base/pipeline.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698