#include "content/browser/media/capture/web_contents_frame_tracker.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "content/browser/media/capture/mouse_cursor_overlay_controller.h"
#include "content/browser/media/capture/web_contents_video_capture_device.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_utils.h"
#include "content/test/test_render_view_host.h"
#include "content/test/test_web_contents.h"
#include "media/base/media_switches.h"
#include "media/capture/mojom/video_capture_types.mojom.h"
#include "media/capture/video/video_capture_feedback.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/display/screen_info.h"
namespace content {
namespace {
_;
Invoke;
NiceMock;
StrictMock;
constexpr viz::FrameSinkId kInitSinkId(123, 456);
constexpr gfx::Size kSizeZero{ … };
constexpr gfx::Size kSize720p{ … };
constexpr gfx::Size kSize1080p{ … };
constexpr gfx::Size kSizeWsxgaPlus{ … };
class SimpleContext : public WebContentsFrameTracker::Context { … };
class MockCaptureDevice : public WebContentsVideoCaptureDevice { … };
class WebContentsFrameTrackerTest : public RenderViewHostTestHarness { … };
TEST_F(WebContentsFrameTrackerTest, CalculatesPreferredSizeClampsToView) { … }
TEST_F(WebContentsFrameTrackerTest,
CalculatesPreferredSizeNoLargerThanCaptureSize) { … }
TEST_F(WebContentsFrameTrackerTest,
CalculatesPreferredSizeWithCorrectAspectRatio) { … }
TEST_F(WebContentsFrameTrackerTest,
CalculatesPreferredSizeAspectRatioWithNoOffByOneErrors) { … }
TEST_F(WebContentsFrameTrackerTest,
CalculatesPreferredSizeLeavesCaptureSizeIfSmallerThanScreen) { … }
TEST_F(WebContentsFrameTrackerTest,
CalculatesPreferredSizeWithZeroValueProperly) { … }
TEST_F(WebContentsFrameTrackerTest, UpdatesPreferredSizeOnWebContents) { … }
TEST_F(WebContentsFrameTrackerTest, NotifiesOfLostTargets) { … }
TEST_F(WebContentsFrameTrackerTest, NotifiesOfTargetChanges) { … }
TEST_F(WebContentsFrameTrackerTest,
CroppingChangesTargetParametersAndInvokesCallback) { … }
TEST_F(WebContentsFrameTrackerTest, SetsScaleOverride) { … }
TEST_F(WebContentsFrameTrackerTest, SettingScaleFactorMaintainsStableCapture) { … }
TEST_F(WebContentsFrameTrackerTest, HighDpiIsRoundedIfBetweenBounds) { … }
TEST_F(WebContentsFrameTrackerTest, HighDpiIsRoundedIfBetweenDifferentBounds) { … }
TEST_F(WebContentsFrameTrackerTest, HighDpiIsRoundedToMinimum) { … }
TEST_F(WebContentsFrameTrackerTest, HighDpiIsRoundedToMaximum) { … }
TEST_F(WebContentsFrameTrackerTest, HighDpiScalingIsStable) { … }
TEST_F(WebContentsFrameTrackerTest, HighDpiAdjustsForResourceUtilization) { … }
TEST_F(WebContentsFrameTrackerTest, HighDpiAdjustsForMaxPixelRate) { … }
}
}