chromium/services/video_effects/video_effects_processor_impl_unittest.cc

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

#include "services/video_effects/video_effects_processor_impl.h"

#include <optional>

#include "base/functional/callback_helpers.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/unsafe_shared_memory_region.h"
#include "base/notreached.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "base/test/test_future.h"
#include "gpu/command_buffer/common/capabilities.h"
#include "gpu/command_buffer/common/context_result.h"
#include "gpu/command_buffer/common/mailbox_holder.h"
#include "gpu/ipc/common/gpu_channel.mojom-forward.h"
#include "gpu/ipc/common/mock_gpu_channel.h"
#include "media/capture/mojom/video_capture_buffer.mojom.h"
#include "media/capture/mojom/video_effects_manager.mojom.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "services/video_effects/public/mojom/video_effects_processor.mojom.h"
#include "services/video_effects/test_gpu_channel_host_provider.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace video_effects {

_;

namespace {

// Helper, returns dummy (but valid) VideoBufferHandlePtr.
media::mojom::VideoBufferHandlePtr GetDummyVideoBufferHandle() {}

class VideoEffectsProcessorTest : public testing::Test {};

TEST_F(VideoEffectsProcessorTest, InitializeSucceeds) {}

TEST_F(VideoEffectsProcessorTest, ErrorCallbackCalledWhenManagerDisconnects) {}

TEST_F(VideoEffectsProcessorTest, ErrorCallbackCalledWhenProcessorDisconnects) {}

// TODO(b/333097635): Figure out how to mock/fake the GpuChannel so that it
// does not raise context loss events immediately after creating context
// providers.
TEST_F(VideoEffectsProcessorTest,
       DISABLED_ErrorCallbackCalledContextRecreationFailed) {}

// TODO(b/333097635): Figure out how to mock/fake the GpuChannel so that it
// does not raise context loss events immediately after creating context
// providers.
TEST_F(VideoEffectsProcessorTest,
       DISABLED_ProcessorGivesUpAfterTooManyContextLosses) {}

TEST_F(VideoEffectsProcessorTest, PostProcessRunsAndFails) {}

}  // namespace

}  // namespace video_effects