aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorKari Oikarinen <kari.oikarinen@qt.io>2020-03-10 09:43:44 +0200
committerKari Oikarinen <kari.oikarinen@qt.io>2020-03-10 09:43:44 +0200
commitb67264a2644b22dc23f6a06ff48974c77cb45d84 (patch)
tree3ac6547ac4daecac92feb4d192ed0cf97f5b758a /tests/auto
parentdf034c07be4828778d43a4037f89f31ac26f411d (diff)
parent92daa739ec114a0c9ae841db0459b0eff1f86cef (diff)
Merge 5.14 into 5.14.2
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/quick/qquickcanvasitem/BLACKLIST10
-rw-r--r--tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml5
-rw-r--r--tests/auto/quick/qquickcanvasitem/data/tst_arcto.qml8
-rw-r--r--tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml25
-rw-r--r--tests/auto/quick/qquickcanvasitem/qquickcanvasitem.pro2
-rw-r--r--tests/auto/quick/qquickcanvasitem/tst_qquickcanvasitem.cpp2
-rw-r--r--tests/auto/quick/qquickitem2/data/activeFocusOnTab_infiniteLoop2.qml12
-rw-r--r--tests/auto/quick/qquickitem2/tst_qquickitem.cpp15
8 files changed, 54 insertions, 25 deletions
diff --git a/tests/auto/quick/qquickcanvasitem/BLACKLIST b/tests/auto/quick/qquickcanvasitem/BLACKLIST
index 21580b6730..a4b25475a4 100644
--- a/tests/auto/quick/qquickcanvasitem/BLACKLIST
+++ b/tests/auto/quick/qquickcanvasitem/BLACKLIST
@@ -3,12 +3,18 @@ macos
[canvas::test_paint]
macos
[canvas::test_save]
+windows
macos
[canvas::test_implicitlySizedParent]
-macos ci
+*
+# QTBUG-41043
[canvas::test_toDataURL]
-macos
+*
[fillRect::test_fillRect]
macos
[imagedata::test_rounding]
macos ci
+[ContextFontValidation::test_pixelSize]
+opensuse-leap
+[ContextFontValidation::test_valid]
+opensuse-leap
diff --git a/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml b/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml
index b0fb7fcf8c..5e02ca10d0 100644
--- a/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml
+++ b/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml
@@ -7,6 +7,7 @@ TestCase {
when:windowShown
width:100
height:100
+ visible: true
property Component component:CanvasComponent{}
function cleanupTestCase() {
wait(100) //wait for a short while to make sure no leaked textures
@@ -19,8 +20,8 @@ TestCase {
// { tag:"image cooperative", properties:{width:100, height:100, renderTarget:Canvas.Image, renderStrategy:Canvas.Cooperative}},
{ tag:"image immediate", properties:{width:100, height:100, renderTarget:Canvas.Image, renderStrategy:Canvas.Immediate}},
// { tag:"fbo cooperative", properties:{width:100, height:100, renderTarget:Canvas.FramebufferObject, renderStrategy:Canvas.Cooperative}},
- { tag:"fbo immediate", properties:{width:100, height:100, renderTarget:Canvas.FramebufferObject, renderStrategy:Canvas.Immediate}},
- { tag:"fbo threaded", properties:{width:100, height:100, renderTarget:Canvas.FramebufferObject, renderStrategy:Canvas.Threaded}}
+ { tag:"fbo immediate", properties:{width:100, height:100, renderTarget:Canvas.FramebufferObject, renderStrategy:Canvas.Immediate}}
+// { tag:"fbo threaded", properties:{width:100, height:100, renderTarget:Canvas.FramebufferObject, renderStrategy:Canvas.Threaded}} // QTBUG-82675
];
return [];
}
diff --git a/tests/auto/quick/qquickcanvasitem/data/tst_arcto.qml b/tests/auto/quick/qquickcanvasitem/data/tst_arcto.qml
index d9017150a4..ef1b7a7b2a 100644
--- a/tests/auto/quick/qquickcanvasitem/data/tst_arcto.qml
+++ b/tests/auto/quick/qquickcanvasitem/data/tst_arcto.qml
@@ -357,7 +357,7 @@ CanvasTestCase {
ctx.fillStyle = '#0f0';
ctx.beginPath();
ctx.moveTo(0, 50);
- ctx.translate(100, 0);
+ ctx.translate(50, 0);
ctx.arcTo(50, 50, 50, 0, 50);
ctx.lineTo(-100, 0);
ctx.fill();
@@ -367,11 +367,11 @@ CanvasTestCase {
comparePixel(ctx, 99,0, 0,255,0,255);
comparePixel(ctx, 0,25, 0,255,0,255);
comparePixel(ctx, 50,25, 0,255,0,255);
- comparePixel(ctx, 99,25, 0,255,0,255);
+ comparePixel(ctx, 99,25, 255,0,0,255);
comparePixel(ctx, 0,49, 0,255,0,255);
comparePixel(ctx, 50,49, 0,255,0,255);
- comparePixel(ctx, 99,49, 0,255,0,255);
- }
+ comparePixel(ctx, 99,49, 255,0,0,255);
+ }
function test_zero(row) {
var canvas = createCanvasObject(row);
var ctx = canvas.getContext('2d');
diff --git a/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml b/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml
index 8238d87313..d74df3daa7 100644
--- a/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml
+++ b/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml
@@ -129,12 +129,12 @@ CanvasTestCase {
tryCompare(c, "availableChangedCount", 1);
c.requestPaint();
- verify(c.save("c.png"));
- c.loadImage("c.png");
- wait(200);
- verify(c.isImageLoaded("c.png"));
- verify(!c.isImageLoading("c.png"));
- verify(!c.isImageError("c.png"));
+ var imagePath = applicationDirPath + "/c.png";
+ verify(c.save(imagePath));
+ c.loadImage(imagePath);
+ tryVerify(function() { return c.isImageLoaded(imagePath) })
+ verify(!c.isImageLoading(imagePath));
+ verify(!c.isImageError(imagePath));
c.destroy();
}
@@ -187,28 +187,28 @@ CanvasTestCase {
tryCompare(c, "availableChangedCount", 1);
//scene graph could be available immediately
//in this case, we force waiting a short while until the init paint finished
- tryCompare(c, "paintedCount", 1);
+ tryCompare(c, "paintedCount", 0);
ctx.fillRect(0, 0, c.width, c.height);
c.toDataURL();
- tryCompare(c, "paintedCount", 2);
+ tryCompare(c, "paintedCount", 1);
tryCompare(c, "paintCount", 1);
// implicit repaint when visible and resized
testCase.visible = true;
c.width += 1;
c.height += 1;
tryCompare(c, "paintCount", 2);
- tryCompare(c, "paintedCount", 2);
+ tryCompare(c, "paintedCount", 1);
// allow explicit repaint even when hidden
testCase.visible = false;
c.requestPaint();
tryCompare(c, "paintCount", 3);
- tryCompare(c, "paintedCount", 2);
+ tryCompare(c, "paintedCount", 1);
// no implicit repaint when resized but hidden
c.width += 1;
c.height += 1;
waitForRendering(c);
compare(c.paintCount, 3);
- tryCompare(c, "paintedCount", 2);
+ tryCompare(c, "paintedCount", 1);
c.destroy();
}
function test_loadImage(row) {
@@ -221,8 +221,7 @@ CanvasTestCase {
verify(!c.isImageLoaded("red.png"));
c.loadImage("red.png");
- wait(200);
- verify(c.isImageLoaded("red.png"));
+ tryVerify(function() { return c.isImageLoaded("red.png") });
verify(!c.isImageLoading("red.png"));
verify(!c.isImageError("red.png"));
diff --git a/tests/auto/quick/qquickcanvasitem/qquickcanvasitem.pro b/tests/auto/quick/qquickcanvasitem/qquickcanvasitem.pro
index 70e5a05f8d..90c7962382 100644
--- a/tests/auto/quick/qquickcanvasitem/qquickcanvasitem.pro
+++ b/tests/auto/quick/qquickcanvasitem/qquickcanvasitem.pro
@@ -55,5 +55,3 @@ OTHER_FILES += \
data/yellow75.png \
data/tst_invalidContext.qml
-
-CONFIG += insignificant_test # QTBUG-41043
diff --git a/tests/auto/quick/qquickcanvasitem/tst_qquickcanvasitem.cpp b/tests/auto/quick/qquickcanvasitem/tst_qquickcanvasitem.cpp
index dad8df0682..4a83bd6c0d 100644
--- a/tests/auto/quick/qquickcanvasitem/tst_qquickcanvasitem.cpp
+++ b/tests/auto/quick/qquickcanvasitem/tst_qquickcanvasitem.cpp
@@ -46,6 +46,8 @@ public slots:
false
#endif
));
+ engine->rootContext()->setContextProperty("applicationDirPath",
+ QCoreApplication::applicationDirPath());
}
};
diff --git a/tests/auto/quick/qquickitem2/data/activeFocusOnTab_infiniteLoop2.qml b/tests/auto/quick/qquickitem2/data/activeFocusOnTab_infiniteLoop2.qml
new file mode 100644
index 0000000000..042f408753
--- /dev/null
+++ b/tests/auto/quick/qquickitem2/data/activeFocusOnTab_infiniteLoop2.qml
@@ -0,0 +1,12 @@
+import QtQuick 2.14
+
+Item {
+ width: 400
+ height: 200
+ Item {
+ objectName: "hiddenChild"
+ focus: true
+ activeFocusOnTab: true
+ visible: false
+ }
+}
diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
index 399535cfa6..767994ec7d 100644
--- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
@@ -64,6 +64,7 @@ private slots:
void activeFocusOnTab8();
void activeFocusOnTab9();
void activeFocusOnTab10();
+ void activeFocusOnTab_infiniteLoop_data();
void activeFocusOnTab_infiniteLoop();
void nextItemInFocusChain();
@@ -1025,12 +1026,20 @@ void tst_QQuickItem::activeFocusOnTab10()
delete window;
}
+void tst_QQuickItem::activeFocusOnTab_infiniteLoop_data()
+{
+ QTest::addColumn<QUrl>("source");
+ QTest::newRow("infiniteLoop") << testFileUrl("activeFocusOnTab_infiniteLoop.qml"); // QTBUG-68271
+ QTest::newRow("infiniteLoop2") << testFileUrl("activeFocusOnTab_infiniteLoop2.qml");// QTBUG-81510
+}
+
void tst_QQuickItem::activeFocusOnTab_infiniteLoop()
{
- // see QTBUG-68271
+ QFETCH(QUrl, source);
+
// create a window where the currently focused item is not visible
QScopedPointer<QQuickView>window(new QQuickView());
- window->setSource(testFileUrl("activeFocusOnTab_infiniteLoop.qml"));
+ window->setSource(source);
window->show();
auto *hiddenChild = findItem<QQuickItem>(window->rootObject(), "hiddenChild");
QVERIFY(hiddenChild);
@@ -1039,6 +1048,8 @@ void tst_QQuickItem::activeFocusOnTab_infiniteLoop()
auto *item = hiddenChild->nextItemInFocusChain();
// focus is moved to the root object since there is no other candidate
QCOMPARE(item, window->rootObject());
+ item = hiddenChild->nextItemInFocusChain(false);
+ QCOMPARE(item, window->rootObject());
}
void tst_QQuickItem::nextItemInFocusChain()