chromium/media/mojo/clients/mojo_audio_decoder_unittest.cc

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <memory>

#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/task_environment.h"
#include "base/threading/thread.h"
#include "base/time/time.h"
#include "media/base/audio_decoder_config.h"
#include "media/base/audio_timestamp_helper.h"
#include "media/base/decoder_buffer.h"
#include "media/base/media_util.h"
#include "media/base/mock_filters.h"
#include "media/base/test_helpers.h"
#include "media/base/waiting.h"
#include "media/mojo/clients/mojo_audio_decoder.h"
#include "media/mojo/mojom/audio_decoder.mojom.h"
#include "media/mojo/services/mojo_audio_decoder_service.h"
#include "media/mojo/services/mojo_cdm_service_context.h"
#include "media/mojo/services/mojo_media_client.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "testing/gtest/include/gtest/gtest.h"

RunOnceCallback;
RunOnceCallbackRepeatedly;
_;
DoAll;
InSequence;
InvokeWithoutArgs;
SaveArg;
StrictMock;

namespace media {

const SampleFormat kSampleFormat =;
const int kChannels =;
const ChannelLayout kChannelLayout =;
const int kDefaultSampleRate =;
const int kDefaultFrameSize =;
const int kOutputPerDecode =;

namespace {

// Proxies CreateAudioDecoder() to a callback.
class FakeMojoMediaClient : public MojoMediaClient {};

}  // namespace

// Tests MojoAudioDecoder (client) and MojoAudioDecoderService (service).
// To better simulate how they are used in production, the client and service
// are running on two different threads.
class MojoAudioDecoderTest : public ::testing::Test {};

TEST_F(MojoAudioDecoderTest, Initialize_Success) {}

TEST_F(MojoAudioDecoderTest, Reinitialize_Success) {}

// Makes sure all callbacks and client calls are called in order. See
// http://crbug.com/646054
TEST_F(MojoAudioDecoderTest, Decode_MultipleTimes) {}

TEST_F(MojoAudioDecoderTest, Reset_DuringDecode) {}

TEST_F(MojoAudioDecoderTest, Reset_DuringDecode_ChunkedWrite) {}

TEST_F(MojoAudioDecoderTest, WaitingForKey) {}

// TODO(xhwang): Add more tests.

}  // namespace media