@@ -19,6 +19,7 @@
1919
2020#include <UnityCore/Preview.h>
2121#include <UnityCore/GLibWrapper.h>
22+#include <UnityCore/Variant.h>
2223#include <unity-protocol.h>
2324
2425#include "genericpreview.h"
@@ -48,7 +49,23 @@ void PreviewBindingsTest::testGenericPreview()
4849 UNITY_PROTOCOL_LAYOUT_HINT_LEFT);
4950 unity::glib::Object<GObject> genPrv(rawPreview);
5051
52+ // create local result
53+ unity::glib::HintsMap hints;
54+ hints["a"] = unity::glib::Variant(g_variant_new_string("b"));
55+ unity::dash::LocalResult localResult;
56+ localResult.uri = "http://foo";
57+ localResult.icon_hint = "xyz";
58+ localResult.category_index = 1;
59+ localResult.result_type = 2;
60+ localResult.mimetype = "abc";
61+ localResult.name = "baz";
62+ localResult.comment = "qwerty";
63+ localResult.dnd_uri = "zzz";
64+ localResult.hints = hints;
65+
5166 auto corePrv = unity::dash::Preview::PreviewForProtocolObject(genPrv);
67+ corePrv->preview_result = localResult;
68+
5269 auto prv = Preview::newFromUnityPreview(corePrv);
5370
5471 QCOMPARE(prv != nullptr, true);
@@ -64,6 +81,16 @@ void PreviewBindingsTest::testGenericPreview()
6481 QCOMPARE(act->displayName(), QString("Action1"));
6582 QCOMPARE(act->iconHint(), QString("/foo.png"));
6683
84+ Result* res = prv->result().value<Result*>();
85+ QCOMPARE(res->uri(), QString("http://foo"));
86+ QCOMPARE(res->iconHint(), QString("xyz"));
87+ QCOMPARE(res->categoryIndex(), 1u);
88+ QCOMPARE(res->resultType(), 2u);
89+ QCOMPARE(res->mimeType(), QString("abc"));
90+ QCOMPARE(res->title(), QString("baz"));
91+ QCOMPARE(res->dndUri(), QString("zzz"));
92+ QCOMPARE(res->metadata().toHash()["a"].toString(), QString("b"));
93+
6794 g_object_unref(icon);
6895 g_object_unref(iconFile);
6996}