diff options
Diffstat (limited to 'tests/auto/drawer/tst_drawer.cpp')
-rw-r--r-- | tests/auto/drawer/tst_drawer.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/drawer/tst_drawer.cpp b/tests/auto/drawer/tst_drawer.cpp index 3a02e9a9..f29abf21 100644 --- a/tests/auto/drawer/tst_drawer.cpp +++ b/tests/auto/drawer/tst_drawer.cpp @@ -69,6 +69,7 @@ private slots: void dragMargin(); void reposition(); + void header(); void hover_data(); void hover(); @@ -352,6 +353,37 @@ void tst_Drawer::reposition() QTRY_COMPARE(drawer->popupItem()->x(), static_cast<qreal>(window->width())); } +void tst_Drawer::header() +{ + QQuickApplicationHelper helper(this, QStringLiteral("header.qml")); + + QQuickApplicationWindow *window = helper.appWindow; + window->show(); + QVERIFY(QTest::qWaitForWindowExposed(window)); + + QQuickItem *content = window->contentItem(); + QVERIFY(content); + + QQuickOverlay *overlay = QQuickOverlay::overlay(window); + QVERIFY(overlay); + + QQuickDrawer *drawer = window->property("drawer").value<QQuickDrawer*>(); + QVERIFY(drawer); + QQuickItem *popupItem = drawer->popupItem(); + + drawer->open(); + QVERIFY(drawer->isVisible()); + + QCOMPARE(drawer->parentItem(), overlay); + QCOMPARE(drawer->height(), overlay->height()); + QCOMPARE(popupItem->height(), overlay->height()); + + drawer->setParentItem(content); + QCOMPARE(drawer->parentItem(), content); + QCOMPARE(drawer->height(), content->height()); + QCOMPARE(popupItem->height(), content->height()); +} + void tst_Drawer::hover_data() { QTest::addColumn<QString>("source"); |