#include <dpl/wrt-dao-rw/widget_dao.h>
#include <dpl/wrt-dao-ro/wrt_db_types.h>
#include <dpl/string.h>
+#include <dpl/platform.h>
#include <wrt_plugin_export.h>
#include <LanguageTagsProvider.h>
{
TizenAppId tizenAppId;
Try {
- auto previous = WidgetDAO::getTizenAppidList();
+ auto previous = WidgetDAO::getTizenAppIdList();
// register widget
tizenAppId = WidgetDAO::registerWidgetGeneratePkgId(regInfo, sec);
RUNNER_ASSERT_MSG(!tizenAppId.empty(),
"(called from line " << line << ")");
- auto current = WidgetDAO::getTizenAppidList();
+ auto current = WidgetDAO::getTizenAppIdList();
RUNNER_ASSERT_MSG(previous.size() + 1 == current.size(),
"(called from line " << line << ")");
#define RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(in, test) \
{ \
- if (in.IsNull()) { RUNNER_ASSERT_MSG(false, "NULL"); } \
+ if (!in) { RUNNER_ASSERT_MSG(false, "NULL"); } \
else { RUNNER_ASSERT_WHAT_EQUALS(DPL::ToUTF8String(*in), test); } \
}
#define RUNNER_ASSERT_WHAT_EQUALS_OPTIONALINT(in, test) \
{ \
- if (in.IsNull()) { RUNNER_ASSERT_MSG(false, "NULL"); } \
+ if (!in) { RUNNER_ASSERT_MSG(false, "NULL"); } \
else { RUNNER_ASSERT_MSG(*in == test, "Equals: [" + *in + "]"); } \
}
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(dao.getAuthorName(), str.str());
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(dao.getAuthorEmail(), str.str());
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(dao.getAuthorHref(), str.str());
- RUNNER_ASSERT_WHAT_EQUALS(dao.getBaseFolder(), str.str() + "/");
- RUNNER_ASSERT(dao.getWebkitPluginsRequired() == false);
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(dao.getMinimumWacVersion(), "1.0");
}
}
WidgetRegisterInfo regInfo;
ConfigParserData::AppControlInfo appControl(DPL::FromUTF8String("operation"));
- appControl.m_disposition
- = ConfigParserData::AppControlInfo::Disposition::WINDOW;
appControl.m_mimeList.insert(DPL::FromUTF8String("mime"));
appControl.m_src = DPL::FromUTF8String("src");
appControl.m_uriList.insert(DPL::FromUTF8String("uri"));
&& appRefIt != appControlListRef.end();
++appDBIt, ++appRefIt)
{
- RUNNER_ASSERT((WidgetAppControl::Disposition)
- appRefIt->m_disposition == appDBIt->disposition);
- RUNNER_ASSERT(appRefIt->m_index == appDBIt->index);
RUNNER_ASSERT(appRefIt->m_operation == appDBIt->operation);
RUNNER_ASSERT(appRefIt->m_src == appDBIt->src);
for(auto it = appRefIt->m_mimeList.begin();
RUNNER_TEST(widget_dao_test_unregister_widget)
{
WacSecurityMock sec;
- TizenAppIdList ids = WidgetDAO::getTizenAppidList();
+ TizenAppIdList ids = WidgetDAO::getTizenAppIdList();
WidgetRegisterInfo regInfo;
WidgetDAO::unregisterWidget(tizenAppId);
- RUNNER_ASSERT_MSG(ids.size() == WidgetDAO::getTizenAppidList().size(),
+ RUNNER_ASSERT_MSG(ids.size() == WidgetDAO::getTizenAppIdList().size(),
"Widget unregister failed");
}
/*
* Name: widget_dao_test_get_widget_tizenAppId_list
- * Description: Tests getTizenAppidList API for backendlib
+ * Description: Tests getTizenAppIdList API for backendlib
* Expected: For all position in database should be returned one item in list
*/
RUNNER_TEST(widget_dao_test_get_widget_tizenAppId_list)
{
- TizenAppIdList tizenAppIds = WidgetDAO::getTizenAppidList();
+ TizenAppIdList tizenAppIds = WidgetDAO::getTizenAppIdList();
RUNNER_ASSERT(tizenAppIds.size() >= 3);
}
/*
* Name: widget_dao_test_get_widget_list
- * Description: Tests getTizenAppidList API for backendlib
+ * Description: Tests getTizenAppIdList API for backendlib
* Expected: For all position in database should be returned one item in list
* Those item should contain valid tizenAppId
*/
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(dao.getAuthorEmail(),
"a_email_2000");
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(dao.getAuthorHref(), "a_href_2000");
- RUNNER_ASSERT_WHAT_EQUALS(dao.getBaseFolder(), "basef_2000/");
- RUNNER_ASSERT(dao.getWebkitPluginsRequired() == true);
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(dao.getMinimumWacVersion(), "1.0");
}
}
TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
WidgetDAO dao(tizenAppId);
- RUNNER_ASSERT_MSG(dao.getCspPolicy().IsNull(), "Policy is not null");
+ RUNNER_ASSERT_MSG(!dao.getCspPolicy(), "Policy is not null");
}
}
RUNNER_TEST(widget_dao_test_widget_appcontrolinfo_basics)
{
ConfigParserData::AppControlInfo a(DPL::FromUTF8String("operation"));
- a.m_disposition = ConfigParserData::AppControlInfo::Disposition::WINDOW;
a.m_mimeList.insert(DPL::FromUTF8String("mime"));
a.m_src = DPL::FromUTF8String("src");
a.m_uriList.insert(DPL::FromUTF8String("uri"));
ConfigParserData::AppControlInfo a0(DPL::FromUTF8String("operation1"));
- a0.m_disposition = ConfigParserData::AppControlInfo::Disposition::WINDOW;
a0.m_mimeList.insert(DPL::FromUTF8String("mime"));
a0.m_src = DPL::FromUTF8String("src");
a0.m_uriList.insert(DPL::FromUTF8String("uri"));
ConfigParserData::AppControlInfo a1(DPL::FromUTF8String("operation"));
- a1.m_disposition = ConfigParserData::AppControlInfo::Disposition::UNDEFINE;
a1.m_mimeList.insert(DPL::FromUTF8String("mime"));
a1.m_src = DPL::FromUTF8String("src");
a1.m_uriList.insert(DPL::FromUTF8String("uri"));
ConfigParserData::AppControlInfo a2(DPL::FromUTF8String("operation"));
- a2.m_disposition = ConfigParserData::AppControlInfo::Disposition::WINDOW;
a2.m_mimeList.insert(DPL::FromUTF8String("mime1"));
a2.m_src = DPL::FromUTF8String("src");
a2.m_uriList.insert(DPL::FromUTF8String("uri"));
ConfigParserData::AppControlInfo a3(DPL::FromUTF8String("operation"));
- a3.m_disposition = ConfigParserData::AppControlInfo::Disposition::WINDOW;
a3.m_mimeList.insert(DPL::FromUTF8String("mime"));
a3.m_src = DPL::FromUTF8String("src1");
a3.m_uriList.insert(DPL::FromUTF8String("uri"));
ConfigParserData::AppControlInfo a4(DPL::FromUTF8String("operation"));
- a4.m_disposition = ConfigParserData::AppControlInfo::Disposition::WINDOW;
a4.m_mimeList.insert(DPL::FromUTF8String("mime"));
a4.m_src = DPL::FromUTF8String("src");
a4.m_uriList.insert(DPL::FromUTF8String("uri1"));
ConfigParserData::AppControlInfo a5(DPL::FromUTF8String("operation"));
- a5.m_disposition = ConfigParserData::AppControlInfo::Disposition::WINDOW;
a5.m_mimeList.insert(DPL::FromUTF8String("mime"));
a5.m_src = DPL::FromUTF8String("src");
a5.m_uriList.insert(DPL::FromUTF8String("uri"));
RUNNER_ASSERT_MSG(a == a, "app control info equal");
}
+#if USE(WEB_PROVIDER)
/*
* Name: widget_dao_test_widget_metadata_basics
* Description: Tests basic operators for livebox info
RUNNER_ASSERT_MSG(a10 != a11, "livebox info not equal");
RUNNER_ASSERT_MSG(a10 == a12, "livebox info equal");
}
-
+#endif
/*
* Name: widget_dao_test_get_widget_by_guid
* Description: Tests creating WidgetDAO using GUID
TizenAppId originaltizenAppId = REGISTER_WIDGET(regInfo, sec);
TizenAppId changedTizenAppId = L"changedTizenAppId";
- TizenAppIdList ids = WidgetDAO::getTizenAppidList();
+ TizenAppIdList ids = WidgetDAO::getTizenAppIdList();
RUNNER_ASSERT(std::count(ids.begin(),ids.end(),originaltizenAppId) == 1);
//Change tizenAppId
WidgetDAO dao(originaltizenAppId);
dao.setTizenAppId(changedTizenAppId);
- ids = WidgetDAO::getTizenAppidList();
+ ids = WidgetDAO::getTizenAppIdList();
RUNNER_ASSERT(std::count(ids.begin(), ids.end(), originaltizenAppId) == 0);
RUNNER_ASSERT(std::count(ids.begin(), ids.end(), changedTizenAppId) == 1);
RUNNER_ASSERT(exceptionCaught);
WidgetDAO::unregisterWidget(changedTizenAppId);
- ids = WidgetDAO::getTizenAppidList();
+ ids = WidgetDAO::getTizenAppIdList();
RUNNER_ASSERT(std::count(ids.begin(),ids.end(),originaltizenAppId) == 0);
RUNNER_ASSERT(std::count(ids.begin(),ids.end(),changedTizenAppId) == 0);
RUNNER_ASSERT(std::count(locationList.begin(), locationList.end(), "location2") == 1);
}
+#if USE(WEB_PROVIDER)
+/*
+ * Name: widget_dao_test_register_widget_liveboxID
+ * Description: Tests registeration of liveboxID
+ * Expected: values received by dao should match those which were registered
+ * for icon
+ */
+RUNNER_TEST(widget_dao_test_register_widget_liveboxID)
+{
+ WacSecurityMock sec;
+ WidgetRegisterInfo regInfo;
+
+ ConfigParserData::LiveboxInfo liveboxInfo1;
+ liveboxInfo1.m_liveboxId = DPL::FromUTF8String("pkgID.dynamicBoxID");
+ ConfigParserData::LiveboxInfo liveboxInfo2;
+ liveboxInfo2.m_liveboxId = DPL::FromUTF8String("pkgID.dynamicBoxID");
+ ConfigParserData::LiveboxInfo liveboxInfo3;
+ liveboxInfo3.m_liveboxId = DPL::FromUTF8String("pkgID.dynamicBoxID");
+
+ regInfo.configInfo.m_livebox.push_back(liveboxInfo1);
+ regInfo.configInfo.m_livebox.push_back(liveboxInfo2);
+ regInfo.configInfo.m_livebox.push_back(liveboxInfo3);
+
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
+
+ WidgetDAOReadOnly dao(tizenAppId);
+ WrtDB::WidgetDAOReadOnly::LiveBoxIdList outLiveBoxIdList;
+ dao.getLiveBoxInfoList(outLiveBoxIdList);
+
+ RUNNER_ASSERT_MSG(outLiveBoxIdList.size() == 3, "list size is OK");
+ FOREACH(it, outLiveBoxIdList){
+ RUNNER_ASSERT_MSG(DPL::ToUTF8String(**it) == "pkgID.dynamicBoxID", "liveBox Name is equal");
+ }
+}
+#endif
/*
* Name: widget_dao_test_get_tz_app_id
* Description: Tests getTizenAppId functions
{
WidgetDAOReadOnly dao(L"tizenid201");
- RUNNER_ASSERT(dao.getPropertyValue(L"key1_for_2000") == L"value_for_key1_2000");
- RUNNER_ASSERT(dao.getPropertyValue(L"key2_for_2000") == L"value_for_key2_2000");
- RUNNER_ASSERT(dao.getPropertyValue(L"not_existing").IsNull());
- RUNNER_ASSERT(dao.getPropertyValue(L"").IsNull());
+ RUNNER_ASSERT(dao.getPropertyValue(L"key1_for_2000") ==
+ PropertyDAOReadOnly::WidgetPropertyValue(L"value_for_key1_2000"));
+ RUNNER_ASSERT(dao.getPropertyValue(L"key2_for_2000") ==
+ PropertyDAOReadOnly::WidgetPropertyValue(L"value_for_key2_2000"));
+ RUNNER_ASSERT(!dao.getPropertyValue(L"not_existing"));
+ RUNNER_ASSERT(!dao.getPropertyValue(L""));
}
/*
RUNNER_ASSERT(dao.checkPropertyReadFlag(L"key1_for_2000") == 0);
RUNNER_ASSERT(dao.checkPropertyReadFlag(L"key2_for_2000") == 0);
- RUNNER_ASSERT(dao.checkPropertyReadFlag(L"not_existing").IsNull());
- RUNNER_ASSERT(dao.checkPropertyReadFlag(L"").IsNull());
+ RUNNER_ASSERT(!dao.checkPropertyReadFlag(L"not_existing"));
+ RUNNER_ASSERT(!dao.checkPropertyReadFlag(L""));
}
/*