-
Notifications
You must be signed in to change notification settings - Fork 33
feat: add prelaunch splash v2 protocol support #740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| find_package(TreelandProtocols REQUIRED) | ||
| find_package(TreelandProtocols 0.5.5 REQUIRED) | ||
|
|
||
| local_qtwayland_server_protocol_treeland(libtreeland | ||
| PROTOCOL ${TREELAND_PROTOCOLS_DATA_DIR}/treeland-prelaunch-splash-v1.xml | ||
| BASENAME treeland-prelaunch-splash-v1 | ||
| PROTOCOL ${TREELAND_PROTOCOLS_DATA_DIR}/treeland-prelaunch-splash-v2.xml | ||
| BASENAME treeland-prelaunch-splash-v2 | ||
| ) | ||
|
Comment on lines
+1
to
6
|
||
|
|
||
| impl_treeland( | ||
|
|
@@ -11,7 +11,7 @@ impl_treeland( | |
| SOURCE | ||
| prelaunchsplash.h | ||
| prelaunchsplash.cpp | ||
| ${CMAKE_BINARY_DIR}/src/modules/prelaunch-splash/wayland-treeland-prelaunch-splash-v1-server-protocol.c | ||
| ${CMAKE_BINARY_DIR}/src/modules/prelaunch-splash/wayland-treeland-prelaunch-splash-v2-server-protocol.c | ||
| INCLUDE | ||
| $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> | ||
| LINK | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| find_package(Qt6 REQUIRED COMPONENTS Test) | ||
|
|
||
| add_executable(test_protocol_prelaunch-splash main.cpp) | ||
|
|
||
| target_link_libraries(test_protocol_prelaunch-splash | ||
| PRIVATE | ||
| libtreeland | ||
| Qt::Test | ||
| ) | ||
|
|
||
| add_test(NAME test_protocol_prelaunch-splash COMMAND test_protocol_prelaunch-splash) | ||
|
|
||
| set_property(TEST test_protocol_prelaunch-splash PROPERTY | ||
| ENVIRONMENT "QT_QPA_PLATFORM=offscreen" | ||
| ) | ||
|
|
||
| set_property(TEST test_protocol_prelaunch-splash PROPERTY | ||
| TIMEOUT 3 | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| // Copyright (C) 2025 UnionTech Software Technology Co., Ltd. | ||
| // SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only | ||
|
|
||
| #include "modules/prelaunch-splash/prelaunchsplash.h" | ||
|
|
||
| #include <wserver.h> | ||
|
|
||
| #include <QObject> | ||
| #include <QSignalSpy> | ||
| #include <QTest> | ||
|
|
||
| class PrelaunchSplashTest : public QObject | ||
| { | ||
| Q_OBJECT | ||
|
|
||
| WAYLIB_SERVER_NAMESPACE::WServer *m_server = nullptr; | ||
| PrelaunchSplash *m_protocol = nullptr; | ||
|
|
||
| public: | ||
| PrelaunchSplashTest(QObject *parent = nullptr) | ||
| : QObject(parent) | ||
| { | ||
| } | ||
|
|
||
| private Q_SLOTS: | ||
|
|
||
| void initTestCase() | ||
| { | ||
| m_server = new WAYLIB_SERVER_NAMESPACE::WServer(); | ||
| } | ||
|
|
||
| void testCreate() | ||
| { | ||
| m_protocol = m_server->attach<PrelaunchSplash>(); | ||
| QVERIFY(m_protocol != nullptr); | ||
| } | ||
|
|
||
| void verifyPrelaunchSplash() | ||
| { | ||
| QVERIFY(m_protocol != nullptr); | ||
| } | ||
|
|
||
| void testSignals() | ||
| { | ||
| QVERIFY(m_protocol != nullptr); | ||
|
|
||
| QSignalSpy splashRequestedSpy(m_protocol, | ||
| &PrelaunchSplash::splashRequested); | ||
| QVERIFY(splashRequestedSpy.isValid()); | ||
|
|
||
| QSignalSpy splashCloseSpy(m_protocol, | ||
| &PrelaunchSplash::splashCloseRequested); | ||
| QVERIFY(splashCloseSpy.isValid()); | ||
| } | ||
|
|
||
| void cleanupTestCase() | ||
| { | ||
| m_server->deleteLater(); | ||
| m_server = nullptr; | ||
| m_protocol = nullptr; | ||
| } | ||
| }; | ||
|
|
||
| QTEST_MAIN(PrelaunchSplashTest) | ||
| #include "main.moc" | ||
Uh oh!
There was an error while loading. Please reload this page.