#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/viz/service/frame_sinks/video_capture/video_capture_overlay.h"
#include <array>
#include <optional>
#include <utility>
#include <vector>
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/numerics/safe_conversions.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "cc/test/pixel_comparator.h"
#include "cc/test/pixel_test_utils.h"
#include "components/viz/test/paths.h"
#include "media/base/video_frame.h"
#include "media/base/video_types.h"
#include "media/base/video_util.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkImageInfo.h"
#include "third_party/skia/include/core/SkPixmap.h"
#include "ui/gfx/color_space.h"
#include "ui/gfx/color_transform.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/geometry/size.h"
VideoFrame;
VideoPixelFormat;
_;
InvokeWithoutArgs;
NiceMock;
Return;
StrictMock;
namespace viz {
namespace {
class MockFrameSource : public VideoCaptureOverlay::FrameSource { … };
class VideoCaptureOverlayTest : public testing::Test { … };
TEST_F(VideoCaptureOverlayTest, ReportsLostMojoConnection) { … }
TEST_F(VideoCaptureOverlayTest, CapturedFramePropertiesAreStringifiable) { … }
TEST_F(VideoCaptureOverlayTest, BlendInformationIsStringifiable) { … }
TEST_F(VideoCaptureOverlayTest,
CalculateBlendInformation_ReturnsNulloptIfEmptyProperties) { … }
TEST_F(VideoCaptureOverlayTest,
CalculateBlendInformation_ReturnsNulloptIfNoImage) { … }
TEST_F(VideoCaptureOverlayTest, CalculateBlendInformation_GoldenCase) { … }
TEST_F(VideoCaptureOverlayTest, DoesNotRenderWithoutImage) { … }
TEST_F(VideoCaptureOverlayTest, DoesNotRenderIfCompletelyOutOfBounds) { … }
TEST_F(VideoCaptureOverlayTest, DoesNotRenderIfEmptyBlitRect) { … }
TEST_F(VideoCaptureOverlayTest,
DoesNotDoCombinedRenderIfNoOverlaysWouldRender) { … }
class VideoCaptureOverlayRenderTest
: public VideoCaptureOverlayTest,
public testing::WithParamInterface<VideoPixelFormat> { … };
constexpr gfx::Size VideoCaptureOverlayRenderTest::kSourceSize;
TEST_P(VideoCaptureOverlayRenderTest, FullCover_NoScaling) { … }
TEST_P(VideoCaptureOverlayRenderTest, FullCover_WithScaling) { … }
TEST_P(VideoCaptureOverlayRenderTest, MovesAround) { … }
TEST_P(VideoCaptureOverlayRenderTest, ClipsToContentBounds) { … }
TEST_P(VideoCaptureOverlayRenderTest, HandlesEmptySubRegion) { … }
TEST_P(VideoCaptureOverlayRenderTest, ClipsToSubregionBounds) { … }
TEST_P(VideoCaptureOverlayRenderTest, ScalesToContentRegion) { … }
INSTANTIATE_TEST_SUITE_P(…);
}
}