diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-08-10 15:30:18 (GMT) |
---|---|---|
committer | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-08-18 09:13:48 (GMT) |
commit | cc1b6475a99994908cbd6309a08fd08614f18221 (patch) | |
tree | e8929d8dae9105ad4b42e60b222e5e0245fe2905 /tests | |
parent | babb444554958718c70fcc4f2ec73e3dfcc4dd11 (diff) | |
download | Qt-cc1b6475a99994908cbd6309a08fd08614f18221.zip Qt-cc1b6475a99994908cbd6309a08fd08614f18221.tar.gz Qt-cc1b6475a99994908cbd6309a08fd08614f18221.tar.bz2 |
Test backing store is deleted after: partial reveal, full reveal, hide
After the following sequence:
* widget starts hidden
* Partially reveal widget
* Fully reveal widget
* Hide widget
widget's backing store should be deleted, when running on Symbian.
Task-number: QTBUG-12800
Reviewed-by: Jason Barron
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qwidget/tst_qwidget.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index f722f89..e6e8970 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -9758,6 +9758,43 @@ 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)); + } } #undef WAIT_AND_VERIFY |