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

Unified Diff: media/filters/audio_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 | « no previous file | media/filters/decoder_selector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_decoder_selector_unittest.cc
diff --git a/media/filters/audio_decoder_selector_unittest.cc b/media/filters/audio_decoder_selector_unittest.cc
index 0e2ccfe7e050efcd9c99aebc8245b11146cc6f0f..eb0e8dbd3c4606db23ec86518f46613b41989eca 100644
--- a/media/filters/audio_decoder_selector_unittest.cc
+++ b/media/filters/audio_decoder_selector_unittest.cc
@@ -26,7 +26,7 @@ class AudioDecoderSelectorTest : public ::testing::Test {
public:
enum DecryptorCapability {
kNoDecryptor,
- // Used to test Abort() during DecryptingAudioDecoder::Initialize() and
+ // Used to test destruction during DecryptingAudioDecoder::Initialize() and
// DecryptingDemuxerStream::Initialize(). We don't need this for normal
// AudioDecoders since we use MockAudioDecoder.
kHoldSetDecryptor,
@@ -120,11 +120,11 @@ class AudioDecoderSelectorTest : 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();
}
@@ -178,13 +178,13 @@ TEST_F(AudioDecoderSelectorTest, ClearStream_NoDecryptor_OneClearDecoder) {
}
TEST_F(AudioDecoderSelectorTest,
- 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
@@ -203,7 +203,7 @@ TEST_F(AudioDecoderSelectorTest, ClearStream_NoDecryptor_MultipleClearDecoder) {
}
TEST_F(AudioDecoderSelectorTest,
- Abort_ClearStream_NoDecryptor_MultipleClearDecoder) {
+ Destroy_ClearStream_NoDecryptor_MultipleClearDecoder) {
UseClearStream();
InitializeDecoderSelector(kNoDecryptor, 2);
@@ -211,7 +211,7 @@ TEST_F(AudioDecoderSelectorTest,
.WillOnce(RunCallback<1>(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
@@ -227,13 +227,13 @@ TEST_F(AudioDecoderSelectorTest, ClearStream_HasDecryptor) {
SelectDecoder();
}
-TEST_F(AudioDecoderSelectorTest, Abort_ClearStream_HasDecryptor) {
+TEST_F(AudioDecoderSelectorTest, 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.
@@ -258,11 +258,11 @@ TEST_F(AudioDecoderSelectorTest, EncryptedStream_DecryptOnly_NoClearDecoder) {
}
TEST_F(AudioDecoderSelectorTest,
- 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
@@ -279,13 +279,13 @@ TEST_F(AudioDecoderSelectorTest, EncryptedStream_DecryptOnly_OneClearDecoder) {
}
TEST_F(AudioDecoderSelectorTest,
- 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.
@@ -306,7 +306,7 @@ TEST_F(AudioDecoderSelectorTest,
}
TEST_F(AudioDecoderSelectorTest,
- Abort_EncryptedStream_DecryptOnly_MultipleClearDecoder) {
+ Destroy_EncryptedStream_DecryptOnly_MultipleClearDecoder) {
UseEncryptedStream();
InitializeDecoderSelector(kDecryptOnly, 2);
@@ -314,7 +314,7 @@ TEST_F(AudioDecoderSelectorTest,
.WillOnce(RunCallback<1>(DECODER_ERROR_NOT_SUPPORTED));
EXPECT_CALL(*decoder_2_, Initialize(_, _, _));
- SelectDecoderAndAbort();
+ SelectDecoderAndDestroy();
}
// Decryptor can do decryption and decoding. A DecryptingAudioDecoder will be
@@ -329,11 +329,11 @@ TEST_F(AudioDecoderSelectorTest, EncryptedStream_DecryptAndDecode) {
SelectDecoder();
}
-TEST_F(AudioDecoderSelectorTest, Abort_EncryptedStream_DecryptAndDecode) {
+TEST_F(AudioDecoderSelectorTest, Destroy_EncryptedStream_DecryptAndDecode) {
UseEncryptedStream();
InitializeDecoderSelector(kHoldSetDecryptor, 1);
- SelectDecoderAndAbort();
+ SelectDecoderAndDestroy();
}
} // namespace media
« no previous file with comments | « no previous file | media/filters/decoder_selector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698