#include "third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler.h"
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/test/gmock_callback_support.h"
#include "media/base/limits.h"
#include "media/base/video_frame_converter.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
#include "third_party/blink/public/web/web_heap.h"
#include "third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.h"
#include "third_party/blink/renderer/platform/graphics/static_bitmap_image_to_video_frame_copier.h"
#include "third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.h"
#include "third_party/blink/renderer/platform/mediastream/media_stream_component.h"
#include "third_party/blink/renderer/platform/mediastream/media_stream_source.h"
#include "third_party/blink/renderer/platform/testing/io_task_runner_testing_platform_support.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/video_capture/video_capturer_source.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkImageInfo.h"
#include "third_party/skia/include/core/SkRefCnt.h"
#include "ui/gfx/geometry/size.h"
RunOnceClosure;
_;
InSequence;
Mock;
SaveArg;
Test;
TestWithParam;
namespace blink {
namespace {
static const int kTestCanvasCaptureWidth = …;
static const int kTestCanvasCaptureHeight = …;
static const double kTestCanvasCaptureFramesPerSecond = …;
static const int kTestCanvasCaptureFrameEvenSize = …;
static const int kTestCanvasCaptureFrameOddSize = …;
static const int kTestCanvasCaptureFrameColorErrorTolerance = …;
static const int kTestAlphaValue = …;
}
class CanvasCaptureHandlerTest
: public TestWithParam<testing::tuple<bool, int, int>> { … };
TEST_F(CanvasCaptureHandlerTest, ConstructAndDestruct) { … }
TEST_F(CanvasCaptureHandlerTest, DestructTrack) { … }
TEST_F(CanvasCaptureHandlerTest, DestructHandler) { … }
TEST_P(CanvasCaptureHandlerTest, GetFormatsStartAndStop) { … }
TEST_P(CanvasCaptureHandlerTest, VerifyFrame) { … }
TEST_F(CanvasCaptureHandlerTest, DropAlphaDeliversOpaqueFrame) { … }
TEST_F(CanvasCaptureHandlerTest, CheckNeedsNewFrame) { … }
INSTANTIATE_TEST_SUITE_P(…);
}