};
-WidgetPkgName _registerWidget(const WidgetRegisterInfo& regInfo,
+TizenAppId _registerWidget(const WidgetRegisterInfo& regInfo,
const IWacSecurity& sec,
int line)
{
- WidgetPkgName pkgname;
+ TizenAppId tizenAppId;
Try {
- auto previous = WidgetDAO::getPkgnameList();
+ auto previous = WidgetDAO::getTizenAppidList();
// register widget
- pkgname = WidgetDAO::registerWidgetGenerateTizenId(regInfo, sec);
+ tizenAppId = WidgetDAO::registerWidgetGeneratePkgId(regInfo, sec);
- RUNNER_ASSERT_MSG(!pkgname.empty(),
+ RUNNER_ASSERT_MSG(!tizenAppId.empty(),
"(called from line " << line << ")");
- auto current = WidgetDAO::getPkgnameList();
+ auto current = WidgetDAO::getTizenAppidList();
RUNNER_ASSERT_MSG(previous.size()+1 == current.size(),
"(called from line " << line << ")");
- RUNNER_ASSERT_MSG(WidgetDAO::isWidgetInstalled(pkgname),
- "(called from line " << line << " pkgname: " << pkgname << ")");
+ RUNNER_ASSERT_MSG(WidgetDAO::isWidgetInstalled(tizenAppId),
+ "(called from line " << line << " tizenAppId: " << tizenAppId << ")");
}
Catch (WidgetDAO::Exception::AlreadyRegistered) {
RUNNER_ASSERT_MSG(
false,
"Unexpected exception (called from line " << line << ")");
}
- return pkgname;
+ return tizenAppId;
}
#define REGISTER_WIDGET(regInfo, sec) _registerWidget((regInfo),(sec), __LINE__)
WacSecurityMock sec;
const std::size_t NUMBER_OF_WIDGETS = 5;
- WidgetPkgName lastPkgname;
+ TizenAppId lastTizenAppId;
for (std::size_t number = 0; number < NUMBER_OF_WIDGETS; ++number)
{
WidgetRegisterInfo regInfo;
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- lastPkgname = pkgname;
+ lastTizenAppId = tizenAppId;
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
//TODO check nulls
}
}
regInfo.minVersion = DPL::FromUTF8String("1.0");
regInfo.configInfo.backSupported = true;
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(dao.getGUID(), str.str());
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(dao.getVersion(), str.str());
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(dao.getAuthorName(), str.str());
// regInfo.shareHref = str.str();
regInfo.configInfo.backgroundPage = L"background.html";
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
// RUNNER_ASSERT_WHAT_EQUALS(dao.GetShareHref(), str.str());
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(dao.getBackgroundPage(),
std::make_pair(DPL::FromUTF8String("pl"),locDataPl));
}
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
RUNNER_ASSERT_MSG(dao.getLanguageTags().size() == 2,
"language tags list invalid");
WidgetRegisterInfo::LocalizedIcon locIcon(icon,locs);
regInfo.localizationData.icons.push_back(locIcon);
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
WidgetDAOReadOnly::WidgetIconList list = dao.getIconList();
RUNNER_ASSERT(list.size() == regInfo.localizationData.icons.size());
FOREACH(it, features)
regInfo.configInfo.featuresList.insert(*it);
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
WidgetFeatureSet out = dao.getFeaturesList();
RUNNER_ASSERT_MSG(out.size() == features.size(),
"wrong number of features");
{
WacSecurityMock sec;
WidgetRegisterInfo regInfo;
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
RUNNER_ASSERT_MSG(dao.getSecurityPopupUsage() == WrtDB::SETTINGS_TYPE_ON, "SecurityPopupUsage is not deafult on");
RUNNER_ASSERT_MSG(dao.getGeolocationUsage() == WrtDB::SETTINGS_TYPE_ON, "GeolocationUsage is not deafult on");
RUNNER_ASSERT_MSG(dao.getWebNotificationUsage() == WrtDB::SETTINGS_TYPE_ON, "WebNotificationUsage is not deafult on");
FOREACH(it, modes)
regInfo.configInfo.windowModes.insert(*it);
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
std::list<DPL::String> wins = dao.getWindowModes();
RUNNER_ASSERT_MSG(modes.size() == wins.size(),
"wrong number of window modes");
FOREACH(it, orig)
regInfo.configInfo.accessInfoSet.insert(*it);
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
WidgetAccessInfoList out;
dao.getWidgetAccessInfo(out);
certListRef.push_back(cert);
// register widget
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
// certificates
WidgetCertificateDataList recList = dao.getCertificateDataList();
WacSecurityMock sec;
WidgetRegisterInfo regInfo;
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- RUNNER_ASSERT(WidgetDAO::isWidgetInstalled(pkgname));
+ RUNNER_ASSERT(WidgetDAO::isWidgetInstalled(tizenAppId));
}
/*
WidgetRegisterInfo regInfo;
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO::unregisterWidget(pkgname);
+ WidgetDAO::unregisterWidget(tizenAppId);
RUNNER_ASSERT_MSG(handles.size() == WidgetDAO::getHandleList().size(),
"Widget unregister failed");
regInfo2.configInfo.version = L"1.1";
regInfo2.configInfo.authorName = L"BBB";
- WrtDB::WidgetPkgName pkgname(L"abcdefghij");
+ WrtDB::TizenAppId tizenAppId(L"abcdefghij");
//first installation
- WidgetDAO::registerWidget(pkgname, regInfo, sec);
- RUNNER_ASSERT_MSG(WidgetDAO::isWidgetInstalled(pkgname), "Widget is not registered");
+ WidgetDAO::registerWidget(tizenAppId, regInfo, sec);
+ RUNNER_ASSERT_MSG(WidgetDAO::isWidgetInstalled(tizenAppId), "Widget is not registered");
//success full update
- WidgetDAO::registerOrUpdateWidget(pkgname, regInfo2, sec);
- RUNNER_ASSERT_MSG(WidgetDAO::isWidgetInstalled(pkgname), "Widget is not reregistered");
- WidgetDAO dao(pkgname);
+ WidgetDAO::registerOrUpdateWidget(tizenAppId, regInfo2, sec);
+ RUNNER_ASSERT_MSG(WidgetDAO::isWidgetInstalled(tizenAppId), "Widget is not reregistered");
+ WidgetDAO dao(tizenAppId);
RUNNER_ASSERT_MSG(*dao.getVersion() == L"1.1", "Data widget was not updated");
RUNNER_ASSERT_MSG(*dao.getAuthorName() == L"BBB", "Data widget was not updated");
- WidgetDAO::unregisterWidget(pkgname);
+ WidgetDAO::unregisterWidget(tizenAppId);
}
/*
-Name: widget_dao_test_get_widget_pkgname_list
-Description: Tests getPkgnameList API for backendlib
+Name: widget_dao_test_get_widget_tizenAppId_list
+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_pkgname_list)
+RUNNER_TEST(widget_dao_test_get_widget_tizenAppId_list)
{
- WidgetPkgNameList pkgnames = WidgetDAO::getPkgnameList();
- RUNNER_ASSERT(pkgnames.size() >= 3);
+ TizenAppIdList tizenAppIds = WidgetDAO::getTizenAppidList();
+ RUNNER_ASSERT(tizenAppIds.size() >= 3);
}
/*
Name: widget_dao_test_get_widget_list
-Description: Tests getPkgnameList 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 pkgname
+ Those item should contain valid tizenAppId
*/
RUNNER_TEST(widget_dao_test_get_widget_list)
{
RUNNER_TEST(widget_dao_test_get_widget_attributes)
{
{
- WidgetPkgName pkgname = L"tizenid201";
- WidgetDAO dao(pkgname);
+ TizenAppId tizenAppId = L"tizenid201";
+ WidgetDAO dao(tizenAppId);
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(dao.getGUID(), "w_id_2000");
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(dao.getVersion(), "1.0.0");
regInfo.localizationData.startFiles.push_back(file);
// register widget
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ WidgetDAO dao(tizenAppId);
// check localized icons
WidgetDAO::WidgetLocalizedIconList locList = dao.getLocalizedIconList();
WidgetRegisterInfo regInfo;
{
// register widget
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
+ WidgetDAO dao(tizenAppId);
RUNNER_ASSERT(!dao.isDistributorSigned());
RUNNER_ASSERT(!dao.isRecognized());
sec.setWacSigned(true);
{
// register widget
- WidgetPkgName pkgname = REGISTER_WIDGET(regInfo, sec);
- WidgetDAO dao(pkgname);
+ TizenAppId tizenAppId = REGISTER_WIDGET(regInfo, sec);
+ WidgetDAO dao(tizenAppId);
RUNNER_ASSERT(dao.isDistributorSigned());
RUNNER_ASSERT(dao.isRecognized());
#Widgets
INS_ALL_WIDGETEXT="insert into WidgetExtendedInfo(app_id, share_href, signature_type)"
- INS_ALL_WIDGET="insert into WidgetInfo(app_id, widget_id, widget_version, widget_width, widget_height, author_name, author_email, author_href, base_folder, webkit_plugins_required, recognized, wac_signed, distributor_signed, min_version, pkgname)"
+ INS_ALL_WIDGET="insert into WidgetInfo(app_id, widget_id, widget_version, widget_width, widget_height, author_name, author_email, author_href, base_folder, webkit_plugins_required, recognized, wac_signed, distributor_signed, min_version, tizen_appid)"
INS_ALL_WIDGET_LOC="insert into LocalizedWidgetInfo(app_id, widget_locale, widget_name, widget_shortname, widget_description, widget_license, widget_license_file, widget_license_href)"
INS_ALL_WIDGET_ICONS="insert into WidgetIcon(app_id, icon_src, icon_width, icon_height)"
INS_ALL_WIDGET_LOC_ICONS="insert into WidgetLocalizedIcon(app_id, icon_id, widget_locale)"
INS_ALL_WIDGET_STARTFILE="insert into WidgetStartFile(app_id, src)"
INS_ALL_WIDGET_LOC_STARTFILE="insert into WidgetLocalizedStartFile(app_id, start_file_id, widget_locale, type, encoding)"
INS_ALL_WIDGET_DEFPREF="insert into WidgetDefaultPreference(app_id, key_name, key_value, readonly)"
- INS_ALL_WIDGET_PREF="insert into WidgetPreference(pkgname, key_name, key_value, readonly)"
+ INS_ALL_WIDGET_PREF="insert into WidgetPreference(tizen_appid, key_name, key_value, readonly)"
INS_ALL_WIDGET_FEATURE="insert into WidgetFeature(app_id, name, required)"
INS_ALL_WIDGET_FEATURE_PARAM="insert into FeatureParam(widget_feature_id, name, value)"
INS_ALL_WIDGET_WINMODES="insert into WidgetWindowModes(app_id, window_mode)"
sqlite3 $WRT_DB "${INS_ALL_WIDGET} VALUES(2000, 'w_id_2000', '1.0.0', 100, 200, 'a_name_2000', 'a_email_2000', 'a_href_2000', 'basef_2000', 1, 1, 1, 1, '1.0', 'tizenid201')";
sqlite3 $WRT_DB "${INS_ALL_WIDGET} VALUES(2001, 'w_id_2001', '2.0.0', 100, 200, 'a_name_2001', 'a_email_2001', 'a_href_2001', 'basef_2001', 1, 1, 1, 1, '0.5', 'tizenid202')";
- sqlite3 $WRT_DB "insert into WidgetInfo(app_id, back_supported, pkgname) VALUES(2002, 0, 'tizenid203')";
- sqlite3 $WRT_DB "insert into WidgetInfo(app_id, back_supported, pkgname) VALUES(2003, 0, 'tizenid204')"; # for properties tests
+ sqlite3 $WRT_DB "insert into WidgetInfo(app_id, back_supported, tizen_appid) VALUES(2002, 0, 'tizenid203')";
+ sqlite3 $WRT_DB "insert into WidgetInfo(app_id, back_supported, tizen_appid) VALUES(2003, 0, 'tizenid204')"; # for properties tests
sqlite3 $WRT_DB "${INS_ALL_WIDGETEXT} VALUES(2000, 'share_href_2000', 0)";
sqlite3 $WRT_DB "${INS_ALL_WIDGETEXT} VALUES(2001, 'share_href_2001', 0)";
sqlite3 $WRT_DB "${INS_ALL_WIDGET_PREF} VALUES('tizenid203', 'key2_for_2002', 'value2_for_key_2002', 1)";
#create if not exists and fix autoincrement value
- sqlite3 $WRT_DB "INSERT INTO WidgetInfo(pkgname) VALUES('temp')";
- sqlite3 $WRT_DB "DELETE FROM WidgetInfo WHERE pkgname = 'temp'";
+ sqlite3 $WRT_DB "INSERT INTO WidgetInfo(tizen_appid) VALUES('temp')";
+ sqlite3 $WRT_DB "DELETE FROM WidgetInfo WHERE tizen_appid = 'temp'";
sqlite3 $WRT_DB "UPDATE sqlite_sequence SET seq = 2004 WHERE name = 'WidgetInfo'";
exit $?