#include "third_party/blink/renderer/platform/graphics/video_frame_submitter.h"
#include <memory>
#include <tuple>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/read_only_shared_memory_region.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "cc/layers/video_frame_provider.h"
#include "cc/metrics/video_playback_roughness_reporter.h"
#include "cc/test/layer_test_common.h"
#include "cc/trees/layer_tree_settings.h"
#include "cc/trees/task_runner_provider.h"
#include "components/viz/common/features.h"
#include "components/viz/test/fake_external_begin_frame_source.h"
#include "components/viz/test/test_context_provider.h"
#include "gpu/ipc/client/client_shared_image_interface.h"
#include "media/base/video_frame.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "services/viz/public/mojom/compositing/compositor_frame_sink.mojom-blink.h"
#include "services/viz/public/mojom/compositing/layer_context.mojom-blink.h"
#include "services/viz/public/mojom/hit_test/hit_test_region_list.mojom-blink.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/graphics/test/mock_compositor_frame_sink.h"
#include "third_party/blink/renderer/platform/graphics/test/mock_embedded_frame_sink_provider.h"
#include "third_party/blink/renderer/platform/graphics/video_frame_resource_provider.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
_;
AnyNumber;
Invoke;
Return;
StrictMock;
namespace blink {
namespace {
class MockVideoFrameProvider : public cc::VideoFrameProvider { … };
class VideoMockCompositorFrameSink
: public viz::mojom::blink::CompositorFrameSink { … };
class MockVideoFrameResourceProvider
: public blink::VideoFrameResourceProvider { … };
}
class VideoFrameSubmitterTest : public testing::Test,
public testing::WithParamInterface<bool> { … };
enum class SubmissionType { … };
#define EXPECT_GET_PUT_FRAME() …
#define EXPECT_SUBMISSION(type) …
TEST_P(VideoFrameSubmitterTest, StatRenderingFlipsBits) { … }
TEST_P(VideoFrameSubmitterTest, StopRenderingSkipsUpdateCurrentFrame) { … }
TEST_P(VideoFrameSubmitterTest, StopUsingProviderNullsProvider) { … }
TEST_P(VideoFrameSubmitterTest,
StopUsingProviderSubmitsFrameAndStopsRendering) { … }
TEST_P(VideoFrameSubmitterTest, DidReceiveFrameStillSubmitsIfRendering) { … }
TEST_P(VideoFrameSubmitterTest, DidReceiveFrameSubmitsFrame) { … }
TEST_P(VideoFrameSubmitterTest, ShouldSubmitPreventsSubmission) { … }
TEST_P(VideoFrameSubmitterTest, SetForceSubmitForcesSubmission) { … }
TEST_P(VideoFrameSubmitterTest, RotationInformationPassedToResourceProvider) { … }
TEST_P(VideoFrameSubmitterTest, FrameTransformTakesPrecedent) { … }
TEST_P(VideoFrameSubmitterTest, OnBeginFrameSubmitsFrame) { … }
TEST_P(VideoFrameSubmitterTest, MissedFrameArgDoesNotProduceFrame) { … }
TEST_P(VideoFrameSubmitterTest, MissingProviderDoesNotProduceFrame) { … }
TEST_P(VideoFrameSubmitterTest, NoUpdateOnFrameDoesNotProduceFrame) { … }
TEST_P(VideoFrameSubmitterTest, NotRenderingDoesNotProduceFrame) { … }
TEST_P(VideoFrameSubmitterTest, ReturnsResourceOnCompositorAck) { … }
TEST_P(VideoFrameSubmitterTest, WaitingForAckPreventsNewFrame) { … }
TEST_P(VideoFrameSubmitterTest, WaitingForAckPreventsSubmitSingleFrame) { … }
TEST_P(VideoFrameSubmitterTest, RecreateCompositorFrameSinkAfterContextLost) { … }
TEST_P(VideoFrameSubmitterTest,
RecreateCompositorFrameSinkAfterContextLostSoftwareCompositing) { … }
TEST_P(VideoFrameSubmitterTest, StopUsingProviderDuringContextLost) { … }
TEST_P(VideoFrameSubmitterTest, FrameSizeChangeUpdatesLocalSurfaceId) { … }
TEST_P(VideoFrameSubmitterTest, VideoRotationOutputRect) { … }
TEST_P(VideoFrameSubmitterTest, PageVisibilityControlsSubmission) { … }
TEST_P(VideoFrameSubmitterTest, PreferredInterval) { … }
TEST_P(VideoFrameSubmitterTest, NoDuplicateFramesOnBeginFrame) { … }
TEST_P(VideoFrameSubmitterTest, NoDuplicateFramesDidReceiveFrame) { … }
TEST_P(VideoFrameSubmitterTest, ZeroSizedFramesAreNotSubmitted) { … }
TEST_P(VideoFrameSubmitterTest, ProcessTimingDetails) { … }
INSTANTIATE_TEST_SUITE_P(…);
}