Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/touch_input_test.cpp
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Line(s) | |||||
95 | { | 95 | { | ||
96 | using namespace KWayland::Client; | 96 | using namespace KWayland::Client; | ||
97 | #define VERIFY(statement) \ | 97 | #define VERIFY(statement) \ | ||
98 | if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__))\ | 98 | if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__))\ | ||
99 | return nullptr; | 99 | return nullptr; | ||
100 | #define COMPARE(actual, expected) \ | 100 | #define COMPARE(actual, expected) \ | ||
101 | if (!QTest::qCompare(actual, expected, #actual, #expected, __FILE__, __LINE__))\ | 101 | if (!QTest::qCompare(actual, expected, #actual, #expected, __FILE__, __LINE__))\ | ||
102 | return nullptr; | 102 | return nullptr; | ||
103 | QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded); | | |||
104 | VERIFY(clientAddedSpy.isValid()); | | |||
105 | 103 | | |||
106 | Surface *surface = Test::createSurface(Test::waylandCompositor()); | 104 | Surface *surface = Test::createSurface(Test::waylandCompositor()); | ||
107 | VERIFY(surface); | 105 | VERIFY(surface); | ||
108 | ShellSurface *shellSurface = Test::createShellSurface(surface, surface); | 106 | ShellSurface *shellSurface = Test::createShellSurface(surface, surface); | ||
109 | VERIFY(shellSurface); | 107 | VERIFY(shellSurface); | ||
110 | // let's render | 108 | // let's render | ||
111 | Test::render(surface, QSize(100, 50), Qt::blue); | 109 | auto c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); | ||
112 | 110 | | |||
113 | Test::flushWaylandConnection(); | | |||
114 | VERIFY(clientAddedSpy.wait()); | | |||
115 | AbstractClient *c = workspace()->activeClient(); | | |||
116 | VERIFY(c); | 111 | VERIFY(c); | ||
117 | COMPARE(clientAddedSpy.first().first().value<ShellClient*>(), c); | 112 | COMPARE(workspace()->activeClient(), c); | ||
118 | 113 | | |||
119 | #undef VERIFY | 114 | #undef VERIFY | ||
120 | #undef COMPARE | 115 | #undef COMPARE | ||
121 | 116 | | |||
122 | return c; | 117 | return c; | ||
123 | } | 118 | } | ||
124 | 119 | | |||
125 | void TouchInputTest::testMultipleTouchPoints() | 120 | void TouchInputTest::testMultipleTouchPoints() | ||
▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines |