#include <stddef.h>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/ptr_util.h"
#include "base/memory/unsafe_shared_memory_region.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "gpu/config/gpu_driver_bug_workarounds.h"
#include "gpu/config/gpu_info.h"
#include "gpu/config/gpu_preferences.h"
#include "media/mojo/clients/mojo_media_log_service.h"
#include "media/mojo/mojom/video_encode_accelerator.mojom.h"
#include "media/mojo/services/mojo_video_encode_accelerator_service.h"
#include "media/video/fake_video_encode_accelerator.h"
#include "media/video/video_encode_accelerator.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "mojo/public/cpp/bindings/pending_associated_remote.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/self_owned_associated_receiver.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace gpu {
struct GpuPreferences;
}
_;
namespace media {
static const gfx::Size kInputVisibleSize(64, 48);
std::unique_ptr<VideoEncodeAccelerator> CreateAndInitializeFakeVEA(
bool will_initialization_succeed,
const VideoEncodeAccelerator::Config& config,
VideoEncodeAccelerator::Client* client,
const gpu::GpuPreferences& gpu_preferences,
const gpu::GpuDriverBugWorkarounds& gpu_workarounds,
const gpu::GPUInfo::GPUDevice& gpu_device,
std::unique_ptr<MediaLog> media_log) { … }
class MockMojoVideoEncodeAcceleratorClient
: public mojom::VideoEncodeAcceleratorClient { … };
class MojoVideoEncodeAcceleratorServiceTest : public ::testing::Test { … };
TEST_F(MojoVideoEncodeAcceleratorServiceTest,
InitializeAndRequireBistreamBuffers) { … }
TEST_F(MojoVideoEncodeAcceleratorServiceTest, EncodeOneFrame) { … }
TEST_F(MojoVideoEncodeAcceleratorServiceTest, EncodingParametersChange) { … }
TEST_F(MojoVideoEncodeAcceleratorServiceTest,
EncodingParametersWithBitrateAllocation) { … }
TEST_F(MojoVideoEncodeAcceleratorServiceTest,
EncodingParametersWithBitrateAllocationAndFrameSize) { … }
TEST_F(MojoVideoEncodeAcceleratorServiceTest,
InitializeWithInvalidClientFails) { … }
TEST_F(MojoVideoEncodeAcceleratorServiceTest, InitializeFailure) { … }
TEST_F(MojoVideoEncodeAcceleratorServiceTest,
UseOutputBitstreamBufferWithWrongSizeFails) { … }
TEST_F(MojoVideoEncodeAcceleratorServiceTest, EncodeWithWrongSizeFails) { … }
TEST_F(MojoVideoEncodeAcceleratorServiceTest, CallsBeforeInitializeAreIgnored) { … }
TEST_F(MojoVideoEncodeAcceleratorServiceTest, IsFlushSupportedAndFlush) { … }
}