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

Unified Diff: media/filters/video_decoder_selector_unittest.cc

Issue 395703002: Fold {Audio|Video}Decoder::Stop() into the dtor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor fixes Created 6 years, 5 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/filters/video_decoder_selector_unittest.cc
diff --git a/media/filters/video_decoder_selector_unittest.cc b/media/filters/video_decoder_selector_unittest.cc
index 62b1a421456bf22997c7f70158ea90020a52091c..c97ccf35933c60e7f91dcf3bcc7f5d708c977b39 100644
--- a/media/filters/video_decoder_selector_unittest.cc
+++ b/media/filters/video_decoder_selector_unittest.cc
@@ -42,12 +42,11 @@ class VideoDecoderSelectorTest : public ::testing::Test {
decoder_2_(new StrictMock<MockVideoDecoder>()) {
all_decoders_.push_back(decoder_1_);
all_decoders_.push_back(decoder_2_);
+ EXPECT_CALL(*decoder_1_, Destroy());
+ EXPECT_CALL(*decoder_2_, Destroy());
}
~VideoDecoderSelectorTest() {
- if (selected_decoder_)
- selected_decoder_->Stop();
-
message_loop_.RunUntilIdle();
}
@@ -149,11 +148,6 @@ class VideoDecoderSelectorTest : public ::testing::Test {
DISALLOW_COPY_AND_ASSIGN(VideoDecoderSelectorTest);
};
-// Note:
-// In all the tests, Stop() is expected to be called on a decoder if a decoder:
-// - is pending initialization and DecoderSelector::Abort() is called, or
-// - has been successfully initialized.
-
// The stream is not encrypted but we have no clear decoder. No decoder can be
// selected.
TEST_F(VideoDecoderSelectorTest, ClearStream_NoDecryptor_NoClearDecoder) {
@@ -174,7 +168,6 @@ TEST_F(VideoDecoderSelectorTest, ClearStream_NoDecryptor_OneClearDecoder) {
EXPECT_CALL(*decoder_1_, Initialize(_, _, _, _))
.WillOnce(RunCallback<2>(PIPELINE_OK));
EXPECT_CALL(*this, OnDecoderSelected(decoder_1_, IsNull()));
- EXPECT_CALL(*decoder_1_, Stop());
SelectDecoder();
}
@@ -185,7 +178,6 @@ TEST_F(VideoDecoderSelectorTest,
InitializeDecoderSelector(kNoDecryptor, 1);
EXPECT_CALL(*decoder_1_, Initialize(_, _, _, _));
- EXPECT_CALL(*decoder_1_, Stop());
SelectDecoderAndAbort();
}
@@ -201,7 +193,6 @@ TEST_F(VideoDecoderSelectorTest, ClearStream_NoDecryptor_MultipleClearDecoder) {
EXPECT_CALL(*decoder_2_, Initialize(_, _, _, _))
.WillOnce(RunCallback<2>(PIPELINE_OK));
EXPECT_CALL(*this, OnDecoderSelected(decoder_2_, IsNull()));
- EXPECT_CALL(*decoder_2_, Stop());
SelectDecoder();
}
@@ -214,7 +205,6 @@ TEST_F(VideoDecoderSelectorTest,
EXPECT_CALL(*decoder_1_, Initialize(_, _, _, _))
.WillOnce(RunCallback<2>(DECODER_ERROR_NOT_SUPPORTED));
EXPECT_CALL(*decoder_2_, Initialize(_, _, _, _));
- EXPECT_CALL(*decoder_2_, Stop());
SelectDecoderAndAbort();
}
@@ -228,7 +218,6 @@ TEST_F(VideoDecoderSelectorTest, ClearStream_HasDecryptor) {
EXPECT_CALL(*decoder_1_, Initialize(_, _, _, _))
.WillOnce(RunCallback<2>(PIPELINE_OK));
EXPECT_CALL(*this, OnDecoderSelected(decoder_1_, IsNull()));
- EXPECT_CALL(*decoder_1_, Stop());
SelectDecoder();
}
@@ -238,7 +227,6 @@ TEST_F(VideoDecoderSelectorTest, Abort_ClearStream_HasDecryptor) {
InitializeDecoderSelector(kDecryptOnly, 1);
EXPECT_CALL(*decoder_1_, Initialize(_, _, _, _));
- EXPECT_CALL(*decoder_1_, Stop());
SelectDecoderAndAbort();
}
@@ -281,7 +269,6 @@ TEST_F(VideoDecoderSelectorTest, EncryptedStream_DecryptOnly_OneClearDecoder) {
EXPECT_CALL(*decoder_1_, Initialize(_, _, _, _))
.WillOnce(RunCallback<2>(PIPELINE_OK));
EXPECT_CALL(*this, OnDecoderSelected(decoder_1_, NotNull()));
- EXPECT_CALL(*decoder_1_, Stop());
SelectDecoder();
}
@@ -292,7 +279,6 @@ TEST_F(VideoDecoderSelectorTest,
InitializeDecoderSelector(kDecryptOnly, 1);
EXPECT_CALL(*decoder_1_, Initialize(_, _, _, _));
- EXPECT_CALL(*decoder_1_, Stop());
SelectDecoderAndAbort();
}
@@ -310,7 +296,6 @@ TEST_F(VideoDecoderSelectorTest,
EXPECT_CALL(*decoder_2_, Initialize(_, _, _, _))
.WillOnce(RunCallback<2>(PIPELINE_OK));
EXPECT_CALL(*this, OnDecoderSelected(decoder_2_, NotNull()));
- EXPECT_CALL(*decoder_2_, Stop());
SelectDecoder();
}
@@ -323,7 +308,6 @@ TEST_F(VideoDecoderSelectorTest,
EXPECT_CALL(*decoder_1_, Initialize(_, _, _, _))
.WillOnce(RunCallback<2>(DECODER_ERROR_NOT_SUPPORTED));
EXPECT_CALL(*decoder_2_, Initialize(_, _, _, _));
- EXPECT_CALL(*decoder_2_, Stop());
SelectDecoderAndAbort();
}

Powered by Google App Engine
This is Rietveld 408576698