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

Unified Diff: media/filters/video_decoder_selector_unittest.cc

Issue 398163004: Fold DecoderSelector::Abort() into the dtor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only 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
« no previous file with comments | « media/filters/decoder_stream.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6f8918581a3f3d4382b988b96321328eb44df165..57760b5e065439d48cceec13a57eff5ff4236df1 100644
--- a/media/filters/video_decoder_selector_unittest.cc
+++ b/media/filters/video_decoder_selector_unittest.cc
@@ -26,7 +26,7 @@ class VideoDecoderSelectorTest : public ::testing::Test {
public:
enum DecryptorCapability {
kNoDecryptor,
- // Used to test Abort() during DecryptingVideoDecoder::Initialize() and
+ // Used to test destruction during DecryptingVideoDecoder::Initialize() and
// DecryptingDemuxerStream::Initialize(). We don't need this for normal
// VideoDecoders since we use MockVideoDecoder.
kHoldSetDecryptor,
@@ -116,11 +116,11 @@ class VideoDecoderSelectorTest : public ::testing::Test {
message_loop_.RunUntilIdle();
}
- void SelectDecoderAndAbort() {
+ void SelectDecoderAndDestroy() {
SelectDecoder();
EXPECT_CALL(*this, OnDecoderSelected(IsNull(), IsNull()));
- decoder_selector_->Abort();
+ decoder_selector_.reset();
message_loop_.RunUntilIdle();
}
@@ -174,13 +174,13 @@ TEST_F(VideoDecoderSelectorTest, ClearStream_NoDecryptor_OneClearDecoder) {
}
TEST_F(VideoDecoderSelectorTest,
- Abort_ClearStream_NoDecryptor_OneClearDecoder) {
+ Destroy_ClearStream_NoDecryptor_OneClearDecoder) {
UseClearStream();
InitializeDecoderSelector(kNoDecryptor, 1);
EXPECT_CALL(*decoder_1_, Initialize(_, _, _, _));
- SelectDecoderAndAbort();
+ SelectDecoderAndDestroy();
}
// The stream is not encrypted and we have multiple clear decoders. The first
@@ -199,7 +199,7 @@ TEST_F(VideoDecoderSelectorTest, ClearStream_NoDecryptor_MultipleClearDecoder) {
}
TEST_F(VideoDecoderSelectorTest,
- Abort_ClearStream_NoDecryptor_MultipleClearDecoder) {
+ Destroy_ClearStream_NoDecryptor_MultipleClearDecoder) {
UseClearStream();
InitializeDecoderSelector(kNoDecryptor, 2);
@@ -207,7 +207,7 @@ TEST_F(VideoDecoderSelectorTest,
.WillOnce(RunCallback<2>(DECODER_ERROR_NOT_SUPPORTED));
EXPECT_CALL(*decoder_2_, Initialize(_, _, _, _));
- SelectDecoderAndAbort();
+ SelectDecoderAndDestroy();
}
// There is a decryptor but the stream is not encrypted. The decoder will be
@@ -223,13 +223,13 @@ TEST_F(VideoDecoderSelectorTest, ClearStream_HasDecryptor) {
SelectDecoder();
}
-TEST_F(VideoDecoderSelectorTest, Abort_ClearStream_HasDecryptor) {
+TEST_F(VideoDecoderSelectorTest, Destroy_ClearStream_HasDecryptor) {
UseClearStream();
InitializeDecoderSelector(kDecryptOnly, 1);
EXPECT_CALL(*decoder_1_, Initialize(_, _, _, _));
- SelectDecoderAndAbort();
+ SelectDecoderAndDestroy();
}
// The stream is encrypted and there's no decryptor. No decoder can be selected.
@@ -254,11 +254,11 @@ TEST_F(VideoDecoderSelectorTest, EncryptedStream_DecryptOnly_NoClearDecoder) {
}
TEST_F(VideoDecoderSelectorTest,
- Abort_EncryptedStream_DecryptOnly_NoClearDecoder) {
+ Destroy_EncryptedStream_DecryptOnly_NoClearDecoder) {
UseEncryptedStream();
InitializeDecoderSelector(kHoldSetDecryptor, 0);
- SelectDecoderAndAbort();
+ SelectDecoderAndDestroy();
}
// Decryptor can do decryption-only and there's a decoder available. The decoder
@@ -275,13 +275,13 @@ TEST_F(VideoDecoderSelectorTest, EncryptedStream_DecryptOnly_OneClearDecoder) {
}
TEST_F(VideoDecoderSelectorTest,
- Abort_EncryptedStream_DecryptOnly_OneClearDecoder) {
+ Destroy_EncryptedStream_DecryptOnly_OneClearDecoder) {
UseEncryptedStream();
InitializeDecoderSelector(kDecryptOnly, 1);
EXPECT_CALL(*decoder_1_, Initialize(_, _, _, _));
- SelectDecoderAndAbort();
+ SelectDecoderAndDestroy();
}
// Decryptor can only do decryption and there are multiple decoders available.
@@ -302,7 +302,7 @@ TEST_F(VideoDecoderSelectorTest,
}
TEST_F(VideoDecoderSelectorTest,
- Abort_EncryptedStream_DecryptOnly_MultipleClearDecoder) {
+ Destroy_EncryptedStream_DecryptOnly_MultipleClearDecoder) {
UseEncryptedStream();
InitializeDecoderSelector(kDecryptOnly, 2);
@@ -310,7 +310,7 @@ TEST_F(VideoDecoderSelectorTest,
.WillOnce(RunCallback<2>(DECODER_ERROR_NOT_SUPPORTED));
EXPECT_CALL(*decoder_2_, Initialize(_, _, _, _));
- SelectDecoderAndAbort();
+ SelectDecoderAndDestroy();
}
// Decryptor can do decryption and decoding. A DecryptingVideoDecoder will be
@@ -325,11 +325,11 @@ TEST_F(VideoDecoderSelectorTest, EncryptedStream_DecryptAndDecode) {
SelectDecoder();
}
-TEST_F(VideoDecoderSelectorTest, Abort_EncryptedStream_DecryptAndDecode) {
+TEST_F(VideoDecoderSelectorTest, Destroy_EncryptedStream_DecryptAndDecode) {
UseEncryptedStream();
InitializeDecoderSelector(kHoldSetDecryptor, 1);
- SelectDecoderAndAbort();
+ SelectDecoderAndDestroy();
}
} // namespace media
« no previous file with comments | « media/filters/decoder_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698