aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qml/debugger/qdebugmessageservice/BLACKLIST2
-rw-r--r--tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/BLACKLIST2
-rw-r--r--tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/BLACKLIST2
-rw-r--r--tests/auto/qml/debugger/qqmlenginecontrol/BLACKLIST2
-rw-r--r--tests/auto/qml/debugger/qqmlenginecontrol/qqmlenginecontrol.pro2
-rw-r--r--tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp5
-rw-r--r--tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/qqmlenginedebuginspectorintegrationtest.pro2
-rw-r--r--tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp20
-rw-r--r--tests/auto/qml/debugger/qqmlinspector/BLACKLIST2
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro2
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp15
-rw-r--r--tests/auto/quick/qquickimage/tst_qquickimage.cpp4
-rw-r--r--tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp46
-rw-r--r--tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp10
14 files changed, 110 insertions, 6 deletions
diff --git a/tests/auto/qml/debugger/qdebugmessageservice/BLACKLIST b/tests/auto/qml/debugger/qdebugmessageservice/BLACKLIST
new file mode 100644
index 0000000000..5fb1dc193b
--- /dev/null
+++ b/tests/auto/qml/debugger/qdebugmessageservice/BLACKLIST
@@ -0,0 +1,2 @@
+# QTQAINFRA-1334
+windows gcc
diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/BLACKLIST b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/BLACKLIST
new file mode 100644
index 0000000000..5fb1dc193b
--- /dev/null
+++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/BLACKLIST
@@ -0,0 +1,2 @@
+# QTQAINFRA-1334
+windows gcc
diff --git a/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/BLACKLIST b/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/BLACKLIST
new file mode 100644
index 0000000000..5fb1dc193b
--- /dev/null
+++ b/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/BLACKLIST
@@ -0,0 +1,2 @@
+# QTQAINFRA-1334
+windows gcc
diff --git a/tests/auto/qml/debugger/qqmlenginecontrol/BLACKLIST b/tests/auto/qml/debugger/qqmlenginecontrol/BLACKLIST
new file mode 100644
index 0000000000..5fb1dc193b
--- /dev/null
+++ b/tests/auto/qml/debugger/qqmlenginecontrol/BLACKLIST
@@ -0,0 +1,2 @@
+# QTQAINFRA-1334
+windows gcc
diff --git a/tests/auto/qml/debugger/qqmlenginecontrol/qqmlenginecontrol.pro b/tests/auto/qml/debugger/qqmlenginecontrol/qqmlenginecontrol.pro
index 2518650493..40ec1230d6 100644
--- a/tests/auto/qml/debugger/qqmlenginecontrol/qqmlenginecontrol.pro
+++ b/tests/auto/qml/debugger/qqmlenginecontrol/qqmlenginecontrol.pro
@@ -10,7 +10,7 @@ include(../shared/debugutil.pri)
TESTDATA = data/*
-QT += core qml testlib gui-private core-private
+QT += core qml testlib testlib-private gui-private core-private
OTHER_FILES += \
data/test.qml \
diff --git a/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp b/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp
index 3f8731ce6b..2c515d7cf5 100644
--- a/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp
+++ b/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp
@@ -35,6 +35,7 @@
#include <private/qqmlenginecontrolclient_p.h>
#include <QtTest/qtest.h>
+#include <private/qtestresult_p.h>
#include <QtCore/qlibraryinfo.h>
#define STR_PORT_FROM "13773"
@@ -154,6 +155,8 @@ void tst_QQmlEngineControl::startEngine()
QFETCH(bool, restrictMode);
connect("test.qml", restrictMode);
+ if (QTest::currentTestFailed() || QTestResult::skipCurrentTest())
+ return;
QTRY_VERIFY(!m_client->blockedEngines().empty());
m_client->releaseEngine(m_client->blockedEngines().last());
@@ -172,6 +175,8 @@ void tst_QQmlEngineControl::stopEngine()
QFETCH(bool, restrictMode);
connect("exit.qml", restrictMode);
+ if (QTest::currentTestFailed() || QTestResult::skipCurrentTest())
+ return;
QTRY_VERIFY(!m_client->blockedEngines().empty());
m_client->releaseEngine(m_client->blockedEngines().last());
diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/qqmlenginedebuginspectorintegrationtest.pro b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/qqmlenginedebuginspectorintegrationtest.pro
index e11ccdc6ca..b8b4c3fc8b 100644
--- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/qqmlenginedebuginspectorintegrationtest.pro
+++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/qqmlenginedebuginspectorintegrationtest.pro
@@ -1,7 +1,7 @@
CONFIG += testcase
TARGET = tst_qqmlenginedebuginspectorintegration
-QT += qml testlib gui-private core-private
+QT += qml testlib testlib-private gui-private core-private
osx:CONFIG -= app_bundle
SOURCES += tst_qqmlenginedebuginspectorintegration.cpp
diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp
index 940f89e936..738da048a3 100644
--- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp
+++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp
@@ -34,6 +34,7 @@
#include <private/qqmldebugconnection_p.h>
#include <QtTest/qtest.h>
+#include <private/qtestresult_p.h>
#include <QtTest/qsignalspy.h>
#include <QtNetwork/qhostaddress.h>
#include <QtCore/qtimer.h>
@@ -101,6 +102,10 @@ QmlDebugObjectReference tst_QQmlEngineDebugInspectorIntegration::findRootObject(
void tst_QQmlEngineDebugInspectorIntegration::init(bool restrictServices)
{
+#if defined(Q_OS_WIN) && defined(Q_CC_MINGW)
+ QSKIP("Capturing output while running nested event loop is not reliable on Windows/GCC");
+#endif
+
const QString argument = QString::fromLatin1("-qmljsdebugger=port:%1,%2,block%3")
.arg(STR_PORT_FROM).arg(STR_PORT_TO)
.arg(restrictServices ? QStringLiteral(",services:QmlDebugger,QmlInspector") :
@@ -164,6 +169,8 @@ void tst_QQmlEngineDebugInspectorIntegration::connect()
void tst_QQmlEngineDebugInspectorIntegration::objectLocationLookup()
{
init(true);
+ if (QTest::currentTestFailed() || QTestResult::skipCurrentTest())
+ return;
bool success = false;
QmlDebugObjectReference rootObject = findRootObject();
@@ -190,6 +197,9 @@ void tst_QQmlEngineDebugInspectorIntegration::objectLocationLookup()
void tst_QQmlEngineDebugInspectorIntegration::select()
{
init(true);
+ if (QTest::currentTestFailed() || QTestResult::skipCurrentTest())
+ return;
+
QmlDebugObjectReference rootObject = findRootObject();
QList<int> childIds;
int requestId = 0;
@@ -207,6 +217,8 @@ void tst_QQmlEngineDebugInspectorIntegration::select()
void tst_QQmlEngineDebugInspectorIntegration::createObject()
{
init(true);
+ if (QTest::currentTestFailed() || QTestResult::skipCurrentTest())
+ return;
QString qml = QLatin1String("Rectangle {\n"
" id: xxxyxxx\n"
@@ -234,6 +246,10 @@ void tst_QQmlEngineDebugInspectorIntegration::createObject()
void tst_QQmlEngineDebugInspectorIntegration::moveObject()
{
init(true);
+ if (QTest::currentTestFailed() || QTestResult::skipCurrentTest())
+ return;
+
+ QCOMPARE(m_inspectorClient->state(), QQmlDebugClient::Enabled);
QmlDebugObjectReference rootObject = findRootObject();
QVERIFY(rootObject.debugId != -1);
QCOMPARE(rootObject.children.length(), 2);
@@ -257,6 +273,10 @@ void tst_QQmlEngineDebugInspectorIntegration::moveObject()
void tst_QQmlEngineDebugInspectorIntegration::destroyObject()
{
init(true);
+ if (QTest::currentTestFailed() || QTestResult::skipCurrentTest())
+ return;
+
+ QCOMPARE(m_inspectorClient->state(), QQmlDebugClient::Enabled);
QmlDebugObjectReference rootObject = findRootObject();
QVERIFY(rootObject.debugId != -1);
QCOMPARE(rootObject.children.length(), 2);
diff --git a/tests/auto/qml/debugger/qqmlinspector/BLACKLIST b/tests/auto/qml/debugger/qqmlinspector/BLACKLIST
new file mode 100644
index 0000000000..5fb1dc193b
--- /dev/null
+++ b/tests/auto/qml/debugger/qqmlinspector/BLACKLIST
@@ -0,0 +1,2 @@
+# QTQAINFRA-1334
+windows gcc
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro b/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro
index 71a58d6f34..f5e3dbdc2f 100644
--- a/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro
@@ -10,7 +10,7 @@ include(../shared/debugutil.pri)
TESTDATA = data/*
-QT += core qml testlib gui-private core-private
+QT += core qml testlib testlib-private gui-private core-private
OTHER_FILES += \
data/pixmapCacheTest.qml \
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
index 692e70d7da..b8e1f1f21d 100644
--- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
@@ -33,6 +33,7 @@
#include <private/qqmldebugconnection_p.h>
#include <QtTest/qtest.h>
+#include <private/qtestresult_p.h>
#include <QtCore/qlibraryinfo.h>
#define STR_PORT_FROM "13773"
@@ -562,6 +563,8 @@ void tst_QQmlProfilerService::connect()
void tst_QQmlProfilerService::pixmapCacheData()
{
connect(true, "pixmapCacheTest.qml");
+ if (QTest::currentTestFailed() || QTestResult::skipCurrentTest())
+ return;
m_client->sendRecordingStatus(true);
QVERIFY(QQmlDebugTest::waitForSignal(m_process, SIGNAL(readyReadStandardOutput())));
@@ -599,6 +602,8 @@ void tst_QQmlProfilerService::pixmapCacheData()
void tst_QQmlProfilerService::scenegraphData()
{
connect(true, "scenegraphTest.qml");
+ if (QTest::currentTestFailed() || QTestResult::skipCurrentTest())
+ return;
m_client->sendRecordingStatus(true);
@@ -656,6 +661,8 @@ void tst_QQmlProfilerService::scenegraphData()
void tst_QQmlProfilerService::profileOnExit()
{
connect(true, "exit.qml");
+ if (QTest::currentTestFailed() || QTestResult::skipCurrentTest())
+ return;
m_client->sendRecordingStatus(true);
@@ -666,6 +673,8 @@ void tst_QQmlProfilerService::profileOnExit()
void tst_QQmlProfilerService::controlFromJS()
{
connect(true, "controlFromJS.qml");
+ if (QTest::currentTestFailed() || QTestResult::skipCurrentTest())
+ return;
m_client->sendRecordingStatus(false);
checkTraceReceived();
@@ -675,6 +684,8 @@ void tst_QQmlProfilerService::controlFromJS()
void tst_QQmlProfilerService::signalSourceLocation()
{
connect(true, "signalSourceLocation.qml");
+ if (QTest::currentTestFailed() || QTestResult::skipCurrentTest())
+ return;
m_client->sendRecordingStatus(true);
while (!(m_process->output().contains(QLatin1String("500"))))
@@ -698,6 +709,8 @@ void tst_QQmlProfilerService::signalSourceLocation()
void tst_QQmlProfilerService::javascript()
{
connect(true, "javascript.qml");
+ if (QTest::currentTestFailed() || QTestResult::skipCurrentTest())
+ return;
m_client->sendRecordingStatus(true);
while (!(m_process->output().contains(QLatin1String("done"))))
@@ -728,6 +741,8 @@ void tst_QQmlProfilerService::javascript()
void tst_QQmlProfilerService::flushInterval()
{
connect(true, "timer.qml");
+ if (QTest::currentTestFailed() || QTestResult::skipCurrentTest())
+ return;
m_client->sendRecordingStatus(true, -1, 1);
diff --git a/tests/auto/quick/qquickimage/tst_qquickimage.cpp b/tests/auto/quick/qquickimage/tst_qquickimage.cpp
index 36d99ad48d..a2a65aa803 100644
--- a/tests/auto/quick/qquickimage/tst_qquickimage.cpp
+++ b/tests/auto/quick/qquickimage/tst_qquickimage.cpp
@@ -400,11 +400,11 @@ void tst_qquickimage::svg()
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QQuickImage *obj = qobject_cast<QQuickImage*>(component.create());
QVERIFY(obj != 0);
- QCOMPARE(obj->width(), 212.0);
+ QCOMPARE(int(obj->width()), 212); // round down: highdpi can give back fractional values
QCOMPARE(obj->height(), 300.0);
obj->setSourceSize(QSize(200,200));
- QCOMPARE(obj->width(), 141.0);
+ QCOMPARE(int(obj->width()), 141); // round down: highdpi can give back fractional values
QCOMPARE(obj->height(), 200.0);
delete obj;
}
diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
index 67921e1fd0..2e20275193 100644
--- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
+++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
@@ -215,6 +215,7 @@ private slots:
void clearInputMask();
void keypress_inputMask_data();
void keypress_inputMask();
+ void keypress_inputMethod_inputMask();
void hasAcceptableInputMask_data();
void hasAcceptableInputMask();
void maskCharacter_data();
@@ -2291,8 +2292,9 @@ void tst_qquicktextinput::inputMethods()
QGuiApplication::sendEvent(input, &event);
QCOMPARE(input->text(), QString("Our Goodbye world!"));
QCOMPARE(input->displayText(), QString("Our Goodbye world!"));
- QCOMPARE(input->cursorPosition(), 7);
+ QCOMPARE(input->cursorPosition(), 3);
+ input->setCursorPosition(7);
QInputMethodEvent preeditEvent("PREEDIT", QList<QInputMethodEvent::Attribute>());
QGuiApplication::sendEvent(input, &preeditEvent);
QCOMPARE(input->text(), QString("Our Goodbye world!"));
@@ -6481,6 +6483,48 @@ void tst_qquicktextinput::keypress_inputMask()
QCOMPARE(textInput->displayText(), expectedDisplayText);
}
+void tst_qquicktextinput::keypress_inputMethod_inputMask()
+{
+ // Similar to the keypress_inputMask test, but this is done solely via
+ // input methods
+ QString componentStr = "import QtQuick 2.0\nTextInput { focus: true; inputMask: \"AA.AA.AA\" }";
+ QQmlComponent textInputComponent(&engine);
+ textInputComponent.setData(componentStr.toLatin1(), QUrl());
+ QQuickTextInput *textInput = qobject_cast<QQuickTextInput*>(textInputComponent.create());
+ QVERIFY(textInput != 0);
+
+ QQuickWindow window;
+ textInput->setParentItem(window.contentItem());
+ window.show();
+ window.requestActivate();
+ QTest::qWaitForWindowActive(&window);
+ QVERIFY(textInput->hasActiveFocus());
+
+ {
+ QList<QInputMethodEvent::Attribute> attributes;
+ QInputMethodEvent event("", attributes);
+ event.setCommitString("EE");
+ QGuiApplication::sendEvent(textInput, &event);
+ }
+ QCOMPARE(textInput->cursorPosition(), 3);
+ QCOMPARE(textInput->text(), QStringLiteral("EE.."));
+ {
+ QList<QInputMethodEvent::Attribute> attributes;
+ QInputMethodEvent event("", attributes);
+ event.setCommitString("EE");
+ QGuiApplication::sendEvent(textInput, &event);
+ }
+ QCOMPARE(textInput->cursorPosition(), 6);
+ QCOMPARE(textInput->text(), QStringLiteral("EE.EE."));
+ {
+ QList<QInputMethodEvent::Attribute> attributes;
+ QInputMethodEvent event("", attributes);
+ event.setCommitString("EE");
+ QGuiApplication::sendEvent(textInput, &event);
+ }
+ QCOMPARE(textInput->cursorPosition(), 8);
+ QCOMPARE(textInput->text(), QStringLiteral("EE.EE.EE"));
+}
void tst_qquicktextinput::hasAcceptableInputMask_data()
{
diff --git a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
index 60495596d1..ee49c9c7ad 100644
--- a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
+++ b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
@@ -55,6 +55,7 @@ private slots:
void engine();
void readback();
void renderingSignals();
+ void grab();
void grabBeforeShow();
void reparentToNewWindow();
void nullEngine();
@@ -298,6 +299,15 @@ void tst_qquickwidget::renderingSignals()
QTRY_VERIFY(afterRenderingSpy.size() > 0);
}
+void tst_qquickwidget::grab()
+{
+ QQuickWidget view;
+ view.setSource(testFileUrl("rectangle.qml"));
+ QPixmap pixmap = view.grab();
+ QRgb pixel = pixmap.toImage().pixel(5, 5);
+ QCOMPARE(pixel, qRgb(255, 0, 0));
+}
+
// QTBUG-49929, verify that Qt Designer grabbing the contents before drag
// does not crash due to missing GL contexts or similar.
void tst_qquickwidget::grabBeforeShow()