5 #include <wayland-client.h>
7 #include "gtest/gtest.h"
10 #include "flutter/shell/platform/linux/testing/wayland_test.h"
12 using flutter::testing::fl_mock_wayland_free_surface;
13 using flutter::testing::fl_mock_wayland_get_display;
14 using flutter::testing::fl_mock_wayland_get_surface;
20 ASSERT_NE(display_,
nullptr);
21 parent_surface_ = fl_mock_wayland_get_surface();
25 g_clear_object(&display_);
26 fl_mock_wayland_free_surface(parent_surface_);
34 FlWaylandDisplay* display_ =
nullptr;
35 struct wl_surface* parent_surface_ =
nullptr;
40 EXPECT_CALL(wayland, CreateObject(::testing::StrEq(
"wl_surface")));
41 EXPECT_CALL(wayland, CreateObject(::testing::StrEq(
"wl_subsurface")));
51 ::testing::InSequence sequence;
52 EXPECT_CALL(wayland, CreateObject(::testing::StrEq(
"wl_region")));
53 EXPECT_CALL(wayland, Request(::testing::StrEq(
"wl_surface"),
54 WL_SURFACE_SET_INPUT_REGION));
55 EXPECT_CALL(wayland, DestroyObject(::testing::StrEq(
"wl_region")));
64 EXPECT_CALL(wayland, Request(::testing::StrEq(
"wl_subsurface"),
65 WL_SUBSURFACE_SET_SYNC));
75 EXPECT_CALL(wayland, Request(::testing::StrEq(
"wl_subsurface"),
76 WL_SUBSURFACE_SET_POSITION))
88 EXPECT_CALL(wayland, DestroyObject(::testing::StrEq(
"wl_subsurface")));
89 EXPECT_CALL(wayland, DestroyObject(::testing::StrEq(
"wl_surface")));
FlSubsurface * CreateSubsurface()
g_autoptr(FlEngine) engine
void fl_subsurface_set_position(FlSubsurface *self, gint x, gint y)
struct wl_surface * fl_subsurface_get_surface(FlSubsurface *self)
G_BEGIN_DECLS FlSubsurface * subsurface
TEST_F(FlSubsurfaceTest, Create)
FlSubsurface * fl_wayland_display_create_subsurface(FlWaylandDisplay *self, struct wl_surface *parent_surface)
FlWaylandDisplay * fl_wayland_display_open(struct wl_display *wl_display)