summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-06 02:46:37 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-06 02:46:37 (GMT)
commit32290f508b2d250cd7a3a783e8b7d2322e676783 (patch)
treef2ff88dfecfda81cb3fd1f05dcff71647b0cac35 /tests/auto
parent941b13d52d975069d10093a873cd3a55bb2fd7dd (diff)
parent3b7164b3188e9382510bef2211e82ef777faa75c (diff)
downloadQt-32290f508b2d250cd7a3a783e8b7d2322e676783.zip
Qt-32290f508b2d250cd7a3a783e8b7d2322e676783.tar.gz
Qt-32290f508b2d250cd7a3a783e8b7d2322e676783.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public: Fixed casual crash in initializeDb (Symbian) Fixed a bug where text would disappear in password fields. Fixed sendEvent call. Removed useless member variable and replaced with var on the stack. Fixed indentation. Fix to S60 softkey pressed down image. Whitespace/tab fixes. s60 application loses normalGeometry when returning from fullscreen Fixing 'softvfp+vfpv2' compiling issue for Tb9.2
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp224
1 files changed, 224 insertions, 0 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 1fb323e..03eddee 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -391,6 +391,10 @@ private slots:
#ifdef Q_OS_SYMBIAN
void cbaVisibility();
+ void fullScreenWindowModeTransitions();
+ void maximizedWindowModeTransitions();
+ void minimizedWindowModeTransitions();
+ void normalWindowModeTransitions();
#endif
void focusProxyAndInputMethods();
@@ -9689,6 +9693,226 @@ void tst_QWidget::cbaVisibility()
CEikButtonGroupContainer* buttonGroup = CEikonEnv::Static()->AppUiFactory()->Cba();
QVERIFY(buttonGroup->IsVisible());
}
+
+void tst_QWidget::fullScreenWindowModeTransitions()
+{
+ QWidget widget;
+ QVBoxLayout *layout = new QVBoxLayout;
+ QPushButton *button = new QPushButton("test Button");
+ layout->addWidget(button);
+ widget.setLayout(layout);
+ widget.show();
+
+ const QRect normalGeometry = widget.normalGeometry();
+ const QRect fullScreenGeometry = qApp->desktop()->screenGeometry(&widget);
+ const QRect maximumScreenGeometry = qApp->desktop()->availableGeometry(&widget);
+ CEikStatusPane *statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane();
+ CEikButtonGroupContainer *buttonGroup = CEikonEnv::Static()->AppUiFactory()->Cba();
+
+ //Enter
+ widget.showNormal();
+ widget.showFullScreen();
+ QCOMPARE(widget.geometry(), fullScreenGeometry);
+ QVERIFY(!buttonGroup->IsVisible());
+ QVERIFY(!statusPane->IsVisible());
+
+ widget.showMaximized();
+ widget.showFullScreen();
+ QCOMPARE(widget.geometry(), fullScreenGeometry);
+ QVERIFY(!buttonGroup->IsVisible());
+ QVERIFY(!statusPane->IsVisible());
+
+ widget.showMinimized();
+ widget.showFullScreen();
+ QCOMPARE(widget.geometry(), fullScreenGeometry);
+ QVERIFY(!buttonGroup->IsVisible());
+ QVERIFY(!statusPane->IsVisible());
+
+ //Exit
+ widget.showFullScreen();
+ widget.showNormal();
+ QCOMPARE(widget.geometry(), normalGeometry);
+ QVERIFY(buttonGroup->IsVisible());
+ QVERIFY(statusPane->IsVisible());
+
+ widget.showFullScreen();
+ widget.showMaximized();
+ QCOMPARE(widget.geometry(), maximumScreenGeometry);
+ QVERIFY(buttonGroup->IsVisible());
+ QVERIFY(statusPane->IsVisible());
+
+ widget.showFullScreen();
+ widget.showMinimized();
+ QCOMPARE(widget.geometry(), fullScreenGeometry);
+ QVERIFY(!buttonGroup->IsVisible());
+ QVERIFY(!statusPane->IsVisible());
+}
+
+void tst_QWidget::maximizedWindowModeTransitions()
+{
+ QWidget widget;
+ QVBoxLayout *layout = new QVBoxLayout;
+ QPushButton *button = new QPushButton("test Button");
+ layout->addWidget(button);
+ widget.setLayout(layout);
+ widget.show();
+
+ const QRect normalGeometry = widget.normalGeometry();
+ const QRect fullScreenGeometry = qApp->desktop()->screenGeometry(&widget);
+ const QRect maximumScreenGeometry = qApp->desktop()->availableGeometry(&widget);
+ CEikStatusPane *statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane();
+ CEikButtonGroupContainer *buttonGroup = CEikonEnv::Static()->AppUiFactory()->Cba();
+
+ //Enter
+ widget.showNormal();
+ widget.showMaximized();
+ QCOMPARE(widget.geometry(), maximumScreenGeometry);
+ QVERIFY(buttonGroup->IsVisible());
+ QVERIFY(statusPane->IsVisible());
+
+ widget.showFullScreen();
+ widget.showMaximized();
+ QCOMPARE(widget.geometry(), maximumScreenGeometry);
+ QVERIFY(buttonGroup->IsVisible());
+ QVERIFY(statusPane->IsVisible());
+
+ widget.showMinimized();
+ widget.showMaximized();
+ QCOMPARE(widget.geometry(), maximumScreenGeometry);
+ QVERIFY(buttonGroup->IsVisible());
+ QVERIFY(statusPane->IsVisible());
+
+ //Exit
+ widget.showMaximized();
+ widget.showNormal();
+ QCOMPARE(widget.geometry(), normalGeometry);
+ QVERIFY(buttonGroup->IsVisible());
+ QVERIFY(statusPane->IsVisible());
+
+ widget.showMaximized();
+ widget.showFullScreen();
+ QCOMPARE(widget.geometry(), fullScreenGeometry);
+ QVERIFY(!buttonGroup->IsVisible());
+ QVERIFY(!statusPane->IsVisible());
+
+ widget.showMaximized();
+ widget.showMinimized();
+ // Since showMinimized hides window decoration availableGeometry gives different value
+ // than with decoration visible. Altual size does not really matter since widget is invisible.
+ QCOMPARE(widget.geometry(), qApp->desktop()->availableGeometry(&widget));
+ QVERIFY(!buttonGroup->IsVisible());
+ QVERIFY(!statusPane->IsVisible());
+}
+
+void tst_QWidget::minimizedWindowModeTransitions()
+{
+ QWidget widget;
+ QVBoxLayout *layout = new QVBoxLayout;
+ QPushButton *button = new QPushButton("test Button");
+ layout->addWidget(button);
+ widget.setLayout(layout);
+ widget.show();
+
+ const QRect normalGeometry = widget.normalGeometry();
+ const QRect fullScreenGeometry = qApp->desktop()->screenGeometry(&widget);
+ const QRect maximumScreenGeometry = qApp->desktop()->availableGeometry(&widget);
+ CEikStatusPane *statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane();
+ CEikButtonGroupContainer *buttonGroup = CEikonEnv::Static()->AppUiFactory()->Cba();
+
+ //Enter
+ widget.showNormal();
+ widget.showMinimized();
+ QCOMPARE(widget.geometry(), normalGeometry);
+ QVERIFY(!buttonGroup->IsVisible());
+ QVERIFY(!statusPane->IsVisible());
+
+ widget.showFullScreen();
+ widget.showMinimized();
+ QCOMPARE(widget.geometry(), fullScreenGeometry);
+ QVERIFY(!buttonGroup->IsVisible());
+ QVERIFY(!statusPane->IsVisible());
+
+ widget.showMaximized();
+ widget.showMinimized();
+ // Since showMinimized hides window decoration availableGeometry gives different value
+ // than with decoration visible. Altual size does not really matter since widget is invisible.
+ QCOMPARE(widget.geometry(), qApp->desktop()->availableGeometry(&widget));
+ QVERIFY(!buttonGroup->IsVisible());
+ QVERIFY(!statusPane->IsVisible());
+
+ //Exit
+ widget.showMinimized();
+ widget.showNormal();
+ QCOMPARE(widget.geometry(), normalGeometry);
+ QVERIFY(buttonGroup->IsVisible());
+ QVERIFY(statusPane->IsVisible());
+
+ widget.showMinimized();
+ widget.showFullScreen();
+ QCOMPARE(widget.geometry(), fullScreenGeometry);
+ QVERIFY(!buttonGroup->IsVisible());
+ QVERIFY(!statusPane->IsVisible());
+
+ widget.showMinimized();
+ widget.showMaximized();
+ QCOMPARE(widget.geometry(), maximumScreenGeometry);
+ QVERIFY(buttonGroup->IsVisible());
+ QVERIFY(statusPane->IsVisible());
+}
+
+void tst_QWidget::normalWindowModeTransitions()
+{
+ QWidget widget;
+ QVBoxLayout *layout = new QVBoxLayout;
+ QPushButton *button = new QPushButton("test Button");
+ layout->addWidget(button);
+ widget.setLayout(layout);
+ widget.show();
+
+ const QRect normalGeometry = widget.normalGeometry();
+ const QRect fullScreenGeometry = qApp->desktop()->screenGeometry(&widget);
+ const QRect maximumScreenGeometry = qApp->desktop()->availableGeometry(&widget);
+ CEikStatusPane *statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane();
+ CEikButtonGroupContainer *buttonGroup = CEikonEnv::Static()->AppUiFactory()->Cba();
+
+ //Enter
+ widget.showMaximized();
+ widget.showNormal();
+ QCOMPARE(widget.geometry(), normalGeometry);
+ QVERIFY(buttonGroup->IsVisible());
+ QVERIFY(statusPane->IsVisible());
+
+ widget.showFullScreen();
+ widget.showNormal();
+ QCOMPARE(widget.geometry(), normalGeometry);
+ QVERIFY(buttonGroup->IsVisible());
+ QVERIFY(statusPane->IsVisible());
+
+ widget.showMinimized();
+ widget.showNormal();
+ QCOMPARE(widget.geometry(), normalGeometry);
+ QVERIFY(buttonGroup->IsVisible());
+ QVERIFY(statusPane->IsVisible());
+
+ //Exit
+ widget.showNormal();
+ widget.showMaximized();
+ QCOMPARE(widget.geometry(), maximumScreenGeometry);
+ QVERIFY(buttonGroup->IsVisible());
+ QVERIFY(statusPane->IsVisible());
+
+ widget.showNormal();
+ widget.showFullScreen();
+ QCOMPARE(widget.geometry(), fullScreenGeometry);
+ QVERIFY(!buttonGroup->IsVisible());
+ QVERIFY(!statusPane->IsVisible());
+
+ widget.showNormal();
+ widget.showMinimized();
+ QCOMPARE(widget.geometry(), normalGeometry);
+ QVERIFY(!buttonGroup->IsVisible());
+ QVERIFY(!statusPane->IsVisible());
+}
#endif
class InputContextTester : public QInputContext