#include <stddef.h>
#include <memory>
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/read_only_shared_memory_region.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/gtest_util.h"
#include "base/test/task_environment.h"
#include "gpu/config/gpu_driver_bug_workarounds.h"
#include "gpu/config/gpu_preferences.h"
#include "media/base/limits.h"
#include "media/base/media_util.h"
#include "media/mojo/clients/mojo_video_encode_accelerator.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/pending_remote.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
namespace media {
static constexpr gfx::Size kInputVisibleSize(64, 48);
static constexpr Bitrate kInitialBitrate = …;
static constexpr VideoCodecProfile kValidOutputProfile = …;
MATCHER_P(ExpectEncoderStatusCode, expected_code, "encoder status code") { … }
extern std::unique_ptr<VideoEncodeAccelerator> CreateAndInitializeFakeVEA(
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 MockVideoEncodeAcceleratorClient : public VideoEncodeAccelerator::Client { … };
class MojoVideoEncodeAcceleratorIntegrationTest : public ::testing::Test { … };
TEST_F(MojoVideoEncodeAcceleratorIntegrationTest, CreateAndDestroy) { … }
TEST_F(MojoVideoEncodeAcceleratorIntegrationTest, Initialize) { … }
TEST_F(MojoVideoEncodeAcceleratorIntegrationTest,
InitializeWithInvalidClientFails) { … }
TEST_F(MojoVideoEncodeAcceleratorIntegrationTest,
InitializeWithInvalidDimensionsFails) { … }
TEST_F(MojoVideoEncodeAcceleratorIntegrationTest,
InitializeWithUnsupportedProfileFails) { … }
TEST_F(MojoVideoEncodeAcceleratorIntegrationTest,
UseOutputBitstreamBufferWithInvalidSizeFails) { … }
TEST_F(MojoVideoEncodeAcceleratorIntegrationTest,
UseOutputBitstreamBufferWithInvalidIdFails) { … }
TEST_F(MojoVideoEncodeAcceleratorIntegrationTest, EncodeOneFrame) { … }
TEST_F(MojoVideoEncodeAcceleratorIntegrationTest,
EncodeWithInvalidDimensionsFails) { … }
TEST_F(MojoVideoEncodeAcceleratorIntegrationTest, EncodingParametersChange) { … }
TEST_F(MojoVideoEncodeAcceleratorIntegrationTest,
EncodingParametersWithBitrateAllocation) { … }
TEST_F(MojoVideoEncodeAcceleratorIntegrationTest,
EncodingParametersWithBitrateAllocationAndFrameSize) { … }
TEST_F(MojoVideoEncodeAcceleratorIntegrationTest,
CallsAreIgnoredAfterBindingClosed) { … }
}