chromium/content/browser/media/capture/mouse_cursor_overlay_controller_browsertest.cc

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

#include "content/browser/media/capture/mouse_cursor_overlay_controller.h"

#include "base/run_loop.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_tick_clock.h"
#include "build/chromeos_buildflags.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/content_browser_test.h"
#include "content/shell/browser/shell.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features_generated.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/geometry/size_f.h"

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ui/aura/client/cursor_shape_client.h"
#include "ui/wm/core/cursor_loader.h"  // nogncheck
#endif  // BUILDFLAG(IS_CHROMEOS_ASH)

Mock;

namespace content {

namespace {

const base::TimeDelta kMinWaitInterval =;

class MockOverlay final : public MouseCursorOverlayController::Overlay {};

}  // namespace

class MouseCursorOverlayControllerBrowserTest : public ContentBrowserTest {};

IN_PROC_BROWSER_TEST_F(MouseCursorOverlayControllerBrowserTest,
                       PositionsOverlayOnMouseMoves) {}

IN_PROC_BROWSER_TEST_F(MouseCursorOverlayControllerBrowserTest,
                       PositionsOverlayOnMouseClicks) {}

IN_PROC_BROWSER_TEST_F(MouseCursorOverlayControllerBrowserTest,
                       CursorHidesWhenMouseStopsMoving) {}

// This test verifies that MouseCoordinatesUpdated calls are forwarded to the
// overlay.
IN_PROC_BROWSER_TEST_F(MouseCursorOverlayControllerBrowserTest,
                       ForwardMouseEvents) {}

// This test verifies calls to MouseCoordinatesUpdated that don't change the
// coordinates are not forwarded to the overlay.
IN_PROC_BROWSER_TEST_F(MouseCursorOverlayControllerBrowserTest,
                       MouseEventsNotFiredIfNotMoved) {}

// This test verifies the minimal wait interval used between two calls
// to MouseCoordinatesUpdated.
IN_PROC_BROWSER_TEST_F(MouseCursorOverlayControllerBrowserTest,
                       MouseEventsEnsureMinWaitInterval) {}

class MouseCursorOverlayControllerNoMouseEventsBrowserTest
    : public MouseCursorOverlayControllerBrowserTest {};

// This test verifies calls to MouseCoordinatesUpdated are not forwarded if the
// CapturedMouseEvents preference is disabled.
IN_PROC_BROWSER_TEST_F(MouseCursorOverlayControllerNoMouseEventsBrowserTest,
                       DoNotForwardMouseEvents) {}

}  // namespace content