Fix QSGImage autotest.
authorYann Bodson <yann.bodson@nokia.com>
Wed, 25 May 2011 03:23:30 +0000 (13:23 +1000)
committerYann Bodson <yann.bodson@nokia.com>
Wed, 25 May 2011 03:23:30 +0000 (13:23 +1000)
tests/auto/declarative/qsgimage/tst_qsgimage.cpp

index a8dadf0..1ddaa62 100644 (file)
@@ -498,7 +498,7 @@ void tst_qsgimage::noLoading()
     server.serveDirectory(SRCDIR "/data");
     server.addRedirect("oldcolors.png", SERVER_ADDR "/colors.png");
 
-    QString componentStr = "import QtQuick 2.0\nImage { source: srcImage }";
+    QString componentStr = "import QtQuick 2.0\nImage { source: srcImage; cache: true }";
     QDeclarativeContext *ctxt = engine.rootContext();
     ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/heart.png"));
     QDeclarativeComponent component(&engine);
@@ -512,7 +512,7 @@ void tst_qsgimage::noLoading()
     QSignalSpy statusSpy(obj, SIGNAL(statusChanged(QSGImageBase::Status)));
 
     // Loading local file
-    ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png"));
+    ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/green.png"));
     QTRY_VERIFY(obj->status() == QSGImage::Ready);
     QTRY_VERIFY(obj->progress() == 1.0);
     QTRY_COMPARE(sourceSpy.count(), 1);
@@ -520,7 +520,7 @@ void tst_qsgimage::noLoading()
     QTRY_COMPARE(statusSpy.count(), 0);
 
     // Loading remote file
-    ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/heart200.png");
+    ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/rect.png");
     QTRY_VERIFY(obj->status() == QSGImage::Loading);
     QTRY_VERIFY(obj->progress() == 0.0);
     QTRY_VERIFY(obj->status() == QSGImage::Ready);
@@ -530,8 +530,8 @@ void tst_qsgimage::noLoading()
     QTRY_COMPARE(statusSpy.count(), 2);
 
     // Loading remote file again - should not go through 'Loading' state.
-    ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png"));
-    ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/heart200.png");
+    ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/green.png"));
+    ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/rect.png");
     QTRY_VERIFY(obj->status() == QSGImage::Ready);
     QTRY_VERIFY(obj->progress() == 1.0);
     QTRY_COMPARE(sourceSpy.count(), 4);