#include "media/filters/decrypting_demuxer_stream.h"
#include <stdint.h>
#include <string>
#include <vector>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/run_loop.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/gmock_move_support.h"
#include "base/test/task_environment.h"
#include "media/base/decoder_buffer.h"
#include "media/base/decrypt_config.h"
#include "media/base/media_util.h"
#include "media/base/mock_filters.h"
#include "media/base/mock_media_log.h"
#include "media/base/test_helpers.h"
#include "testing/gmock/include/gmock/gmock.h"
RunCallback;
RunOnceCallback;
RunOnceCallbackRepeatedly;
_;
HasSubstr;
InSequence;
Invoke;
InvokeWithoutArgs;
Return;
SaveArg;
StrictMock;
WithArg;
namespace media {
static const int kFakeBufferSize = …;
static const uint8_t kFakeKeyId[] = …;
static const uint8_t kFakeIv[DecryptConfig::kDecryptionKeySize] = …;
static scoped_refptr<DecoderBuffer> CreateFakeEncryptedStreamBuffer(
bool is_clear) { … }
namespace {
ACTION_P(ReturnBuffer, buffer) { … }
}
class DecryptingDemuxerStreamTest : public testing::Test { … };
TEST_F(DecryptingDemuxerStreamTest, Initialize_NormalAudio) { … }
TEST_F(DecryptingDemuxerStreamTest, Initialize_NormalVideo) { … }
TEST_F(DecryptingDemuxerStreamTest, Initialize_CdmWithoutDecryptor) { … }
TEST_F(DecryptingDemuxerStreamTest, Read_Normal) { … }
TEST_F(DecryptingDemuxerStreamTest, Read_ClearBufferInEncryptedStream) { … }
TEST_F(DecryptingDemuxerStreamTest, Read_ClearBufferInClearStream) { … }
TEST_F(DecryptingDemuxerStreamTest, Read_DecryptError) { … }
TEST_F(DecryptingDemuxerStreamTest, Read_MismatchedSubsampleError) { … }
TEST_F(DecryptingDemuxerStreamTest, Read_DecryptNeedMoreData) { … }
TEST_F(DecryptingDemuxerStreamTest, Read_EndOfStream) { … }
TEST_F(DecryptingDemuxerStreamTest, KeyAdded_DuringWaitingForKey) { … }
TEST_F(DecryptingDemuxerStreamTest, KeyAdded_DuringPendingDecrypt) { … }
TEST_F(DecryptingDemuxerStreamTest, Reset_DuringIdleAfterInitialization) { … }
TEST_F(DecryptingDemuxerStreamTest, Reset_DuringIdleAfterReadOneBuffer) { … }
TEST_F(DecryptingDemuxerStreamTest, Reset_DuringPendingDemuxerRead) { … }
TEST_F(DecryptingDemuxerStreamTest, Reset_DuringPendingDecrypt) { … }
TEST_F(DecryptingDemuxerStreamTest, Reset_DuringWaitingForKey) { … }
TEST_F(DecryptingDemuxerStreamTest, Reset_AfterReset) { … }
TEST_F(DecryptingDemuxerStreamTest, DemuxerRead_Aborted) { … }
TEST_F(DecryptingDemuxerStreamTest, Reset_DuringAbortedDemuxerRead) { … }
TEST_F(DecryptingDemuxerStreamTest, DemuxerRead_ConfigChanged) { … }
TEST_F(DecryptingDemuxerStreamTest, Reset_DuringConfigChangedDemuxerRead) { … }
TEST_F(DecryptingDemuxerStreamTest, Destroy_DuringIdleAfterInitialization) { … }
TEST_F(DecryptingDemuxerStreamTest, Destroy_DuringIdleAfterReadOneBuffer) { … }
TEST_F(DecryptingDemuxerStreamTest, Destroy_DuringPendingDemuxerRead) { … }
TEST_F(DecryptingDemuxerStreamTest, Destroy_DuringPendingDecrypt) { … }
TEST_F(DecryptingDemuxerStreamTest, Destroy_DuringWaitingForKey) { … }
TEST_F(DecryptingDemuxerStreamTest, Destroy_AfterReset) { … }
}