#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "build/build_config.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/env.h"
#include "ui/aura/window_tree_host_platform.h"
#include "ui/base/hit_test.h"
#include "ui/base/ime/input_method.h"
#include "ui/base/test/ui_controls.h"
#include "ui/platform_window/platform_window.h"
#include "ui/platform_window/wm/wm_move_resize_handler.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/test/widget_activation_waiter.h"
#include "ui/views/test/widget_test.h"
#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h"
#include "ui/views/widget/widget_delegate.h"
#include "ui/views/window/native_frame_view.h"
#if BUILDFLAG(IS_LINUX)
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h"
#include "ui/views/widget/desktop_aura/window_event_filter_linux.h"
DesktopWindowTreeHostPlatformImpl;
#else
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_lacros.h"
#include "ui/views/widget/desktop_aura/window_event_filter_lacros.h"
using DesktopWindowTreeHostPlatformImpl = views::DesktopWindowTreeHostLacros;
#endif
namespace views {
namespace {
bool IsNonClientComponent(int hittest) { … }
std::unique_ptr<Widget> CreateWidget(const gfx::Rect& bounds) { … }
void DispatchMouseMotionEventSync(const gfx::Point& point_in_screen) { … }
class MouseMoveCounterHandler : public ui::EventHandler { … };
class FakeWmMoveResizeHandler : public ui::WmMoveResizeHandler { … };
void SetExpectationBasedOnHittestValue(
int hittest,
const FakeWmMoveResizeHandler& handler,
const gfx::Point& pointer_location_in_px) { … }
class HitTestNonClientFrameView : public NativeFrameView { … };
class HitTestWidgetDelegate : public WidgetDelegate { … };
class TestDesktopWindowTreeHostPlatformImpl
: public DesktopWindowTreeHostPlatformImpl { … };
}
class DesktopWindowTreeHostPlatformImplTest
: public test::DesktopWidgetTestInteractive,
public views::WidgetObserver { … };
class DesktopWindowTreeHostPlatformImplTestWithTouch
: public DesktopWindowTreeHostPlatformImplTest,
public testing::WithParamInterface<bool> { … };
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#define MAYBE_HitTest …
#else
#define MAYBE_HitTest …
#endif
TEST_P(DesktopWindowTreeHostPlatformImplTestWithTouch, MAYBE_HitTest) { … }
TEST_P(DesktopWindowTreeHostPlatformImplTestWithTouch,
DoubleClickHeaderMaximizes) { … }
TEST_P(DesktopWindowTreeHostPlatformImplTestWithTouch,
DoubleClickTwoDifferentTargetsDoesntMaximizes) { … }
TEST_F(DesktopWindowTreeHostPlatformImplTest,
RightClickDuringDoubleClickDoesntMaximize) { … }
TEST_F(DesktopWindowTreeHostPlatformImplTest, Deactivate) { … }
TEST_F(DesktopWindowTreeHostPlatformImplTest, CaptureEventForwarding) { … }
TEST_F(DesktopWindowTreeHostPlatformImplTest, InputMethodFocus) { … }
INSTANTIATE_TEST_SUITE_P(…);
}