summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-04-16 12:04:34 +0200
committerLars Knoll <lars.knoll@nokia.com>2012-04-16 12:04:34 +0200
commit9bd032355163d92cda5e7e59ecd21214b131f187 (patch)
tree002fa12558505683143c7eb08949a3d225bf0712 /tests/auto/widgets
parentd037d25c3d5236623371cf051aaf6a9e59792ba7 (diff)
parent41673c45dde2eb95ee21dd918235218399f2be2c (diff)
Merge remote-tracking branch 'origin/master' into api_changes
Conflicts: configure src/corelib/io/qurl.cpp src/gui/kernel/qwindow.cpp src/tools/moc/generator.cpp src/widgets/kernel/qwidget_qpa.cpp src/widgets/styles/qstyle.h src/widgets/widgets/qtabbar.cpp tests/auto/corelib/codecs/utf8/tst_utf8.cpp Change-Id: Ia457228d6f684ec8184e13e8fcc9d25857b1751e
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsgridlayout/qgraphicsgridlayout.pro2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro3
-rw-r--r--tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp4
-rw-r--r--tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro3
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/qtreeview.pro3
-rw-r--r--tests/auto/widgets/widgets/qcombobox/qcombobox.pro3
-rw-r--r--tests/auto/widgets/widgets/qdoublespinbox/qdoublespinbox.pro3
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp25
-rw-r--r--tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp7
-rw-r--r--tests/auto/widgets/widgets/qmenubar/qmenubar.pro3
-rw-r--r--tests/auto/widgets/widgets/qscrollbar/qscrollbar.pro2
-rw-r--r--tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp6
-rw-r--r--tests/auto/widgets/widgets/qtextedit/qtextedit.pro15
-rw-r--r--tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp35
15 files changed, 65 insertions, 51 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/qgraphicsgridlayout.pro b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/qgraphicsgridlayout.pro
index b32c638948..5796cbfd73 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/qgraphicsgridlayout.pro
+++ b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/qgraphicsgridlayout.pro
@@ -4,5 +4,3 @@ TARGET = tst_qgraphicsgridlayout
QT += widgets testlib
SOURCES += tst_qgraphicsgridlayout.cpp
CONFIG += parallel_test
-# ### fixme: QTBUG-20756 crashes on xcb
-contains(QT_CONFIG,xcb):CONFIG+=insignificant_test
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro b/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro
index 2f479151dc..59ad89ed1f 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro
@@ -7,6 +7,6 @@ QT += core-private gui-private
SOURCES += tst_qgraphicsview.cpp tst_qgraphicsview_2.cpp
DEFINES += QT_NO_CAST_TO_ASCII
-linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test
+linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test # QTBUG-16063
win32|mac:CONFIG += insignificant_test # QTBUG-24296
diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro b/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro
index ca796647c1..2fc45b48de 100644
--- a/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro
+++ b/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro
@@ -6,5 +6,4 @@ QT += core-private gui-private
SOURCES += tst_qgraphicswidget.cpp
-# QTBUG-23616 - unstable test
-linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test
+linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test # QTBUG-23616
diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
index 1158a9f06b..1518403a64 100644
--- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
@@ -1947,8 +1947,8 @@ void tst_QHeaderView::noSectionsWithNegativeSize()
void tst_QHeaderView::emptySectionSpan()
{
- QHeaderViewPrivate::SectionSpan span;
- QCOMPARE(span.sectionSize(), 0);
+ QHeaderViewPrivate::SectionItem section;
+ QCOMPARE(section.sectionSize(), 0);
}
void tst_QHeaderView::task236450_hidden_data()
diff --git a/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro b/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro
index d47b3bfa31..d1a7686637 100644
--- a/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro
+++ b/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro
@@ -5,5 +5,4 @@ SOURCES += tst_qitemdelegate.cpp
win32:!wince*: LIBS += -lUser32
-# QTBUG-23637
-linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test
+linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test # QTBUG-23637
diff --git a/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro b/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro
index 95d1ba1c2f..8102b6b95d 100644
--- a/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro
+++ b/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro
@@ -4,5 +4,4 @@ QT += widgets testlib
QT += widgets-private gui-private core-private
SOURCES += tst_qtreeview.cpp
-# QTBUG-23638
-linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test
+linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test # QTBUG-23638
diff --git a/tests/auto/widgets/widgets/qcombobox/qcombobox.pro b/tests/auto/widgets/widgets/qcombobox/qcombobox.pro
index 03bb91f4c0..e0545630c5 100644
--- a/tests/auto/widgets/widgets/qcombobox/qcombobox.pro
+++ b/tests/auto/widgets/widgets/qcombobox/qcombobox.pro
@@ -3,5 +3,4 @@ TARGET = tst_qcombobox
QT += widgets widgets-private gui-private core-private testlib
SOURCES += tst_qcombobox.cpp
-# QTBUG-23639 - unstable test (related QTBUG-1071)
-linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test
+linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test # QTBUG-23639, (related QTBUG-1071)
diff --git a/tests/auto/widgets/widgets/qdoublespinbox/qdoublespinbox.pro b/tests/auto/widgets/widgets/qdoublespinbox/qdoublespinbox.pro
index 4dd0890fc0..183210b597 100644
--- a/tests/auto/widgets/widgets/qdoublespinbox/qdoublespinbox.pro
+++ b/tests/auto/widgets/widgets/qdoublespinbox/qdoublespinbox.pro
@@ -3,5 +3,4 @@ TARGET = tst_qdoublespinbox
QT += widgets testlib
SOURCES += tst_qdoublespinbox.cpp
-# QTBUG-23641 - unstable test
-linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test
+linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test # QTBUG-23641
diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
index 06bf929e4b..22e05a8871 100644
--- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
@@ -271,6 +271,7 @@ private slots:
void taskQTBUG_7395_readOnlyShortcut();
void QTBUG697_paletteCurrentColorGroup();
void QTBUG13520_textNotVisible();
+ void QTBUG7174_inputMaskCursorBlink();
void bidiVisualMovement_data();
void bidiVisualMovement();
@@ -3693,6 +3694,30 @@ void tst_QLineEdit::QTBUG13520_textNotVisible()
}
+class UpdateRegionLineEdit : public QLineEdit
+{
+public:
+ QRegion updateRegion;
+protected:
+ void paintEvent(QPaintEvent *event)
+ {
+ updateRegion = event->region();
+ }
+};
+
+void tst_QLineEdit::QTBUG7174_inputMaskCursorBlink()
+{
+ UpdateRegionLineEdit edit;
+ edit.setInputMask(QLatin1String("AAAA"));
+ edit.setFocus();
+ edit.setText(QLatin1String("AAAA"));
+ edit.show();
+ QRect cursorRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect();
+ QTest::qWaitForWindowShown(&edit);
+ edit.updateRegion = QRegion();
+ QTest::qWait(QApplication::cursorFlashTime());
+ QVERIFY(edit.updateRegion.contains(cursorRect));
+}
void tst_QLineEdit::bidiVisualMovement_data()
{
diff --git a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
index 70823d92f0..bc5100f118 100644
--- a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
+++ b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
@@ -98,10 +98,9 @@ static inline void triggerSignal(QMdiSubWindow *window, QMdiArea *workspace,
window->showMaximized();
qApp->processEvents();
window->showNormal();
- qApp->processEvents();
- QVERIFY(!window->isMinimized());
- QVERIFY(!window->isMaximized());
- QVERIFY(!window->isShaded());
+ QTRY_VERIFY(!window->isMinimized());
+ QTRY_VERIFY(!window->isMaximized());
+ QTRY_VERIFY(!window->isShaded());
} else if (signal == SIGNAL(aboutToActivate())) {
if (window->parent()) {
workspace->setActiveSubWindow(window);
diff --git a/tests/auto/widgets/widgets/qmenubar/qmenubar.pro b/tests/auto/widgets/widgets/qmenubar/qmenubar.pro
index 6bacaa0d37..c74c9e84c1 100644
--- a/tests/auto/widgets/widgets/qmenubar/qmenubar.pro
+++ b/tests/auto/widgets/widgets/qmenubar/qmenubar.pro
@@ -3,5 +3,4 @@ TARGET = tst_qmenubar
QT += widgets testlib
SOURCES += tst_qmenubar.cpp
-# QTBUG-4965, QTBUG-11823 - unstable tests
-linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test
+linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test # QTBUG-4965, QTBUG-11823
diff --git a/tests/auto/widgets/widgets/qscrollbar/qscrollbar.pro b/tests/auto/widgets/widgets/qscrollbar/qscrollbar.pro
index e9436eccdc..2863dd2034 100644
--- a/tests/auto/widgets/widgets/qscrollbar/qscrollbar.pro
+++ b/tests/auto/widgets/widgets/qscrollbar/qscrollbar.pro
@@ -2,5 +2,3 @@ CONFIG += testcase
TARGET = tst_qscrollbar
QT += widgets testlib
SOURCES += tst_qscrollbar.cpp
-
-mac*:CONFIG+=insignificant_test
diff --git a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
index 688daf1f8a..f568322ab7 100644
--- a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
+++ b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
@@ -99,6 +99,9 @@ void tst_QScrollBar::scrollSingleStep()
QTest::mouseClick(testWidget, Qt::LeftButton, Qt::NoModifier, QPoint(sr.x(), sr.y()));
QTest::qWait(510); // initial delay is 500 for setRepeatAction
disconnect(testWidget, SIGNAL(actionTriggered(int)), 0, 0);
+#ifdef Q_OS_MAC
+ QEXPECT_FAIL("", "This test fails on Mac OS X, see QTBUG-25272", Abort);
+#endif
QCOMPARE(testWidget->value(), testWidget->singleStep());
}
@@ -136,9 +139,6 @@ void tst_QScrollBar::task_209492()
QApplication::sendEvent(verticalScrollBar, &mouseReleaseEvent);
// Check that the action was triggered once.
-#ifdef Q_OS_MAC
- QEXPECT_FAIL("", "Fix does does not work on Mac due to paint architechure differences.", Abort);
-#endif
QCOMPARE(scrollArea.scrollCount, 1);
QCOMPARE(spy.count(), 1);
}
diff --git a/tests/auto/widgets/widgets/qtextedit/qtextedit.pro b/tests/auto/widgets/widgets/qtextedit/qtextedit.pro
index 1c2821b289..6e0fff17d5 100644
--- a/tests/auto/widgets/widgets/qtextedit/qtextedit.pro
+++ b/tests/auto/widgets/widgets/qtextedit/qtextedit.pro
@@ -2,18 +2,5 @@ CONFIG += testcase
TARGET = tst_qtextedit
QT += widgets widgets-private gui-private core-private testlib
-INCLUDEPATH += ../
-HEADERS +=
-SOURCES += tst_qtextedit.cpp
-
-wince* {
- addImages.files = fullWidthSelection/*
- addImages.path = fullWidthSelection
- DEPLOYMENT += addImages
- DEFINES += SRCDIR=\\\"./\\\"
-} else {
- DEFINES += SRCDIR=\\\"$$PWD/\\\"
-}
-
-contains(QT_CONFIG,xcb):CONFIG+=insignificant_test # QTBUG-20756 crashes on xcb
+SOURCES += tst_qtextedit.cpp
diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
index 9c5a3dbed7..a3f58c4c0d 100644
--- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
+++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
@@ -58,6 +58,7 @@
#include <qimagewriter.h>
#include <qcommonstyle.h>
#include <qlayout.h>
+#include <qdir.h>
#include <qabstracttextdocumentlayout.h>
#include <qtextdocumentfragment.h>
@@ -218,6 +219,7 @@ private:
QTextEdit *ed;
qreal rootFrameMargin;
PlatformInputContext m_platformInputContext;
+ const QString m_fullWidthSelectionImagesFolder;
};
bool tst_QTextEdit::nativeClipboardWorking()
@@ -376,13 +378,17 @@ public:
int &iterationCounter;
};
-tst_QTextEdit::tst_QTextEdit()
-{}
+tst_QTextEdit::tst_QTextEdit() :
+ m_fullWidthSelectionImagesFolder(QFINDTESTDATA("fullWidthSelection"))
+{
+
+}
void tst_QTextEdit::initTestCase()
{
QInputMethodPrivate *inputMethodPrivate = QInputMethodPrivate::get(qApp->inputMethod());
inputMethodPrivate->testContext = &m_platformInputContext;
+ QVERIFY2(!m_fullWidthSelectionImagesFolder.isEmpty(), qPrintable(QString::fromLatin1("Cannot locate 'fullWidthSelection' starting from %1").arg(QDir::currentPath())));
}
void tst_QTextEdit::cleanupTestCase()
@@ -1934,12 +1940,18 @@ void tst_QTextEdit::fullWidthSelection_data()
QTest::addColumn<int>("cursorTo");
QTest::addColumn<QString>("imageFileName");
- QTest::newRow("centered fully selected") << 0 << 15 << QString("fullWidthSelection/centered-fully-selected.png");
- QTest::newRow("centered partly selected") << 2 << 15 << QString("fullWidthSelection/centered-partly-selected.png");
- QTest::newRow("last char on line") << 42 << 44 << QString("fullWidthSelection/last-char-on-line.png");
- QTest::newRow("last char on parag") << 545 << 548 << QString("fullWidthSelection/last-char-on-parag.png");
- QTest::newRow("multiple full width lines") << 20 << 60 << QString("fullWidthSelection/multiple-full-width-lines.png");
- QTest::newRow("single full width line") << 20 << 30 << QString("fullWidthSelection/single-full-width-line.png");
+ QTest::newRow("centered fully selected")
+ << 0 << 15 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/centered-fully-selected.png"));
+ QTest::newRow("centered partly selected")
+ << 2 << 15 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/centered-partly-selected.png"));
+ QTest::newRow("last char on line")
+ << 42 << 44 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/last-char-on-line.png"));
+ QTest::newRow("last char on parag")
+ << 545 << 548 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/last-char-on-parag.png"));
+ QTest::newRow("multiple full width lines")
+ << 20 << 60 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/multiple-full-width-lines.png"));
+ QTest::newRow("single full width line")
+ << 20 << 30 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/single-full-width-line.png"));
}
void tst_QTextEdit::fullWidthSelection()
@@ -2053,11 +2065,12 @@ void tst_QTextEdit::compareWidgetAndImage(QTextEdit &widget, const QString &imag
QPainter painter(&image);
widget.viewport()->render(&painter);
painter.end();
- // qDebug() << "file: " << QString(SRCDIR) + imageFileName;
- QImageReader reader(QString(SRCDIR) + imageFileName, "PNG");
+ QImageReader reader(imageFileName, "PNG");
+
QImage original = reader.read();
- QCOMPARE(original.isNull(), false);
+ QVERIFY2(!original.isNull(),
+ qPrintable(QString::fromLatin1("Unable to read image %1: %2").arg(imageFileName, reader.errorString())));
QCOMPARE(original.size(), image.size());
QCOMPARE(image.depth(), 32);
QCOMPARE(original.depth(), image.depth());