aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickimage
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@live.com>2013-07-19 14:32:17 -0500
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-01 18:45:59 +0200
commit472950ecab88fc41a99f2a1deb861a4abd273174 (patch)
tree1ada3fd4fcb20ad656eeca25ba626833a144a203 /tests/auto/quick/qquickimage
parentf58de6f8b35a823525aeb75337e0152bd9caeda0 (diff)
Fix crash when changing non-cached source of image during animation
Ensure deferred deletions are handled while syncing, otherwise texture might be deleted after sync but before deferred deletion is processed. Task-number: QTBUG-32513 Change-Id: Id276f536a5722a36baae815b7b550b574eeeb483 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'tests/auto/quick/qquickimage')
-rw-r--r--tests/auto/quick/qquickimage/data/qtbug_32513.qml63
-rw-r--r--tests/auto/quick/qquickimage/tst_qquickimage.cpp10
2 files changed, 73 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickimage/data/qtbug_32513.qml b/tests/auto/quick/qquickimage/data/qtbug_32513.qml
new file mode 100644
index 0000000000..b6cbe33eec
--- /dev/null
+++ b/tests/auto/quick/qquickimage/data/qtbug_32513.qml
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ width: 200; height: 200
+
+ Image {
+ cache: false
+
+ NumberAnimation on opacity {
+ loops: Animation.Infinite
+ from: 1; to: 0
+ }
+
+ SequentialAnimation on source {
+ loops: Animation.Infinite
+ PropertyAction { value: "green.png" }
+ PauseAnimation { duration: 100 }
+ PropertyAction { value: "pattern.png" }
+ PauseAnimation { duration: 100 }
+ }
+ }
+}
diff --git a/tests/auto/quick/qquickimage/tst_qquickimage.cpp b/tests/auto/quick/qquickimage/tst_qquickimage.cpp
index 0804c7b900..8bdb9c9de5 100644
--- a/tests/auto/quick/qquickimage/tst_qquickimage.cpp
+++ b/tests/auto/quick/qquickimage/tst_qquickimage.cpp
@@ -99,6 +99,7 @@ private slots:
void sourceSize_QTBUG_16389();
void nullPixmapPaint();
void imageCrash_QTBUG_22125();
+ void imageCrash_QTBUG_32513();
void sourceSize_data();
void sourceSize();
void progressAndStatusChanges();
@@ -704,6 +705,15 @@ void tst_qquickimage::imageCrash_QTBUG_22125()
QCoreApplication::processEvents();
}
+void tst_qquickimage::imageCrash_QTBUG_32513()
+{
+ QQuickView view(testFileUrl("qtbug_32513.qml"));
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QTest::qWait(1000);
+ // shouldn't crash when the image changes sources
+}
+
void tst_qquickimage::sourceSize_data()
{
QTest::addColumn<int>("sourceWidth");