Flutter Linux Embedder
fl_subsurface_test.cc File Reference
#include <wayland-client.h>
#include "gtest/gtest.h"
#include "flutter/shell/platform/linux/fl_wayland_display.h"
#include "flutter/shell/platform/linux/testing/wayland_test.h"

Go to the source code of this file.

Classes

class  FlSubsurfaceTest
 

Functions

 TEST_F (FlSubsurfaceTest, Create)
 
 TEST_F (FlSubsurfaceTest, EmptyInputRegion)
 
 TEST_F (FlSubsurfaceTest, Synchronized)
 
 TEST_F (FlSubsurfaceTest, SetPosition)
 
 TEST_F (FlSubsurfaceTest, Destroy)
 

Function Documentation

◆ TEST_F() [1/5]

TEST_F ( FlSubsurfaceTest  ,
Create   
)

Definition at line 38 of file fl_subsurface_test.cc.

38  {
39  // A surface and a subsurface attached to the parent surface are created.
40  EXPECT_CALL(wayland, CreateObject(::testing::StrEq("wl_surface")));
41  EXPECT_CALL(wayland, CreateObject(::testing::StrEq("wl_subsurface")));
42 
43  g_autoptr(FlSubsurface) subsurface = CreateSubsurface();
44  ASSERT_NE(subsurface, nullptr);
45  EXPECT_NE(fl_subsurface_get_surface(subsurface), nullptr);
46 }
g_autoptr(FlEngine) engine
struct wl_surface * fl_subsurface_get_surface(FlSubsurface *self)
G_BEGIN_DECLS FlSubsurface * subsurface

References fl_subsurface_get_surface(), g_autoptr(), and subsurface.

◆ TEST_F() [2/5]

TEST_F ( FlSubsurfaceTest  ,
Destroy   
)

Definition at line 84 of file fl_subsurface_test.cc.

84  {
85  FlSubsurface* subsurface = CreateSubsurface();
86  ASSERT_NE(subsurface, nullptr);
87 
88  EXPECT_CALL(wayland, DestroyObject(::testing::StrEq("wl_subsurface")));
89  EXPECT_CALL(wayland, DestroyObject(::testing::StrEq("wl_surface")));
90 
91  g_object_unref(subsurface);
92 }

References subsurface.

◆ TEST_F() [3/5]

TEST_F ( FlSubsurfaceTest  ,
EmptyInputRegion   
)

Definition at line 50 of file fl_subsurface_test.cc.

50  {
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")));
56 
57  g_autoptr(FlSubsurface) subsurface = CreateSubsurface();
58  ASSERT_NE(subsurface, nullptr);
59 }

References g_autoptr(), and subsurface.

◆ TEST_F() [4/5]

TEST_F ( FlSubsurfaceTest  ,
SetPosition   
)

Definition at line 71 of file fl_subsurface_test.cc.

71  {
72  g_autoptr(FlSubsurface) subsurface = CreateSubsurface();
73  ASSERT_NE(subsurface, nullptr);
74 
75  EXPECT_CALL(wayland, Request(::testing::StrEq("wl_subsurface"),
76  WL_SUBSURFACE_SET_POSITION))
77  .Times(2);
78 
81 }
void fl_subsurface_set_position(FlSubsurface *self, gint x, gint y)

References fl_subsurface_set_position(), g_autoptr(), and subsurface.

◆ TEST_F() [5/5]

TEST_F ( FlSubsurfaceTest  ,
Synchronized   
)

Definition at line 63 of file fl_subsurface_test.cc.

63  {
64  EXPECT_CALL(wayland, Request(::testing::StrEq("wl_subsurface"),
65  WL_SUBSURFACE_SET_SYNC));
66 
67  g_autoptr(FlSubsurface) subsurface = CreateSubsurface();
68  ASSERT_NE(subsurface, nullptr);
69 }

References g_autoptr(), and subsurface.