summaryrefslogtreecommitdiffstats
path: root/tests/auto/other
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/other')
-rw-r--r--tests/auto/other/gestures/BLACKLIST1
-rw-r--r--tests/auto/other/lancelot/paintcommands.cpp28
-rw-r--r--tests/auto/other/lancelot/paintcommands.h1
-rw-r--r--tests/auto/other/lancelot/scripts/degeneratebeziers.qps28
-rw-r--r--tests/auto/other/lancelot/scripts/richtext.qps9
-rw-r--r--tests/auto/other/macgui/macgui.pro1
-rw-r--r--tests/auto/other/macnativeevents/BLACKLIST1
-rw-r--r--tests/auto/other/macplist/macplist.pro2
-rw-r--r--tests/auto/other/other.pro13
-rw-r--r--tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp55
-rw-r--r--tests/auto/other/qcomplextext/bidireorderstring.h2
-rw-r--r--tests/auto/other/qcomplextext/tst_qcomplextext.cpp13
-rw-r--r--tests/auto/other/qobjectrace/qobjectrace.pro3
-rw-r--r--tests/auto/other/qobjectrace/tst_qobjectrace.cpp16
-rw-r--r--tests/auto/other/qprocess_and_guieventloop/write-read-write/write-read-write.pro4
-rw-r--r--tests/auto/other/toolsupport/tst_toolsupport.cpp4
-rw-r--r--tests/auto/other/xkbkeyboard/CMakeLists.txt2
-rw-r--r--tests/auto/other/xkbkeyboard/tst_xkbkeyboard.cpp60
-rw-r--r--tests/auto/other/xkbkeyboard/xkbkeyboard.pro7
19 files changed, 215 insertions, 35 deletions
diff --git a/tests/auto/other/gestures/BLACKLIST b/tests/auto/other/gestures/BLACKLIST
index 269bac5750..c465ff316e 100644
--- a/tests/auto/other/gestures/BLACKLIST
+++ b/tests/auto/other/gestures/BLACKLIST
@@ -1,5 +1,6 @@
[]
rhel-7.4
+rhel-7.6
ubuntu-18.04
[customGesture]
# QTBUG-67254
diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp
index 65a688ec40..8aa3a035e3 100644
--- a/tests/auto/other/lancelot/paintcommands.cpp
+++ b/tests/auto/other/lancelot/paintcommands.cpp
@@ -36,6 +36,7 @@
#include <qtextlayout.h>
#include <qdebug.h>
#include <QStaticText>
+#include <QTextDocument>
#include <private/qimage_p.h>
#ifndef QT_NO_OPENGL
@@ -441,6 +442,10 @@ void PaintCommands::staticInit()
"^drawStaticText\\s+(-?\\w*)\\s+(-?\\w*)\\s+\"(.*)\"$",
"drawStaticText <x> <y> <text>",
"drawStaticText 10 10 \"my text\"");
+ DECL_PAINTCOMMAND("drawTextDocument", command_drawTextDocument,
+ "^drawTextDocument\\s+(-?\\w*)\\s+(-?\\w*)\\s+\"(.*)\"$",
+ "drawTextDocument <x> <y> <html>",
+ "drawTextDocument 10 10 \"html\"");
DECL_PAINTCOMMAND("drawTiledPixmap", command_drawTiledPixmap,
"^drawTiledPixmap\\s+([\\w.:\\/]*)"
"\\s+(-?\\w*)\\s+(-?\\w*)\\s*(-?\\w*)\\s*(-?\\w*)"
@@ -1295,6 +1300,29 @@ void PaintCommands::command_drawStaticText(QRegularExpressionMatch re)
m_painter->drawStaticText(x, y, QStaticText(txt));
}
+void PaintCommands::command_drawTextDocument(QRegularExpressionMatch re)
+{
+ if (!m_shouldDrawText)
+ return;
+ QStringList caps = re.capturedTexts();
+ int x = convertToInt(caps.at(1));
+ int y = convertToInt(caps.at(2));
+ QString txt = caps.at(3);
+
+ if (m_verboseMode)
+ printf(" -(lance) drawTextDocument(%d, %d, %s)\n", x, y, qPrintable(txt));
+
+ QTextDocument doc;
+ doc.setBaseUrl(QUrl::fromLocalFile(QDir::currentPath() + QLatin1String("/")));
+ doc.setHtml(txt);
+
+ m_painter->save();
+ m_painter->translate(x, y);
+ doc.drawContents(m_painter);
+ m_painter->restore();
+}
+
+
/***************************************************************************************************/
void PaintCommands::command_noop(QRegularExpressionMatch)
{
diff --git a/tests/auto/other/lancelot/paintcommands.h b/tests/auto/other/lancelot/paintcommands.h
index 83e3bbc11c..79bdab634a 100644
--- a/tests/auto/other/lancelot/paintcommands.h
+++ b/tests/auto/other/lancelot/paintcommands.h
@@ -198,6 +198,7 @@ private:
void command_drawRoundRect(QRegularExpressionMatch re);
void command_drawText(QRegularExpressionMatch re);
void command_drawStaticText(QRegularExpressionMatch re);
+ void command_drawTextDocument(QRegularExpressionMatch re);
void command_drawTiledPixmap(QRegularExpressionMatch re);
void command_path_addEllipse(QRegularExpressionMatch re);
void command_path_addPolygon(QRegularExpressionMatch re);
diff --git a/tests/auto/other/lancelot/scripts/degeneratebeziers.qps b/tests/auto/other/lancelot/scripts/degeneratebeziers.qps
index fb223d5b1f..6c069fd82f 100644
--- a/tests/auto/other/lancelot/scripts/degeneratebeziers.qps
+++ b/tests/auto/other/lancelot/scripts/degeneratebeziers.qps
@@ -7,4 +7,30 @@ path_cubicTo degenerate 3427.0918499999997948 3872.1318999999994048 4729.4590867
scale 0.05 0.05
translate -2500 -3000
setPen black 800
-drawPath degenerate \ No newline at end of file
+drawPath degenerate
+
+resetMatrix
+path_moveTo revbez 0 20
+path_cubicTo revbez 0 0 120 0 120 -20
+
+path_moveTo revbez 0 80
+path_cubicTo revbez 0 100 120 100 120 120
+
+translate 50 250
+
+setPen blue 40 solidline flatcap
+drawPath revbez
+setPen red 0
+drawPath revbez
+
+translate 200 0
+setPen blue 40 solidline squarecap
+drawPath revbez
+setPen red 0
+drawPath revbez
+
+translate 200 0
+setPen blue 40 solidline roundcap
+drawPath revbez
+setPen red 0
+drawPath revbez
diff --git a/tests/auto/other/lancelot/scripts/richtext.qps b/tests/auto/other/lancelot/scripts/richtext.qps
new file mode 100644
index 0000000000..787c97421b
--- /dev/null
+++ b/tests/auto/other/lancelot/scripts/richtext.qps
@@ -0,0 +1,9 @@
+drawTextDocument 10 10 "<img height=50 width=50 align=top src=:/images/border.png /><img height=10 width=10 valign=bottom src=:/images/border.png /><span style='font-size: 100px'>Xy</span>"
+drawTextDocument 10 210 "<img height=50 width=50 align=top src=:/images/border.png /><img height=10 width=10 valign=bottom src=:/images/border.png /><span style='font-size: 25px'>Xy</span>"
+drawTextDocument 310 210 "<img height=10 width=10 align=top src=:/images/border.png /><img height=50 width=50 valign=bottom src=:/images/border.png /><span style='font-size: 25px'>Xy</span>"
+drawTextDocument 10 310 "<img height=50 width=50 align=top src=:/images/border.png /><img height=50 width=50 valign=bottom src=:/images/border.png /><span style='font-size: 25px'>Xy</span>"
+
+drawTextDocument 10 410 "<img height=10 width=10 align=top src=:/images/border.png /><img height=50 width=50 src=:/images/border.png /><span style='font-size: 25px'>Xy</span>"
+drawTextDocument 10 510 "<img height=10 width=10 valign=bottom src=:/images/border.png /><img height=50 width=50 src=:/images/border.png /><span style='font-size: 25px'>Xy</span>"
+drawTextDocument 310 410 "<img height=50 width=50 align=top src=:/images/border.png /><img height=10 width=10 src=:/images/border.png /><span style='font-size: 25px'>Xy</span>"
+drawTextDocument 310 510 "<img height=50 width=50 valign=bottom src=:/images/border.png /><img height=10 width=10 src=:/images/border.png /><span style='font-size: 25px'>Xy</span>"
diff --git a/tests/auto/other/macgui/macgui.pro b/tests/auto/other/macgui/macgui.pro
index 75e0d595cb..6ee22bdaec 100644
--- a/tests/auto/other/macgui/macgui.pro
+++ b/tests/auto/other/macgui/macgui.pro
@@ -9,3 +9,4 @@ QT = core-private widgets-private testlib
osx: LIBS += -framework ApplicationServices
requires(mac)
+requires(widgets)
diff --git a/tests/auto/other/macnativeevents/BLACKLIST b/tests/auto/other/macnativeevents/BLACKLIST
index 32e0b1d50b..2922e22d9f 100644
--- a/tests/auto/other/macnativeevents/BLACKLIST
+++ b/tests/auto/other/macnativeevents/BLACKLIST
@@ -32,7 +32,6 @@ osx
osx
# QTQAINFRA-1292
[testPushButtonPressRelease]
-osx-10.11 ci
osx-10.12 ci
# QTQAINFRA-1292
diff --git a/tests/auto/other/macplist/macplist.pro b/tests/auto/other/macplist/macplist.pro
index 5820793cbc..df7143031a 100644
--- a/tests/auto/other/macplist/macplist.pro
+++ b/tests/auto/other/macplist/macplist.pro
@@ -1,3 +1,5 @@
+requires(widgets)
+
TEMPLATE = subdirs
test.depends = app
diff --git a/tests/auto/other/other.pro b/tests/auto/other/other.pro
index 61a464356c..c5426202e8 100644
--- a/tests/auto/other/other.pro
+++ b/tests/auto/other/other.pro
@@ -30,6 +30,8 @@ SUBDIRS=\
gestures \
lancelot \
languagechange \
+ macgui \
+ macplist \
qaccessibility \
qfocusevent \
qnetworkaccessmanager_and_qprogressdialog \
@@ -48,13 +50,13 @@ cross_compile: SUBDIRS -= \
atwrapper \
compiler
-winrt|!qtConfig(accessibility): SUBDIRS -= qaccessibility
+winrt|!qtHaveModule(gui)|!qtConfig(accessibility): SUBDIRS -= qaccessibility
-!qtConfig(accessibility-atspi-bridge): SUBDIRS -= qaccessibilitylinux
+!qtHaveModule(gui)|!qtConfig(accessibility-atspi-bridge): SUBDIRS -= qaccessibilitylinux
!qtConfig(process): SUBDIRS -= qprocess_and_guieventloop
-!mac: SUBDIRS -= \
+!macos|!qtHaveModule(gui): SUBDIRS -= \
macgui \
macnativeevents \
macplist \
@@ -65,3 +67,8 @@ winrt|!qtConfig(accessibility): SUBDIRS -= qaccessibility
android: SUBDIRS += \
android
+
+qtConfig(xkbcommon): {
+ SUBDIRS += \
+ xkbkeyboard
+}
diff --git a/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp b/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp
index 2575f22309..48594b2fa1 100644
--- a/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp
+++ b/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp
@@ -211,6 +211,27 @@ void tst_QAccessibilityLinux::registerDbus()
mainWindow = getInterface(window, "org.a11y.atspi.Accessible");
}
+quint64 getAtspiState(QDBusInterface *interface)
+{
+ QDBusMessage msg = interface->call(QDBus::Block, "GetState");
+ const QDBusArgument arg = msg.arguments().at(0).value<QDBusArgument>();
+ quint32 state1 = 0;
+ quint64 state2 = 0;
+ arg.beginArray();
+ arg >> state1;
+ arg >> state2;
+ arg.endArray();
+
+ state2 = state2 << 32;
+ return state2 | state1;
+}
+
+bool hasState(QDBusInterface *interface, AtspiStateType state)
+{
+ quint64 intState = quint64(1) << state;
+ return getAtspiState(interface) & intState;
+}
+
#define ROOTPATH "/org/a11y/atspi/accessible"
void tst_QAccessibilityLinux::testLabel()
@@ -353,13 +374,21 @@ void tst_QAccessibilityLinux::testTreeWidget()
QDBusInterface *cell3 = getInterface(tableChildren.at(2), "org.a11y.atspi.Accessible");
QCOMPARE(cell3->property("Name").toString(), QLatin1String("0.0"));
+ QVERIFY(!hasState(cell3, ATSPI_STATE_EXPANDABLE));
+ QVERIFY(!hasState(cell3, ATSPI_STATE_EXPANDED));
QDBusInterface *cell4 = getInterface(tableChildren.at(3), "org.a11y.atspi.Accessible");
QCOMPARE(cell4->property("Name").toString(), QLatin1String("0.1"));
+ QDBusInterface *dbus_top2 = getInterface(tableChildren.at(4), "org.a11y.atspi.Accessible");
+ QCOMPARE(dbus_top2->property("Name").toString(), QLatin1String("1.0"));
+ QVERIFY(hasState(dbus_top2, ATSPI_STATE_EXPANDABLE));
+ QVERIFY(!hasState(dbus_top2, ATSPI_STATE_EXPANDED));
+
tree->expandItem(top2);
tableChildren = getChildren(treeIface);
QCOMPARE(tableChildren.size(), 8);
+ QVERIFY(hasState(dbus_top2, ATSPI_STATE_EXPANDED));
QDBusInterface *cell5 = getInterface(tableChildren.at(6), "org.a11y.atspi.Accessible");
QCOMPARE(cell5->property("Name").toString(), QLatin1String("1.0 0.0"));
@@ -471,23 +500,10 @@ void tst_QAccessibilityLinux::testSlider()
m_window->clearChildren();
}
-quint64 getAtspiState(QDBusInterface *interface)
-{
- QDBusMessage msg = interface->call(QDBus::Block, "GetState");
- const QDBusArgument arg = msg.arguments().at(0).value<QDBusArgument>();
- quint32 state1 = 0;
- quint64 state2 = 0;
- arg.beginArray();
- arg >> state1;
- arg >> state2;
- arg.endArray();
-
- state2 = state2 << 32;
- return state2 | state1;
-}
-
void tst_QAccessibilityLinux::testFocus()
{
+ m_window->activateWindow();
+ QVERIFY(QTest::qWaitForWindowActive(m_window));
QLineEdit *lineEdit1 = new QLineEdit(m_window);
lineEdit1->setText("lineEdit 1");
QLineEdit *lineEdit2 = new QLineEdit(m_window);
@@ -508,15 +524,14 @@ void tst_QAccessibilityLinux::testFocus()
QDBusInterface *componentInterfaceLineEdit2 = getInterface(children.at(1), "org.a11y.atspi.Component");
QVERIFY(componentInterfaceLineEdit2->isValid());
- quint64 focusedState = quint64(1) << ATSPI_STATE_FOCUSED;
- QVERIFY(getAtspiState(accessibleInterfaceLineEdit1) & focusedState);
- QVERIFY(!(getAtspiState(accessibleInterfaceLineEdit2) & focusedState));
+ QVERIFY(hasState(accessibleInterfaceLineEdit1, ATSPI_STATE_FOCUSED));
+ QVERIFY(!hasState(accessibleInterfaceLineEdit2, ATSPI_STATE_FOCUSED));
QDBusMessage focusReply = componentInterfaceLineEdit2->call(QDBus::Block, "GrabFocus");
QVERIFY(focusReply.arguments().at(0).toBool());
QVERIFY(lineEdit2->hasFocus());
- QVERIFY(!(getAtspiState(accessibleInterfaceLineEdit1) & focusedState));
- QVERIFY(getAtspiState(accessibleInterfaceLineEdit2) & focusedState);
+ QVERIFY(!hasState(accessibleInterfaceLineEdit1, ATSPI_STATE_FOCUSED));
+ QVERIFY(hasState(accessibleInterfaceLineEdit2, ATSPI_STATE_FOCUSED));
m_window->clearChildren();
delete accessibleInterfaceLineEdit1;
delete accessibleInterfaceLineEdit2;
diff --git a/tests/auto/other/qcomplextext/bidireorderstring.h b/tests/auto/other/qcomplextext/bidireorderstring.h
index a7401d2c18..b537bf45e4 100644
--- a/tests/auto/other/qcomplextext/bidireorderstring.h
+++ b/tests/auto/other/qcomplextext/bidireorderstring.h
@@ -78,7 +78,7 @@ const LV logical_visual[] = {
{ "data42", "foo\nfoo", "foo\nfoo", QChar::DirL },
{ "data43", "\327\251\327\234\327\225\327\235\n\327\251\327\234\327\225\327\235", "\327\235\327\225\327\234\327\251\n\327\235\327\225\327\234\327\251", QChar::DirR },
{ "data44", "foo\n\327\251\327\234\327\225\327\235", "foo\n\327\235\327\225\327\234\327\251", QChar::DirL },
- { "data45", "\327\251\327\234\327\225\327\235\nfoo", "\327\235\327\225\327\234\327\251\nfoo", QChar::DirR },
+ { "data45", "\327\251\327\234\327\225\327\235\nfoo", "foo\n\327\235\327\225\327\234\327\251", QChar::DirR },
{ "data46", "\330\250 1.23 \330\250", "\330\250 1.23 \330\250", QChar::DirR },
{ "data47", "\331\204\330\250 1.23 \331\202\330\250", "\330\250\331\202 1.23 \330\250\331\204", QChar::DirR },
{ "data48", "\330\250 1.2 \330\250", "\330\250 1.2 \330\250", QChar::DirR },
diff --git a/tests/auto/other/qcomplextext/tst_qcomplextext.cpp b/tests/auto/other/qcomplextext/tst_qcomplextext.cpp
index 0116e546a0..9ca61a69b4 100644
--- a/tests/auto/other/qcomplextext/tst_qcomplextext.cpp
+++ b/tests/auto/other/qcomplextext/tst_qcomplextext.cpp
@@ -66,8 +66,19 @@ void tst_QComplexText::bidiReorderString_data()
<< QString::fromUtf8( data->logical )
<< QString::fromUtf8( data->visual )
<< (int) data->basicDir;
+
+ QTest::newRow( QByteArray(data->name) + " (doubled)" )
+ << (QString::fromUtf8( data->logical ) + QChar(QChar::ParagraphSeparator) + QString::fromUtf8( data->logical ))
+ << (QString::fromUtf8( data->visual ) + QChar(QChar::ParagraphSeparator) + QString::fromUtf8( data->visual ))
+ << (int) data->basicDir;
data++;
}
+
+ QString isolateAndBoundary = QString(QChar(0x2068 /* DirFSI */)) + QChar(0x1c /* DirB */) + QChar(0x2069 /* DirPDI */);
+ QTest::newRow( "isolateAndBoundary" )
+ << QString::fromUtf8( data->logical )
+ << QString::fromUtf8( data->visual )
+ << (int) QChar::DirL;
}
void tst_QComplexText::bidiReorderString()
@@ -426,7 +437,7 @@ ushort unicodeForDirection(const QByteArray &direction)
{ "ET", 0x24 },
{ "AN", 0x660 },
{ "CS", 0x2c },
- { "B", QChar::ParagraphSeparator },
+ { "B", '\n' },
{ "S", 0x9 },
{ "WS", 0x20 },
{ "ON", 0x2a },
diff --git a/tests/auto/other/qobjectrace/qobjectrace.pro b/tests/auto/other/qobjectrace/qobjectrace.pro
index 94e7928585..6536810534 100644
--- a/tests/auto/other/qobjectrace/qobjectrace.pro
+++ b/tests/auto/other/qobjectrace/qobjectrace.pro
@@ -2,3 +2,6 @@ CONFIG += testcase
SOURCES += tst_qobjectrace.cpp
QT = core testlib
+INCLUDEPATH += ../../../shared/
+HEADERS += ../../../shared/emulationdetector.h
+
diff --git a/tests/auto/other/qobjectrace/tst_qobjectrace.cpp b/tests/auto/other/qobjectrace/tst_qobjectrace.cpp
index e6eb51500b..22782f6b09 100644
--- a/tests/auto/other/qobjectrace/tst_qobjectrace.cpp
+++ b/tests/auto/other/qobjectrace/tst_qobjectrace.cpp
@@ -30,6 +30,7 @@
#include <QtCore>
#include <QtTest/QtTest>
+#include "emulationdetector.h"
enum { OneMinute = 60 * 1000,
TwoMinutes = OneMinute * 2 };
@@ -256,6 +257,9 @@ public:
void tst_QObjectRace::destroyRace()
{
+ if (EmulationDetector::isRunningArmOnX86())
+ QSKIP("Test is too slow to run on emulator");
+
enum { ThreadCount = 10, ObjectCountPerThread = 2777,
ObjectCount = ThreadCount * ObjectCountPerThread };
@@ -374,6 +378,10 @@ public:
connect(timer, &QTimer::timeout, this, &DeleteReceiverRaceReceiver::onTimeout);
timer->start(1);
}
+ ~DeleteReceiverRaceReceiver()
+ {
+ delete receiver;
+ }
void onTimeout()
{
@@ -424,12 +432,12 @@ void tst_QObjectRace::disconnectRace()
for (int i = 0; i < ThreadCount; ++i) {
threads[i]->requestInterruption();
- QVERIFY(threads[i]->wait(300));
+ QVERIFY(threads[i]->wait());
delete threads[i];
}
senderThread->quit();
- QVERIFY(senderThread->wait(300));
+ QVERIFY(senderThread->wait());
}
QCOMPARE(countedStructObjectsCount.load(), 0u);
@@ -449,11 +457,11 @@ void tst_QObjectRace::disconnectRace()
QTest::qWait(TimeLimit);
senderThread->requestInterruption();
- QVERIFY(senderThread->wait(300));
+ QVERIFY(senderThread->wait());
for (int i = 0; i < ThreadCount; ++i) {
threads[i]->quit();
- QVERIFY(threads[i]->wait(300));
+ QVERIFY(threads[i]->wait());
delete threads[i];
}
}
diff --git a/tests/auto/other/qprocess_and_guieventloop/write-read-write/write-read-write.pro b/tests/auto/other/qprocess_and_guieventloop/write-read-write/write-read-write.pro
index e236e05c7d..6a23e52d95 100644
--- a/tests/auto/other/qprocess_and_guieventloop/write-read-write/write-read-write.pro
+++ b/tests/auto/other/qprocess_and_guieventloop/write-read-write/write-read-write.pro
@@ -1,4 +1,4 @@
SOURCES = main.cpp
-CONFIG -= qt app_bundle
-CONFIG += console
+CONFIG -= qt
+CONFIG += cmdline
DESTDIR = ./
diff --git a/tests/auto/other/toolsupport/tst_toolsupport.cpp b/tests/auto/other/toolsupport/tst_toolsupport.cpp
index f31a755f9e..8c129adaf3 100644
--- a/tests/auto/other/toolsupport/tst_toolsupport.cpp
+++ b/tests/auto/other/toolsupport/tst_toolsupport.cpp
@@ -126,9 +126,9 @@ void tst_toolsupport::offsets_data()
#ifdef Q_PROCESSOR_X86
// x86 32-bit has weird alignment rules. Refer to QtPrivate::AlignOf in
// qglobal.h for more details.
- data << 168 << 248;
+ data << 152 << 224;
#else
- data << 172 << 248;
+ data << 156 << 224;
#endif
}
#endif
diff --git a/tests/auto/other/xkbkeyboard/CMakeLists.txt b/tests/auto/other/xkbkeyboard/CMakeLists.txt
new file mode 100644
index 0000000000..610fa3006c
--- /dev/null
+++ b/tests/auto/other/xkbkeyboard/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_qt_test(alive SOURCES tst_alive.cpp
+ LIBRARIES Widgets)
diff --git a/tests/auto/other/xkbkeyboard/tst_xkbkeyboard.cpp b/tests/auto/other/xkbkeyboard/tst_xkbkeyboard.cpp
new file mode 100644
index 0000000000..65364eddf4
--- /dev/null
+++ b/tests/auto/other/xkbkeyboard/tst_xkbkeyboard.cpp
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore>
+#include <QtGui>
+#include <QtTest>
+
+#include <qpa/qplatforminputcontextfactory_p.h>
+#include <qpa/qplatforminputcontext.h>
+
+class tst_XkbKeyboard : public QObject
+{
+ Q_OBJECT
+private slots:
+ void verifyComposeInputContextInterface();
+};
+
+void tst_XkbKeyboard::verifyComposeInputContextInterface()
+{
+ QPlatformInputContext *inputContext = QPlatformInputContextFactory::create(QStringLiteral("compose"));
+ QVERIFY(inputContext);
+
+ const char *const inputContextClassName = "QComposeInputContext";
+ const char *const normalizedSignature = "setXkbContext(xkb_context*)";
+
+ QVERIFY(inputContext->objectName() == QLatin1String(inputContextClassName));
+
+ int methodIndex = inputContext->metaObject()->indexOfMethod(normalizedSignature);
+ QMetaMethod method = inputContext->metaObject()->method(methodIndex);
+ Q_ASSERT(method.isValid());
+}
+
+QTEST_MAIN(tst_XkbKeyboard)
+#include "tst_xkbkeyboard.moc"
+
diff --git a/tests/auto/other/xkbkeyboard/xkbkeyboard.pro b/tests/auto/other/xkbkeyboard/xkbkeyboard.pro
new file mode 100644
index 0000000000..17396ee475
--- /dev/null
+++ b/tests/auto/other/xkbkeyboard/xkbkeyboard.pro
@@ -0,0 +1,7 @@
+CONFIG += testcase
+TARGET = tst_xkbkeyboard
+
+SOURCES += tst_xkbkeyboard.cpp
+
+QT = core-private gui-private testlib
+