summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2009-09-28 13:07:58 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2009-09-28 13:12:53 (GMT)
commitc9efa5704ba89736e90d7a28e07687a826874232 (patch)
tree0f074d7ae8eea6675ff97408d0f4871e72cde53f /tests
parentdcc6bf72843689dbe02404fc642641a3ba58106a (diff)
downloadQt-c9efa5704ba89736e90d7a28e07687a826874232.zip
Qt-c9efa5704ba89736e90d7a28e07687a826874232.tar.gz
Qt-c9efa5704ba89736e90d7a28e07687a826874232.tar.bz2
Fixed QMessageBox::updateSize test case for S60.
In S60 message boxes are always in portrait mode located on the bottom of screen and they occypy the whole sreen width. In addition messageboxes in S60 does not have their own buttons, but the buttons are located in system softkey area. That's why adding standard buttons for message box in S60 does not change the dialog size. Reviewed-by: Sami Merila
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qmessagebox/tst_qmessagebox.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/auto/qmessagebox/tst_qmessagebox.cpp b/tests/auto/qmessagebox/tst_qmessagebox.cpp
index 64e5a9c..5607fbd 100644
--- a/tests/auto/qmessagebox/tst_qmessagebox.cpp
+++ b/tests/auto/qmessagebox/tst_qmessagebox.cpp
@@ -130,7 +130,7 @@ private slots:
void testSymbols();
void incorrectDefaultButton();
void updateSize();
-
+
void setInformativeText();
void iconPixmap();
@@ -683,7 +683,13 @@ void tst_QMessageBox::incorrectDefaultButton()
void tst_QMessageBox::updateSize()
{
QMessageBox box;
+#ifdef Q_WS_S60
+ // In S60 messagebox is always occupies maximum width, i.e. screen width
+ // so we need to have long enough text to split over several line
+ box.setText("This is awesome long text");
+#else
box.setText("This is awesome");
+#endif
box.show();
QSize oldSize = box.size();
QString longText;
@@ -693,9 +699,12 @@ void tst_QMessageBox::updateSize()
QVERIFY(box.size() != oldSize); // should have grown
QVERIFY(box.width() > oldSize.width() || box.height() > oldSize.height());
oldSize = box.size();
+#ifndef Q_WS_S60
+ // In S60 dialogs buttons are in softkey area -> message box size does not change
box.setStandardButtons(QMessageBox::StandardButtons(0xFFFF));
QVERIFY(box.size() != oldSize); // should have grown
QVERIFY(box.width() > oldSize.width() || box.height() > oldSize.height());
+#endif
}
void tst_QMessageBox::setInformativeText()