From 6a244c5e13a4962d0cc95b47bcb85553cb877ea2 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 5 May 2021 23:45:03 +0100 Subject: [PATCH] Port IVI Application test from shared_old Change-Id: I65fbe66fe75fe4372852deadefea796576860d67 Reviewed-by: Eskil Abrahamsen Blomfeldt --- tests/auto/wayland/shared/CMakeLists.txt | 2 ++ tests/auto/wayland/shared/mockcompositor.cpp | 3 +++ tests/auto/wayland/shared/mockcompositor.h | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/auto/wayland/shared/CMakeLists.txt b/tests/auto/wayland/shared/CMakeLists.txt index 530acf26425..6116688c36e 100644 --- a/tests/auto/wayland/shared/CMakeLists.txt +++ b/tests/auto/wayland/shared/CMakeLists.txt @@ -8,6 +8,7 @@ add_library(SharedClientTest coreprotocol.cpp coreprotocol.h datadevice.cpp datadevice.h fullscreenshellv1.cpp fullscreenshellv1.h + iviapplication.cpp iviapplication.h mockcompositor.cpp mockcompositor.h textinput.cpp textinput.h xdgoutputv1.cpp xdgoutputv1.h @@ -19,6 +20,7 @@ set_property(TARGET SharedClientTest PROPERTY AUTOMOC ON) qt6_generate_wayland_protocol_server_sources(SharedClientTest FILES ${PROJECT_SOURCE_DIR}/src/3rdparty/protocol/fullscreen-shell-unstable-v1.xml + ${PROJECT_SOURCE_DIR}/src/3rdparty/protocol/ivi-application.xml ${PROJECT_SOURCE_DIR}/src/3rdparty/protocol/wp-primary-selection-unstable-v1.xml ${PROJECT_SOURCE_DIR}/src/3rdparty/protocol/tablet-unstable-v2.xml ${PROJECT_SOURCE_DIR}/src/3rdparty/protocol/text-input-unstable-v2.xml diff --git a/tests/auto/wayland/shared/mockcompositor.cpp b/tests/auto/wayland/shared/mockcompositor.cpp index c958e6e8182..62fa44f0e8b 100644 --- a/tests/auto/wayland/shared/mockcompositor.cpp +++ b/tests/auto/wayland/shared/mockcompositor.cpp @@ -1,5 +1,6 @@ /**************************************************************************** ** +** Copyright (C) 2021 David Edmundson ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** @@ -45,6 +46,8 @@ DefaultCompositor::DefaultCompositor() add(); add(); add(); + add(); + // TODO: other shells, viewporter, xdgoutput etc QObject::connect(get(), &WlCompositor::surfaceCreated, [&] (Surface *surface){ diff --git a/tests/auto/wayland/shared/mockcompositor.h b/tests/auto/wayland/shared/mockcompositor.h index 878560a243f..44952a0857c 100644 --- a/tests/auto/wayland/shared/mockcompositor.h +++ b/tests/auto/wayland/shared/mockcompositor.h @@ -1,5 +1,6 @@ /**************************************************************************** ** +** Copyright (C) 2021 David Edmundson ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** @@ -32,8 +33,9 @@ #include "corecompositor.h" #include "coreprotocol.h" #include "datadevice.h" -#include "xdgshell.h" #include "fullscreenshellv1.h" +#include "iviapplication.h" +#include "xdgshell.h" #include @@ -66,6 +68,7 @@ public: Surface *cursorSurface() { auto *p = pointer(); return p ? p->cursorSurface() : nullptr; } Keyboard *keyboard() { auto *seat = get(); Q_ASSERT(seat); return seat->m_keyboard; } FullScreenShellV1 *fullScreenShellV1() {return get();}; + IviSurface *iviSurface(int i = 0) { return get()->m_iviSurfaces.value(i, nullptr); } uint sendXdgShellPing(); void xdgPingAndWaitForPong(); // Things that can be changed run-time without confusing the client (i.e. don't require separate tests)