summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-21 17:34:21 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-21 17:34:21 (GMT)
commit191df7e5575cb5b8d56846d82d405a8f0dd07fa9 (patch)
tree523036a7525fa0e57316a91c24aa31a0c600e658 /tests
parenteee847d00f6de755909d6f913430da662f26c503 (diff)
parent5cfefb0f71e4f4587f1c31d3d785136a9655085b (diff)
downloadQt-191df7e5575cb5b8d56846d82d405a8f0dd07fa9.zip
Qt-191df7e5575cb5b8d56846d82d405a8f0dd07fa9.tar.gz
Qt-191df7e5575cb5b8d56846d82d405a8f0dd07fa9.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fixed an assert in QMenu Call eglTerminate() when the last QEglContext is destroyed to free mem.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qmenu/tst_qmenu.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp
index 9dc18e0..63e7310 100644
--- a/tests/auto/qmenu/tst_qmenu.cpp
+++ b/tests/auto/qmenu/tst_qmenu.cpp
@@ -51,6 +51,7 @@
#include <QListWidget>
#include <QWidgetAction>
#include <QDesktopWidget>
+#include <qdialog.h>
#include <qmenu.h>
#include <qstyle.h>
@@ -104,6 +105,7 @@ private slots:
void setFixedWidth();
void deleteActionInTriggered();
void pushButtonPopulateOnAboutToShow();
+ void QTBUG_10735_crashWithDialog();
protected slots:
void onActivated(QAction*);
void onHighlighted(QAction*);
@@ -932,5 +934,57 @@ void tst_QMenu::pushButtonPopulateOnAboutToShow()
}
+class MyMenu : public QMenu
+{
+ Q_OBJECT
+public:
+ MyMenu() : m_currentIndex(0)
+ {
+ for (int i = 0; i < 2; ++i)
+ dialogActions[i] = addAction( QString("dialog %1").arg(i), dialogs + i, SLOT(exec()));
+ }
+
+
+ void activateAction(int index)
+ {
+ m_currentIndex = index;
+ popup(QPoint());
+ QTest::qWaitForWindowShown(this);
+ setActiveAction(dialogActions[index]);
+ QTimer::singleShot(500, this, SLOT(checkVisibility()));
+ QTest::keyClick(this, Qt::Key_Enter); //activation
+ }
+
+public slots:
+ void activateLastAction()
+ {
+ activateAction(1);
+ }
+
+ void checkVisibility()
+ {
+ QTRY_VERIFY(dialogs[m_currentIndex].isVisible());
+ if (m_currentIndex == 1) {
+ QApplication::closeAllWindows(); //this is the end of the test
+ }
+ }
+
+
+private:
+ QAction *dialogActions[2];
+ QDialog dialogs[2];
+ int m_currentIndex;
+};
+
+void tst_QMenu::QTBUG_10735_crashWithDialog()
+{
+ MyMenu menu;
+
+ QTimer::singleShot(1000, &menu, SLOT(activateLastAction()));
+ menu.activateAction(0);
+
+}
+
+
QTEST_MAIN(tst_QMenu)
#include "tst_qmenu.moc"