chromium/ui/ozone/platform/wayland/host/wayland_pointer_unittest.cc

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

#include <linux/input.h>
#include <wayland-server.h>

#include <cmath>
#include <memory>

#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "build/chromeos_buildflags.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/cursor/mojom/cursor_type.mojom-shared.h"
#include "ui/base/cursor/platform_cursor.h"
#include "ui/events/devices/device_data_manager.h"
#include "ui/events/event.h"
#include "ui/ozone/common/bitmap_cursor_factory.h"
#include "ui/ozone/platform/wayland/host/wayland_cursor.h"
#include "ui/ozone/platform/wayland/host/wayland_cursor_factory.h"
#include "ui/ozone/platform/wayland/host/wayland_seat.h"
#include "ui/ozone/platform/wayland/host/wayland_window.h"
#include "ui/ozone/platform/wayland/test/mock_pointer.h"
#include "ui/ozone/platform/wayland/test/mock_surface.h"
#include "ui/ozone/platform/wayland/test/test_wayland_server_thread.h"
#include "ui/ozone/platform/wayland/test/test_zcr_pointer_stylus.h"
#include "ui/ozone/platform/wayland/test/wayland_test.h"
#include "ui/ozone/test/mock_platform_window_delegate.h"
#include "ui/platform_window/platform_window_init_properties.h"

_;
AllOf;
Ge;
Le;
Mock;
Ne;
SaveArg;
Values;

namespace ui {

class WaylandPointerTest : public WaylandTestSimple {};

void SendAxisEvents(struct wl_resource* resource,
                    uint32_t time_ms,
                    uint32_t axis_source,
                    uint32_t axis,
                    int offset) {}

void SendDiagonalAxisEvents(struct wl_resource* resource,
                            uint32_t time_ms,
                            uint32_t axis_source,
                            int offset_x,
                            int offset_y) {}

ACTION_P(CloneEvent, ptr) {}

TEST_F(WaylandPointerTest, Enter) {}

TEST_F(WaylandPointerTest, Leave) {}

ACTION_P3(CloneEventAndCheckCapture, window, result, ptr) {}

TEST_F(WaylandPointerTest, Motion) {}

TEST_F(WaylandPointerTest, MotionDragged) {}

TEST_F(WaylandPointerTest, MotionDraggedWithStylus) {}

// Verifies whether the platform event source handles all types of axis sources.
// The actual behaviour of each axis source is not tested here.
TEST_F(WaylandPointerTest, AxisSourceTypes) {}

// This test ensures Ozone/Wayland does not crash when spurious
// `stylus tool` and `axis source` events are sent by the Compositor, prior
// to a pointer clicking event.
// In practice, this might happen with specific compositors, eg Exo, when a
// device wakes up from sleeping.
TEST_F(WaylandPointerTest, SpuriousAxisSourceAndStylusToolEvents) {}

TEST_F(WaylandPointerTest, Axis) {}

TEST_F(WaylandPointerTest, SetBitmap) {}

// Tests that bitmap is set on pointer focus and the pointer surface respects
// provided scale of the surface image.
TEST_F(WaylandPointerTest, SetBitmapAndScaleOnPointerFocus) {}

TEST_F(WaylandPointerTest, FlingVertical) {}

TEST_F(WaylandPointerTest, FlingHorizontal) {}

TEST_F(WaylandPointerTest, FlingCancel) {}

TEST_F(WaylandPointerTest, FlingDiagonal) {}

// The case tested here should not actually occur in a good implementation of
// the Wayland protocol.
TEST_F(WaylandPointerTest, FlingVelocityWithoutLeadingAxis) {}

TEST_F(WaylandPointerTest, FlingVelocityWithSingleLeadingAxis) {}

}  // namespace ui