homescreenapp/hshomescreenclientplugin/tsrc/t_hshomescreenclientplugin/src/t_hshomescreenclientplugin.cpp
--- a/homescreenapp/hshomescreenclientplugin/tsrc/t_hshomescreenclientplugin/src/t_hshomescreenclientplugin.cpp Fri Apr 16 14:54:01 2010 +0300
+++ b/homescreenapp/hshomescreenclientplugin/tsrc/t_hshomescreenclientplugin/src/t_hshomescreenclientplugin.cpp Mon May 03 12:24:59 2010 +0300
@@ -85,4 +85,43 @@
delete client;
}
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void HsHomescreenClientPluginTest::testSetWallpaper()
+{
+ HsHomescreenClient *client = new HsHomescreenClient;
+
+ QSignalSpy requestFinishedSpy(client, SIGNAL(requestFinished()));
+
+ bool result = client->setWallpaper("wallpaper");
+
+ // but emit correct signals
+ connect(this, SIGNAL(onRequestCompletedTest(QVariant)), client, SLOT(onRequestCompleted(QVariant)));
+ emit onRequestCompletedTest(true);
+
+ QVERIFY(requestFinishedSpy.count());
+ QVERIFY(client->mRequestResult);
+
+ delete client;
+}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void HsHomescreenClientPluginTest::testOnRequestError()
+{
+ HsHomescreenClient *client = new HsHomescreenClient;
+
+ QSignalSpy requestFinishedSpy(client, SIGNAL(requestFinished()));
+
+ client->onRequestError(-1);
+
+ QVERIFY(requestFinishedSpy.count());
+ QVERIFY(!client->mRequestResult);
+
+ delete client;
+}
+
+
QTEST_MAIN(HsHomescreenClientPluginTest)