summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-08-18 12:13:39 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-08-18 12:13:39 (GMT)
commitfb3c6620c2eac018768b440a532ba476c2866d17 (patch)
treeba7a7272c7ebb2a0a831515fe84819028960fc8c /tests
parentbabb444554958718c70fcc4f2ec73e3dfcc4dd11 (diff)
parent0129e6e48613378a1a5548b2744ec7f9ae0d9961 (diff)
downloadQt-fb3c6620c2eac018768b440a532ba476c2866d17.zip
Qt-fb3c6620c2eac018768b440a532ba476c2866d17.tar.gz
Qt-fb3c6620c2eac018768b440a532ba476c2866d17.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public: Removed QEXPECT_FAIL macros for test case which now passes Ensure native window is considered invisible when it gets destroyed Refactored handling of window visibility events on Symbian Replaced backing store reference count with list of visible widgets Test backing store is deleted after reparenting a visible native child widget Test backing store is deleted after: partial reveal, full reveal, hide
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp75
1 files changed, 74 insertions, 1 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index f722f89..ef05b91 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -9742,7 +9742,6 @@ void tst_QWidget::destroyBackingStoreWhenHidden()
QVERIFY(0 != backingStore(child));
// Parent is obscured, therefore its backing store should be destroyed
- QEXPECT_FAIL("", "QTBUG-12406", Continue);
QVERIFY(0 == backingStore(parent));
// Disable full screen
@@ -9758,6 +9757,80 @@ void tst_QWidget::destroyBackingStoreWhenHidden()
QVERIFY(0 != backingStore(parent));
QVERIFY(0 == backingStore(child));
}
+
+ // 6. Partial reveal followed by full reveal
+ {
+ QWidget upper;
+ upper.setAutoFillBackground(true);
+ upper.setPalette(Qt::red);
+ upper.setGeometry(50, 50, 100, 100);
+
+ QWidget lower;
+ lower.setAutoFillBackground(true);
+ lower.setPalette(Qt::green);
+ lower.setGeometry(50, 50, 100, 100);
+
+ lower.show();
+ QTest::qWaitForWindowShown(&lower);
+ upper.show();
+ QTest::qWaitForWindowShown(&upper);
+ upper.raise();
+
+ QVERIFY(0 != backingStore(upper));
+ QVERIFY(0 == backingStore(lower));
+
+ // Check that upper obscures lower
+ QVERIFY(lower.visibleRegion().subtracted(upper.visibleRegion()).isEmpty());
+
+ // Partially reveal lower
+ upper.move(100, 100);
+
+ // Completely reveal lower
+ upper.hide();
+
+ // Hide lower widget - this should cause its backing store to be deleted
+ lower.hide();
+
+ // Check that backing store was deleted
+ WAIT_AND_VERIFY(0 == backingStore(lower));
+ }
+
+ // 7. Reparenting of visible native child widget
+ {
+ QWidget parent1;
+ parent1.setAutoFillBackground(true);
+ parent1.setPalette(Qt::green);
+ parent1.setGeometry(50, 50, 100, 100);
+
+ QWidget *child = new QWidget(&parent1);
+ child->winId();
+ child->setAutoFillBackground(true);
+ child->setPalette(Qt::red);
+ child->setGeometry(10, 10, 30, 30);
+
+ QWidget parent2;
+ parent2.setAutoFillBackground(true);
+ parent2.setPalette(Qt::blue);
+ parent2.setGeometry(150, 150, 100, 100);
+
+ parent1.show();
+ QTest::qWaitForWindowShown(&parent1);
+ QVERIFY(0 != backingStore(parent1));
+
+ parent2.show();
+ QTest::qWaitForWindowShown(&parent2);
+ QVERIFY(0 != backingStore(parent2));
+
+ child->setParent(&parent2);
+ child->setGeometry(10, 10, 30, 30);
+ child->show();
+
+ parent1.hide();
+ WAIT_AND_VERIFY(0 == backingStore(parent1));
+
+ parent2.hide();
+ WAIT_AND_VERIFY(0 == backingStore(parent2));
+ }
}
#undef WAIT_AND_VERIFY