From 1eeab2d27f61485cb53364d40339a8d832a076e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Mon, 24 Jun 2019 18:55:36 +0200 Subject: QSocks5SocketEngine: account for in-transit signal when waiting for read When calling waitFor{ReadyRead,Disconnected} it will wait for data but if the data is already received and the read notification has been queued (and there's no more data coming in) it will return false. By checking if a read notification has been queued and then handling this we can easily take care of this scenario. Fixes some flaky tests which missed the read data in waitForDisconnect and similar. Fixes: QTBUG-38385 Change-Id: Ic05d59883c1175783e56ff1822b6636c35aec874 Reviewed-by: Volker Hilsheimer --- tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp index c473230246..2d64714f92 100644 --- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp @@ -328,8 +328,8 @@ void tst_QTcpSocket::initTestCase_data() qDebug() << QtNetworkSettings::serverName(); QTest::newRow("WithoutProxy") << false << 0 << false; - //QTest::newRow("WithSocks5Proxy") << true << int(Socks5Proxy) << false; ### temporarily disabled, QTBUG-38385 - //QTest::newRow("WithSocks5ProxyAuth") << true << int(Socks5Proxy | AuthBasic) << false; ### temporarily disabled, QTBUG-38385 + QTest::newRow("WithSocks5Proxy") << true << int(Socks5Proxy) << false; + QTest::newRow("WithSocks5ProxyAuth") << true << int(Socks5Proxy | AuthBasic) << false; QTest::newRow("WithHttpProxy") << true << int(HttpProxy) << false; QTest::newRow("WithHttpProxyBasicAuth") << true << int(HttpProxy | AuthBasic) << false; @@ -337,8 +337,8 @@ void tst_QTcpSocket::initTestCase_data() #ifndef QT_NO_SSL QTest::newRow("WithoutProxy SSL") << false << 0 << true; - //QTest::newRow("WithSocks5Proxy SSL") << true << int(Socks5Proxy) << true; ### temporarily disabled, QTBUG-38385 - //QTest::newRow("WithSocks5AuthProxy SSL") << true << int(Socks5Proxy | AuthBasic) << true; ### temporarily disabled, QTBUG-38385 + QTest::newRow("WithSocks5Proxy SSL") << true << int(Socks5Proxy) << true; + QTest::newRow("WithSocks5AuthProxy SSL") << true << int(Socks5Proxy | AuthBasic) << true; QTest::newRow("WithHttpProxy SSL") << true << int(HttpProxy) << true; QTest::newRow("WithHttpProxyBasicAuth SSL") << true << int(HttpProxy | AuthBasic) << true; -- cgit v1.2.3 From 555661b625c40f21a6a3e4c73e928a6e8a46db20 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Fri, 21 Jun 2019 16:31:04 +0200 Subject: Update visible window's alpha when toggling WA_TranslucentBackground MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QWidgetPrivate::updateIsTranslucent sets the surface format of the window with the alpha based on the translucency attribute, so we need to call this function when the attribute value changes. The test can confirm that the window's requested surface format has changed, we can't rely on what is actually set, and don't have to rely on hard-coded values like 8bit alpha. While WA_NoSystemBackground needs to be set for WA_TranslucentBackground to have an effect, we can't clear the attribute when clearing translucency (as it might have been set explicitly). Change-Id: I238d6930b7e0488397467a4e035b5f530566a1ff Fixes: QTBUG-60822 Reviewed-by: Friedemann Kleint Reviewed-by: Tor Arne Vestbø --- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 489edb703c..7edca2017d 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -8855,6 +8855,12 @@ void tst_QWidget::translucentWidget() QEXPECT_FAIL("", "WinRT: This fails. QTBUG-68297.", Abort); QCOMPARE(actual.size(),expected.size()); QCOMPARE(actual,expected); + + const QWindow *window = label.windowHandle(); + const QSurfaceFormat translucentFormat = window->requestedFormat(); + label.setAttribute(Qt::WA_TranslucentBackground, false); + const QSurfaceFormat opaqueFormat = window->requestedFormat(); + QVERIFY(translucentFormat != opaqueFormat); } class MaskResizeTestWidget : public QWidget -- cgit v1.2.3 From 24b9424adcda1ab083fae4ae857007227ba5fee2 Mon Sep 17 00:00:00 2001 From: Dimitrios Apostolou Date: Tue, 2 Jul 2019 14:24:25 +0200 Subject: Skip flaky test on MacOS_10_12 This is the most flaky-pass test currently. It fails the first time it is run on MacOS_10_12, but succeeds all the following times. This happens extremely often, so disable it until the issue is resolved. Task-number: QTBUG-76566 Change-Id: I94359eceb91c3b958930424e6c8b5957fb3f1252 Reviewed-by: Volker Hilsheimer --- tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp index 9a75774927..ae0d91dfe3 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp @@ -5049,6 +5049,12 @@ public: void tst_QGraphicsItem::paint() { +#if defined(Q_OS_MACOS) + if (QSysInfo::productVersion() == QLatin1String("10.12")) { + QSKIP("Test is very flaky on MacOS_10_12, see QTBUG-76566"); + } +#endif + QGraphicsScene scene; PaintTester paintTester; -- cgit v1.2.3 From 2021b36ebdbdd1da1595f281a694b54beb1b23a3 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 2 Jul 2019 20:48:40 -0300 Subject: QPluginLoader: fix failing test comparing the Qt version We stopped storing the patch release number of Qt in the plugin metadata in commit 7bd79b3cffbbbece23867c5e111a3dd2ebcad016 (5.13), to make it simpler to parse the validity of plugins before decoding the CBOR payload. Fixes: QTBUG-76855 Change-Id: I6aed4df6a12e43c3ac8efffd15adbbf83e928866 Reviewed-by: Liang Qi --- tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp index 4316ea14ea..85763b0388 100644 --- a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp +++ b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp @@ -549,7 +549,8 @@ void tst_QPluginLoader::staticPlugins() } QVERIFY(found); - QCOMPARE(metaData.value("version").toInt(), QT_VERSION); + // We don't store the patch release version anymore (since 5.13) + QCOMPARE(metaData.value("version").toInt() / 0x100, QT_VERSION / 0x100); QCOMPARE(metaData.value("IID").toString(), "SomeIID"); QCOMPARE(metaData.value("ExtraMetaData"), QJsonArray({ "StaticPlugin", "foo" })); } -- cgit v1.2.3 From 6ff0614b61b8645ec7ca4ea40501a0b6719a92fd Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 20 Jun 2019 13:07:04 +0200 Subject: Handle multiple font-families in face attribute This seems to be a common use case, and to be expected from pastes of MSWord documents. Change-Id: I5849d7f51408e76f15a0b03c2118649f118af1d6 Fixes: QTBUG-66794 Reviewed-by: Friedemann Kleint Reviewed-by: Lars Knoll --- .../gui/text/qtextdocument/tst_qtextdocument.cpp | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tests') diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp index e4ee778f64..591fafc7fb 100644 --- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp @@ -188,6 +188,9 @@ private slots: void lineHeightType(); void cssLineHeightMultiplier(); + + void fontTagFace(); + private: void backgroundImage_checkExpectedHtml(const QTextDocument &doc); void buildRegExpData(); @@ -3498,5 +3501,26 @@ void tst_QTextDocument::cssLineHeightMultiplier() } } +void tst_QTextDocument::fontTagFace() +{ + { + QTextDocument td; + td.setHtml("Foobar"); + QTextFragment fragment = td.begin().begin().fragment(); + QTextCharFormat format = fragment.charFormat(); + QCOMPARE(format.fontFamily(), QLatin1String("Times")); + } + + { + QTextDocument td; + td.setHtml("Foobar"); + QTextFragment fragment = td.begin().begin().fragment(); + QTextCharFormat format = fragment.charFormat(); + QCOMPARE(format.fontFamily(), QLatin1String("Times")); + QStringList expectedFamilies = { QLatin1String("Times"), QLatin1String("serif") }; + QCOMPARE(format.fontFamilies().toStringList(), expectedFamilies); + } +} + QTEST_MAIN(tst_QTextDocument) #include "tst_qtextdocument.moc" -- cgit v1.2.3