Add check for top level widget leaks in kernel test of QtWidgets.
Add a cleanup function for the check and disable animations in tst_qwidgetaction to prevent effect widgets from interfering (vista style animations). Change-Id: I043ecb131c8dcd07b6ef10bc75c9e010ab569e85 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>bb10
parent
05fa4ac7df
commit
8d5516b585
|
|
@ -42,6 +42,7 @@ class tst_QActionGroup : public QObject
|
|||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void cleanup() { QVERIFY(QApplication::topLevelWidgets().isEmpty()); }
|
||||
void enabledPropagation();
|
||||
void visiblePropagation();
|
||||
void exclusive();
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ void tst_QDesktopWidget::init()
|
|||
|
||||
void tst_QDesktopWidget::cleanup()
|
||||
{
|
||||
QVERIFY(QApplication::topLevelWidgets().isEmpty());
|
||||
}
|
||||
|
||||
void tst_QDesktopWidget::numScreens()
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ public:
|
|||
virtual ~tst_QLayout();
|
||||
|
||||
private slots:
|
||||
void cleanup() { QVERIFY(QApplication::topLevelWidgets().isEmpty()); }
|
||||
void getSetCheck();
|
||||
void geometry();
|
||||
void smartMaxSize();
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ public slots:
|
|||
public slots:
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
void cleanup() { QCOMPARE(QApplication::topLevelWidgets().size(), 1); }
|
||||
|
||||
private slots:
|
||||
void number_data();
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ class tst_QSizePolicy : public QObject
|
|||
Q_OBJECT
|
||||
|
||||
private Q_SLOTS:
|
||||
void cleanup() { QVERIFY(QApplication::topLevelWidgets().isEmpty()); }
|
||||
void qtest();
|
||||
void defaultValues();
|
||||
void getSetCheck_data() { data(); }
|
||||
|
|
|
|||
|
|
@ -55,6 +55,8 @@ class tst_QWidgetAction : public QObject
|
|||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
void initTestCase();
|
||||
void cleanup();
|
||||
void defaultWidget();
|
||||
void visibilityUpdate();
|
||||
void customWidget();
|
||||
|
|
@ -65,6 +67,19 @@ private slots:
|
|||
void releaseWidgetCrash();
|
||||
};
|
||||
|
||||
void tst_QWidgetAction::initTestCase()
|
||||
{
|
||||
// Disable menu/combo animations to prevent the alpha widgets from getting in the
|
||||
// way in popup(), failing the top level leak check in cleanup().
|
||||
QApplication::setEffectEnabled(Qt::UI_AnimateMenu, false);
|
||||
QApplication::setEffectEnabled(Qt::UI_AnimateCombo, false);
|
||||
}
|
||||
|
||||
void tst_QWidgetAction::cleanup()
|
||||
{
|
||||
QVERIFY(QApplication::topLevelWidgets().isEmpty());
|
||||
}
|
||||
|
||||
void tst_QWidgetAction::defaultWidget()
|
||||
{
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue