summaryrefslogtreecommitdiffstats
path: root/tests/auto/client/client/tst_client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/client/client/tst_client.cpp')
-rw-r--r--tests/auto/client/client/tst_client.cpp40
1 files changed, 19 insertions, 21 deletions
diff --git a/tests/auto/client/client/tst_client.cpp b/tests/auto/client/client/tst_client.cpp
index 1c2883249..253a98b73 100644
--- a/tests/auto/client/client/tst_client.cpp
+++ b/tests/auto/client/client/tst_client.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "mockcompositor.h"
@@ -21,8 +21,6 @@
using namespace MockCompositor;
-static const QSize screenSize(1600, 1200);
-
constexpr int dataDeviceVersion = 1;
class TestCompositor : public WlShellCompositor {
@@ -174,21 +172,21 @@ void tst_WaylandClient::activeWindowFollowsKeyboardFocus()
Surface *s = nullptr;
QCOMPOSITOR_TRY_VERIFY(s = surface());
- exec([=] {
+ exec([&] {
sendShellSurfaceConfigure(s);
});
QCOMPOSITOR_TRY_VERIFY(window.isExposed());
QCOMPARE(window.focusInEventCount, 0);
- exec([=] {
+ exec([&] {
keyboard()->sendEnter(s);
});
QTRY_COMPARE(window.focusInEventCount, 1);
QCOMPARE(QGuiApplication::focusWindow(), &window);
QCOMPARE(window.focusOutEventCount, 0);
- exec([=] {
+ exec([&] {
keyboard()->sendLeave(s); // or implement setFocus in Keyboard
});
QTRY_COMPARE(window.focusOutEventCount, 1);
@@ -202,7 +200,7 @@ void tst_WaylandClient::events()
Surface *s = nullptr;
QCOMPOSITOR_TRY_VERIFY(s = surface());
- exec([=] {
+ exec([&] {
sendShellSurfaceConfigure(s);
});
@@ -210,7 +208,7 @@ void tst_WaylandClient::events()
QCOMPARE(window.focusInEventCount, 0);
- exec([=] {
+ exec([&] {
keyboard()->sendEnter(s);
});
QTRY_COMPARE(window.focusInEventCount, 1);
@@ -224,14 +222,14 @@ void tst_WaylandClient::events()
// xkb_v1 1 libxkbcommon compatible; to determine the xkb keycode, clients must add 8 to the key event keycode
uint keyCode = 80; // arbitrarily chosen
QCOMPARE(window.keyPressEventCount, 0);
- exec([=] {
+ exec([&] {
keyboard()->sendKey(client(), keyCode - 8, Keyboard::key_state_pressed); // related with native scan code
});
QTRY_COMPARE(window.keyPressEventCount, 1);
QCOMPARE(window.keyCode, keyCode);
QCOMPARE(window.keyReleaseEventCount, 0);
- exec([=] {
+ exec([&] {
keyboard()->sendKey(client(), keyCode - 8, Keyboard::key_state_released); // related with native scan code
});
QTRY_COMPARE(window.keyReleaseEventCount, 1);
@@ -243,12 +241,12 @@ void tst_WaylandClient::events()
});
// Note: wl_touch.frame should not be the last event in a test until QTBUG-66563 is fixed.
// See also: QTBUG-66537
- exec([=] {
+ exec([&] {
touch()->sendFrame(client());
});
QTRY_COMPARE(window.touchEventCount, 1);
- exec([=] {
+ exec([&] {
touch()->sendUp(client(), touchId);
touch()->sendFrame(client());
});
@@ -268,7 +266,7 @@ void tst_WaylandClient::events()
QTRY_COMPARE(window.mousePressPos, mousePressPos);
QCOMPARE(window.mouseReleaseEventCount, 0);
- exec([=] {
+ exec([&] {
pointer()->sendButton(client(), BTN_LEFT, Pointer::button_state_released);
pointer()->sendFrame(client());
});
@@ -282,7 +280,7 @@ void tst_WaylandClient::backingStore()
Surface *s = nullptr;
QCOMPOSITOR_TRY_VERIFY(s = surface());
- exec([=] {
+ exec([&] {
sendShellSurfaceConfigure(s);
});
@@ -393,7 +391,7 @@ void tst_WaylandClient::touchDrag()
Surface *s = nullptr;
QCOMPOSITOR_TRY_VERIFY(s = surface());
- exec([=] {
+ exec([&] {
sendShellSurfaceConfigure(s);
});
@@ -407,7 +405,7 @@ void tst_WaylandClient::touchDrag()
&test, &DNDTest::touchDrag);
});
- exec([=] {
+ exec([&] {
keyboard()->sendEnter(s);
});
QTRY_COMPARE(QGuiApplication::focusWindow(), &window);
@@ -430,7 +428,7 @@ void tst_WaylandClient::mouseDrag()
Surface *s = nullptr;
QCOMPOSITOR_TRY_VERIFY(s = surface());
- exec([=] {
+ exec([&] {
sendShellSurfaceConfigure(s);
});
@@ -443,7 +441,7 @@ void tst_WaylandClient::mouseDrag()
&test, &DNDTest::finishMouseDrag);
});
- exec([=] {
+ exec([&] {
keyboard()->sendEnter(s);
});
QTRY_COMPARE(QGuiApplication::focusWindow(), &window);
@@ -518,7 +516,7 @@ void tst_WaylandClient::hiddenPopupParent()
// with the set_popup request.
Surface *s = nullptr;
QCOMPOSITOR_TRY_VERIFY(s = surface());
- exec([=] {
+ exec([&] {
sendShellSurfaceConfigure(s);
});
QCOMPOSITOR_TRY_VERIFY(toplevel.isExposed());
@@ -555,7 +553,7 @@ void tst_WaylandClient::glWindow()
testWindow->show();
Surface *s = nullptr;
QCOMPOSITOR_TRY_VERIFY(s = surface());
- exec([=] {
+ exec([&] {
sendShellSurfaceConfigure(s);
});
@@ -590,7 +588,7 @@ void tst_WaylandClient::longWindowTitleWithUtf16Characters()
{
QWindow window;
QString absurdlyLongTitle = QString("δΈ‰").repeated(10000);
- Q_ASSERT(absurdlyLongTitle.length() == 10000); // just making sure the test isn't broken
+ Q_ASSERT(absurdlyLongTitle.size() == 10000); // just making sure the test isn't broken
window.setTitle(absurdlyLongTitle);
window.show();
QCOMPOSITOR_TRY_VERIFY(surface());