aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/controls/data/tst_popup.qml8
-rw-r--r--tests/auto/customization/tst_customization.cpp14
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_popup.qml b/tests/auto/controls/data/tst_popup.qml
index 88ec295f..3f9f5e48 100644
--- a/tests/auto/controls/data/tst_popup.qml
+++ b/tests/auto/controls/data/tst_popup.qml
@@ -1261,4 +1261,12 @@ TestCase {
control.open()
verify(control.visible)
}
+
+ function test_deferredBackgroundSize() {
+ var control = createTemporaryObject(popupControl, testCase, {width: 200, height: 100})
+ verify(control)
+
+ compare(control.background.width, 200 + (control.background.leftInset || 0) + (control.background.rightInset || 0))
+ compare(control.background.height, 100 + (control.background.topInset || 0) + (control.background.bottomInset || 0))
+ }
}
diff --git a/tests/auto/customization/tst_customization.cpp b/tests/auto/customization/tst_customization.cpp
index 91b5706c..91646653 100644
--- a/tests/auto/customization/tst_customization.cpp
+++ b/tests/auto/customization/tst_customization.cpp
@@ -487,6 +487,20 @@ void tst_customization::comboPopup()
QTest::mouseClick(&window, Qt::LeftButton, Qt::NoModifier, QPoint(1, 1));
QVERIFY(qt_createdQObjects()->contains("combobox-popup-simple"));
}
+
+ reset();
+
+ {
+ // test that ComboBox::popup is completed upon component completion (if appropriate)
+ QQmlComponent component(engine);
+ component.setData("import QtQuick 2.9; import QtQuick.Controls 2.2; ComboBox { id: control; contentItem: Item { visible: !control.popup.visible } popup: Popup { property bool wasCompleted: false; Component.onCompleted: wasCompleted = true } }", QUrl());
+ QScopedPointer<QQuickItem> comboBox(qobject_cast<QQuickItem *>(component.create()));
+ QVERIFY(comboBox);
+
+ QObject *popup = comboBox->property("popup").value<QObject *>();
+ QVERIFY(popup);
+ QCOMPARE(popup->property("wasCompleted"), QVariant(true));
+ }
}
QTEST_MAIN(tst_customization)