diff options
author | J-P Nurmi <jpnurmi@gmail.com> | 2018-01-31 19:38:45 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@gmail.com> | 2018-01-31 19:39:19 +0200 |
commit | a73307c58cde0a4503a43be94f3892745f68500e (patch) | |
tree | 0d9aab78fa7e6c320a225dd1c69ff80ac8baaa2f /tests/auto | |
parent | 3323ca8e627db560665edb667e52d52233c05601 (diff) | |
parent | 5d27e14e4ca49263d9c3309b5e93d4cb386063cc (diff) |
Merge remote-tracking branch 'origin/5.10' into 5.11
Change-Id: I7c0333dbf959124f6cf5be7837a305b65c08d290
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/controls/data/tst_action.qml | 28 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_popup.qml | 8 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_tumbler.qml | 1 | ||||
-rw-r--r-- | tests/auto/customization/tst_customization.cpp | 14 | ||||
-rw-r--r-- | tests/auto/qquickiconimage/tst_qquickiconimage.cpp | 9 | ||||
-rw-r--r-- | tests/auto/qquickiconlabel/tst_qquickiconlabel.cpp | 3 |
6 files changed, 63 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_action.qml b/tests/auto/controls/data/tst_action.qml index 7d057c26..35e65202 100644 --- a/tests/auto/controls/data/tst_action.qml +++ b/tests/auto/controls/data/tst_action.qml @@ -137,4 +137,32 @@ TestCase { keyClick(Qt.Key_B, Qt.ControlModifier) compare(container.lastSource, container.action) } + + Component { + id: actionAndRepeater + Item { + property alias action: testAction + Action { + id: testAction + shortcut: "Ctrl+A" + } + Repeater { + model: 1 + Button { + action: testAction + } + } + } + } + + function test_repeater() { + var container = createTemporaryObject(actionAndRepeater, testCase) + verify(container) + + var spy = signalSpy.createObject(container, {target: container.action, signalName: "triggered"}) + verify(spy.valid) + + keyClick(Qt.Key_A, Qt.ControlModifier) + compare(spy.count, 1) + } } 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/controls/data/tst_tumbler.qml b/tests/auto/controls/data/tst_tumbler.qml index 03908566..058cbeca 100644 --- a/tests/auto/controls/data/tst_tumbler.qml +++ b/tests/auto/controls/data/tst_tumbler.qml @@ -349,6 +349,7 @@ TestCase { verify(firstItem); // Test QTBUG-40298. actualPos = testCase.mapFromItem(firstItem, 0, 0); + tryCompare(tumbler, "moving", false); fuzzyCompare(actualPos.x, tumbler.leftPadding, 0.0001); fuzzyCompare(actualPos.y, tumbler.topPadding, 0.0001); 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) diff --git a/tests/auto/qquickiconimage/tst_qquickiconimage.cpp b/tests/auto/qquickiconimage/tst_qquickiconimage.cpp index 77b860a2..1dab0784 100644 --- a/tests/auto/qquickiconimage/tst_qquickiconimage.cpp +++ b/tests/auto/qquickiconimage/tst_qquickiconimage.cpp @@ -406,6 +406,9 @@ void tst_qquickiconimage::color() { SKIP_IF_DPR_TOO_HIGH(); + if (QGuiApplication::platformName() == QLatin1String("offscreen")) + QSKIP("grabToImage() doesn't work on the \"offscreen\" platform plugin (QTBUG-63185)"); + QQuickView view(testFileUrl("color.qml")); QCOMPARE(view.status(), QQuickView::Ready); view.show(); @@ -461,6 +464,9 @@ void tst_qquickiconimage::fileSelectors() { SKIP_IF_DPR_TOO_HIGH(); + if (QGuiApplication::platformName() == QLatin1String("offscreen")) + QSKIP("grabToImage() doesn't work on the \"offscreen\" platform plugin (QTBUG-63185)"); + QQuickView view; QQmlFileSelector* fileSelector = new QQmlFileSelector(view.engine()); fileSelector->setExtraSelectors(QStringList() << "testselector"); @@ -503,6 +509,9 @@ public: // don't crash (QTBUG-63959) void tst_qquickiconimage::imageProvider() { + if (QGuiApplication::platformName() == QLatin1String("offscreen")) + QSKIP("grabToImage() doesn't work on the \"offscreen\" platform plugin (QTBUG-63185)"); + QQuickView view; view.engine()->addImageProvider("provider", new TestImageProvider); view.setSource(testFileUrl("imageProvider.qml")); diff --git a/tests/auto/qquickiconlabel/tst_qquickiconlabel.cpp b/tests/auto/qquickiconlabel/tst_qquickiconlabel.cpp index a251b471..1f00d8e7 100644 --- a/tests/auto/qquickiconlabel/tst_qquickiconlabel.cpp +++ b/tests/auto/qquickiconlabel/tst_qquickiconlabel.cpp @@ -295,6 +295,9 @@ void tst_qquickiconlabel::emptyIconSource() void tst_qquickiconlabel::colorChanges() { + if (QGuiApplication::platformName() == QLatin1String("offscreen")) + QSKIP("grabToImage() doesn't work on the \"offscreen\" platform plugin (QTBUG-63185)"); + QQuickView view(testFileUrl("colorChanges.qml")); QCOMPARE(view.status(), QQuickView::Ready); view.show(); |