From ed92a8de6b4dbcede652a881201001b65d2103d3 Mon Sep 17 00:00:00 2001 From: Arkadiusz Szulakiewicz Date: Tue, 1 Mar 2016 13:17:17 +0100 Subject: [PATCH 01/16] Add tests for Application element in config.xml Change-Id: I195ed3e15dff2655327ec0a12064c701427f2220 --- src/unit_tests/manifest_test.cc | 65 ++++++++++++++++++++++ .../config.xml | 4 ++ .../config.xml | 4 ++ .../config.xml | 4 ++ .../config.xml | 5 ++ .../config.xml | 4 ++ .../config.xml | 4 ++ .../config.xml | 4 ++ .../config.xml | 4 ++ .../config.xml | 4 ++ .../config.xml | 4 ++ 11 files changed, 106 insertions(+) create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidAppId/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidPackage/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidVersion/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ManyElements/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingAppId/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingPackage/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingVersion/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidAppId/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidPackage/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidVersion/config.xml diff --git a/src/unit_tests/manifest_test.cc b/src/unit_tests/manifest_test.cc index 81358bd..ec3e1c2 100644 --- a/src/unit_tests/manifest_test.cc +++ b/src/unit_tests/manifest_test.cc @@ -106,4 +106,69 @@ TEST_F(ManifestTest, WidgetElement_ManyNamespaces) { ASSERT_FALSE(runner.Run()); } +TEST_F(ManifestTest, ApplicationElement_ManyElements) { + StepParseRunner runner(GetMyName()); + ASSERT_FALSE(runner.Run()); +} + +TEST_F(ManifestTest, ApplicationElement_ValidAppId) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + ASSERT_NE(app, nullptr); + ASSERT_CSTR_EQ(app->appid, "package0id.appid"); +} + +TEST_F(ManifestTest, ApplicationElement_MissingAppId) { + StepParseRunner runner(GetMyName()); + ASSERT_FALSE(runner.Run()); +} + +TEST_F(ManifestTest, ApplicationElement_InvalidAppId) { + StepParseRunner runner(GetMyName()); + ASSERT_FALSE(runner.Run()); +} + +TEST_F(ManifestTest, ApplicationElement_ValidPackage) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + ASSERT_CSTR_EQ(m->package, "package0id"); +} + +TEST_F(ManifestTest, ApplicationElement_InvalidPackage) { + StepParseRunner runner(GetMyName()); + ASSERT_FALSE(runner.Run()); +} + +TEST_F(ManifestTest, ApplicationElement_MissingPackage) { + StepParseRunner runner(GetMyName()); + ASSERT_FALSE(runner.Run()); +} + +TEST_F(ManifestTest, ApplicationElement_ValidVersion) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + ASSERT_CSTR_EQ(m->api_version, "3.0"); +} + +TEST_F(ManifestTest, ApplicationElement_InvalidVersion) { + StepParseRunner runner(GetMyName()); + ASSERT_FALSE(runner.Run()); +} + +TEST_F(ManifestTest, ApplicationElement_MissingVersion) { + StepParseRunner runner(GetMyName()); + ASSERT_FALSE(runner.Run()); +} + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidAppId/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidAppId/config.xml new file mode 100644 index 0000000..e0a53e1 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidAppId/config.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidPackage/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidPackage/config.xml new file mode 100644 index 0000000..671c8e0 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidPackage/config.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidVersion/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidVersion/config.xml new file mode 100644 index 0000000..0edbe47 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidVersion/config.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ManyElements/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ManyElements/config.xml new file mode 100644 index 0000000..c4cd426 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ManyElements/config.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingAppId/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingAppId/config.xml new file mode 100644 index 0000000..80a23d3 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingAppId/config.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingPackage/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingPackage/config.xml new file mode 100644 index 0000000..2e8076c --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingPackage/config.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingVersion/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingVersion/config.xml new file mode 100644 index 0000000..8e328b7 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingVersion/config.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidAppId/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidAppId/config.xml new file mode 100644 index 0000000..14d024a --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidAppId/config.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidPackage/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidPackage/config.xml new file mode 100644 index 0000000..14d024a --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidPackage/config.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidVersion/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidVersion/config.xml new file mode 100644 index 0000000..14d024a --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidVersion/config.xml @@ -0,0 +1,4 @@ + + + + -- 2.7.4 From 251d33933637501b858da5ce0726588fc32834d2 Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Thu, 25 Feb 2016 10:26:51 +0100 Subject: [PATCH 02/16] Adjust moving storage directories - 'shared/' -> 'shared/res/' Requirement changed. We need to copy only 'shared/res/'. To verify install, update, uninstall wgt package that contains files in /shared/res/ and check if they were moved properly to install location's shared/res/. Change-Id: I20b8fcc174423ce74dcba5c9f6c116b1443f452e --- src/wgt/step/step_wgt_patch_storage_directories.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/wgt/step/step_wgt_patch_storage_directories.cc b/src/wgt/step/step_wgt_patch_storage_directories.cc index c6a7a94..e6f976e 100644 --- a/src/wgt/step/step_wgt_patch_storage_directories.cc +++ b/src/wgt/step/step_wgt_patch_storage_directories.cc @@ -16,6 +16,7 @@ namespace bs = boost::system; namespace { const char kSharedLocation[] = "shared"; +const char kSharedResLocation[] = "shared/res"; const char kResWgtSubPath[] = "res/wgt"; const char kTemporaryData[] = "tmp"; @@ -39,8 +40,19 @@ common_installer::Step::Status StepWgtPatchStorageDirectories::process() { } bool StepWgtPatchStorageDirectories::ShareDirFor3x() { - bf::path src = context_->pkg_path.get() / kResWgtSubPath / kSharedLocation; - bf::path dst = context_->pkg_path.get() / kSharedLocation; + bf::path shared_dir = context_->pkg_path.get() / kSharedLocation; + if (!bf::exists(shared_dir)) { + bs::error_code error; + bf::create_directory(shared_dir); + if (error) { + LOG(ERROR) << "Failed to create directory: " << shared_dir; + return false; + } + } + bf::path src = context_->pkg_path.get() / kResWgtSubPath / kSharedResLocation; + if (!bf::exists(src)) + return true; + bf::path dst = context_->pkg_path.get() / kSharedResLocation; if (!common_installer::MoveDir(src, dst, common_installer::FS_MERGE_DIRECTORIES)) { LOG(ERROR) << "Failed to move shared data from res/wgt to shared"; -- 2.7.4 From a6026597c314561e39ff7b94f928e4559628a8cc Mon Sep 17 00:00:00 2001 From: Arkadiusz Szulakiewicz Date: Tue, 1 Mar 2016 14:39:21 +0100 Subject: [PATCH 03/16] Add tests for Privilege element in config.xml Change-Id: Ic0bd88aa5fa8c7024d2756cea9ec84dfd6d0c9fd --- src/unit_tests/manifest_test.cc | 42 ++++++++++++++++++++++ .../config.xml | 5 +++ .../config.xml | 6 ++++ .../config.xml | 5 +++ .../config.xml | 5 +++ 5 files changed, 63 insertions(+) create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_InvalidName/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_ManyElements/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_MissingName/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_ValidName/config.xml diff --git a/src/unit_tests/manifest_test.cc b/src/unit_tests/manifest_test.cc index ec3e1c2..e705cac 100644 --- a/src/unit_tests/manifest_test.cc +++ b/src/unit_tests/manifest_test.cc @@ -13,6 +13,7 @@ #include #include +#include #include "wgt/step/step_parse.h" #include "wgt/wgt_backend_data.h" @@ -168,7 +169,48 @@ TEST_F(ManifestTest, ApplicationElement_MissingVersion) { ASSERT_FALSE(runner.Run()); } +TEST_F(ManifestTest, PrivilegeElement_ValidName) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + std::vector priv_vec; + for (const char* priv : GListRange(m->privileges)) { + priv_vec.push_back(priv); + } + ASSERT_FALSE(priv_vec.empty()); + const char* expected_name = "http://tizen.org/privilege/application.launch"; + ASSERT_CSTR_EQ(priv_vec[0].c_str(), expected_name); +} +TEST_F(ManifestTest, PrivilegeElement_ManyElements) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + std::vector priv_vec; + for (const char* priv : GListRange(m->privileges)) { + priv_vec.push_back(priv); + } + ASSERT_EQ(priv_vec.size(), 2); + const char* first_priv = "http://tizen.org/privilege/application.close"; + ASSERT_CSTR_EQ(priv_vec[0].c_str(), first_priv); + const char* second_priv = "http://tizen.org/privilege/application.launch"; + ASSERT_CSTR_EQ(priv_vec[1].c_str(), second_priv); +} +TEST_F(ManifestTest, PrivilegeElement_InvalidName) { + StepParseRunner runner(GetMyName()); + ASSERT_FALSE(runner.Run()); +} + +TEST_F(ManifestTest, PrivilegeElement_MissingName) { + StepParseRunner runner(GetMyName()); + ASSERT_FALSE(runner.Run()); +} diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_InvalidName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_InvalidName/config.xml new file mode 100644 index 0000000..6fb0b33 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_InvalidName/config.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_ManyElements/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_ManyElements/config.xml new file mode 100644 index 0000000..94fbcc1 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_ManyElements/config.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_MissingName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_MissingName/config.xml new file mode 100644 index 0000000..a9defae --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_MissingName/config.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_ValidName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_ValidName/config.xml new file mode 100644 index 0000000..f4ff663 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_ValidName/config.xml @@ -0,0 +1,5 @@ + + + + + -- 2.7.4 From 879048abb2f7c3c643905d13908703850fe368e0 Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Wed, 24 Feb 2016 09:33:50 +0100 Subject: [PATCH 04/16] Processing watch application from config.xml Writes information about wgt's watch application to manifest_x and adds it to generated platform xml in wgt-backend. In tizen 2.x watch-application was not registered by wgt-installer AT ALL. This was done libwatch-application.so pkgmgr plugin parser. This behaviour should be probably removed so that only app-installer insert data into pkgmgr database. After this commit data of all applications (including watch-application) is added to pkgmgr_parser.db. Note that update installation of watch-application will work only when tizen-manifest.xml parsing changes will be introduced. Requires: - https://review.tizen.org/gerrit/#/c/60241/ Change-Id: I67f9cf1c04ecf435cfc90f5ab83d2ccebbc45a4a --- src/wgt/step/step_generate_xml.cc | 13 +++++++++++++ src/wgt/step/step_generate_xml.h | 3 ++- src/wgt/step/step_parse.cc | 31 +++++++++++++++++++++++++++---- src/wgt/step/step_parse.h | 2 +- 4 files changed, 43 insertions(+), 6 deletions(-) diff --git a/src/wgt/step/step_generate_xml.cc b/src/wgt/step/step_generate_xml.cc index 71d956f..176c908 100644 --- a/src/wgt/step/step_generate_xml.cc +++ b/src/wgt/step/step_generate_xml.cc @@ -87,6 +87,13 @@ void WriteWidgetApplicationAttributes( BAD_CAST app->multiple); } +void WriteWatchApplicationAttributes( + xmlTextWriterPtr writer, application_x *app) { + if (app->ambient_support) + xmlTextWriterWriteAttribute(writer, BAD_CAST "ambient-support", + BAD_CAST app->ambient_support); +} + } // namespace namespace wgt { @@ -120,6 +127,9 @@ common_installer::Step::Status StepGenerateXml::GenerateApplicationCommonXml( case AppCompType::WIDGETAPP: WriteWidgetApplicationAttributes(writer, app); break; + case AppCompType::WATCHAPP: + WriteWatchApplicationAttributes(writer, app); + break; } for (label_x* label : GListRange(app->label)) { @@ -338,6 +348,9 @@ common_installer::Step::Status StepGenerateXml::process() { } else if (strcmp(app->component_type, "widgetapp") == 0) { type = AppCompType::WIDGETAPP; xmlTextWriterStartElement(writer, BAD_CAST "widget-application"); + } else if (strcmp(app->component_type, "watchapp") == 0) { + type = AppCompType::WATCHAPP; + xmlTextWriterStartElement(writer, BAD_CAST "watch-application"); } else { LOG(ERROR) << "Unknown application component_type"; xmlFreeTextWriter(writer); diff --git a/src/wgt/step/step_generate_xml.h b/src/wgt/step/step_generate_xml.h index 5351991..0f62498 100644 --- a/src/wgt/step/step_generate_xml.h +++ b/src/wgt/step/step_generate_xml.h @@ -29,7 +29,8 @@ class StepGenerateXml : public common_installer::Step { enum class AppCompType { UIAPP, SVCAPP, - WIDGETAPP + WIDGETAPP, + WATCHAPP }; Step::Status GenerateApplicationCommonXml(application_x* app, diff --git a/src/wgt/step/step_parse.cc b/src/wgt/step/step_parse.cc index cb77e28..935b303 100644 --- a/src/wgt/step/step_parse.cc +++ b/src/wgt/step/step_parse.cc @@ -43,6 +43,10 @@ namespace bf = boost::filesystem; namespace { +const char kCategoryWearableClock[] = + "http://tizen.org/category/wearable_clock"; +const char kCategoryWatchClock[] = "com.samsung.wmanager.WATCH_CLOCK"; + const std::string kManifestVersion = "1.0.0"; const char kTizenPackageXmlNamespace[] = "http://tizen.org/ns/packages"; @@ -60,7 +64,6 @@ GList* GenerateMetadataListX(const wgt::parse::MetaDataInfo& meta_info) { } void SetApplicationXDefaults(application_x* application) { - application->ambient_support = strdup("false"); application->effectimage_type = strdup("image"); application->enabled = strdup("true"); application->guestmode_visibility = strdup("true"); @@ -234,7 +237,7 @@ bool StepParse::FillWidgetInfo(manifest_x* manifest) { return true; } -bool StepParse::FillUIApplicationInfo(manifest_x* manifest) { +bool StepParse::FillMainApplicationInfo(manifest_x* manifest) { std::shared_ptr app_info = std::static_pointer_cast( parser_->GetManifestData(app_keys::kTizenApplicationKey)); @@ -242,15 +245,34 @@ bool StepParse::FillUIApplicationInfo(manifest_x* manifest) { LOG(ERROR) << "Application info manifest data has not been found."; return false; } + bool has_watch_catergory = false; + std::shared_ptr category_info = + std::static_pointer_cast(parser_->GetManifestData( + app_keys::kTizenCategoryKey)); + if (category_info) { + has_watch_catergory = std::find_if(category_info->categories.begin(), + category_info->categories.end(), + [](const std::string& category) { + return category == kCategoryWearableClock || + category == kCategoryWatchClock; + }) != category_info->categories.end(); + } + // application data application_x* application = reinterpret_cast( calloc(1, sizeof(application_x))); - application->component_type = strdup("uiapp"); + application->component_type = + has_watch_catergory ? strdup("watchapp") : strdup("uiapp"); application->mainapp = strdup("true"); application->nodisplay = strdup("false"); application->multiple = strdup("false"); application->appid = strdup(app_info->id().c_str()); SetApplicationXDefaults(application); + if (has_watch_catergory) + application->ambient_support = + strdup(app_info->ambient_support() ? "true" : "false"); + else + application->ambient_support = strdup("false"); application->package = strdup(app_info->package().c_str()); application->exec = @@ -298,6 +320,7 @@ bool StepParse::FillServiceApplicationInfo(manifest_x* manifest) { application->autorestart = service_info.auto_restart() ? strdup("true") : strdup("false"); SetApplicationXDefaults(application); + application->ambient_support = strdup("false"); application->package = strdup(manifest->package); for (auto& pair : service_info.names()) { @@ -449,7 +472,7 @@ bool StepParse::FillExtraManifestInfo(manifest_x* manifest) { bool StepParse::FillManifestX(manifest_x* manifest) { if (!FillIconPaths(manifest)) return false; - if (!FillUIApplicationInfo(manifest)) + if (!FillMainApplicationInfo(manifest)) return false; if (!FillWidgetInfo(manifest)) return false; diff --git a/src/wgt/step/step_parse.h b/src/wgt/step/step_parse.h index 06956b0..dc723cb 100644 --- a/src/wgt/step/step_parse.h +++ b/src/wgt/step/step_parse.h @@ -50,7 +50,7 @@ class StepParse : public common_installer::Step { bool FillInstallationInfo(manifest_x* manifest); bool FillIconPaths(manifest_x* manifest); bool FillWidgetInfo(manifest_x* manifest); - bool FillUIApplicationInfo(manifest_x* manifest); + bool FillMainApplicationInfo(manifest_x* manifest); bool FillServiceApplicationInfo(manifest_x* manifest); bool FillAppControl(manifest_x* manifest); bool FillPrivileges(manifest_x* manifest); -- 2.7.4 From 5ab4cba32c7d7e18a841f335983e9c8faa1ac58f Mon Sep 17 00:00:00 2001 From: Arkadiusz Szulakiewicz Date: Tue, 1 Mar 2016 15:05:08 +0100 Subject: [PATCH 05/16] Add tests for AppControl element in config.xml Change-Id: I87f8c009e0ba9074e2e7bfd0947393856fdc8bd8 --- src/unit_tests/manifest_test.cc | 60 ++++++++++++++++++++++ .../config.xml | 9 ++++ .../config.xml | 9 ++++ .../config.xml | 9 ++++ .../config.xml | 9 ++++ .../config.xml | 10 ++++ 6 files changed, 106 insertions(+) create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingMIME/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingOperation/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingSrc/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingURI/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_Valid/config.xml diff --git a/src/unit_tests/manifest_test.cc b/src/unit_tests/manifest_test.cc index e705cac..9e827f5 100644 --- a/src/unit_tests/manifest_test.cc +++ b/src/unit_tests/manifest_test.cc @@ -213,4 +213,64 @@ TEST_F(ManifestTest, PrivilegeElement_MissingName) { ASSERT_FALSE(runner.Run()); } +TEST_F(ManifestTest, AppControlElement_Valid) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + ASSERT_NE(app, nullptr); + std::vector app_controls; + for (appcontrol_x* app_control : GListRange(app->appcontrol)) { + app_controls.push_back(app_control); + } + ASSERT_EQ(app_controls.size(), 1); + ASSERT_CSTR_EQ(app_controls[0]->mime, "image/jpg"); + ASSERT_CSTR_EQ(app_controls[0]->operation, + "http://tizen.org/appcontrol/operation/edit"); + ASSERT_CSTR_EQ(app_controls[0]->uri, "myapp"); +} + +TEST_F(ManifestTest, AppControlElement_MissingMIME) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + ASSERT_NE(app, nullptr); + std::vector app_controls; + for (appcontrol_x* app_control : GListRange(app->appcontrol)) { + app_controls.push_back(app_control); + } + ASSERT_CSTR_EQ(app_controls[0]->mime, ""); +} + +TEST_F(ManifestTest, AppControlElement_MissingOperation) { + StepParseRunner runner(GetMyName()); + ASSERT_FALSE(runner.Run()); +} + +TEST_F(ManifestTest, AppControlElement_MissingSrc) { + StepParseRunner runner(GetMyName()); + ASSERT_FALSE(runner.Run()); +} + +TEST_F(ManifestTest, AppControlElement_MissingURI) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + ASSERT_NE(app, nullptr); + std::vector app_controls; + for (appcontrol_x* app_control : GListRange(app->appcontrol)) { + app_controls.push_back(app_control); + } + ASSERT_CSTR_EQ(app_controls[0]->uri, ""); +} + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingMIME/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingMIME/config.xml new file mode 100644 index 0000000..a0f5c94 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingMIME/config.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingOperation/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingOperation/config.xml new file mode 100644 index 0000000..6e9f364 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingOperation/config.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingSrc/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingSrc/config.xml new file mode 100644 index 0000000..4aa7ace --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingSrc/config.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingURI/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingURI/config.xml new file mode 100644 index 0000000..8101514 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingURI/config.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_Valid/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_Valid/config.xml new file mode 100644 index 0000000..cdbd2eb --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_Valid/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + -- 2.7.4 From 0d803c7d23bd414c428250d31ad79fabe1b79060 Mon Sep 17 00:00:00 2001 From: Arkadiusz Szulakiewicz Date: Fri, 4 Mar 2016 10:03:02 +0100 Subject: [PATCH 06/16] Add tests for Setting element in config.xml Change-Id: I5611261dc271b305191526e4e774e48f16d02e36 --- src/unit_tests/manifest_test.cc | 194 +++++++++++++++++++++ .../config.xml | 12 ++ .../config.xml | 11 ++ .../config.xml | 11 ++ .../config.xml | 11 ++ .../config.xml | 11 ++ .../config.xml | 11 ++ .../config.xml | 11 ++ .../config.xml | 11 ++ .../config.xml | 11 ++ .../config.xml | 11 ++ .../config.xml | 10 ++ .../config.xml | 10 ++ .../config.xml | 10 ++ .../config.xml | 10 ++ .../config.xml | 10 ++ .../config.xml | 10 ++ .../config.xml | 10 ++ .../ManifestTest.SettingsElement_Valid/config.xml | 11 ++ 19 files changed, 386 insertions(+) create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundSupportDisabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundSupportEnabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundVibrationDisabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundVibrationEnabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_ContextMenuDisabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_ContextMenuEnabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_EncryptionDisabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_EncryptionEnabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_HwKeyDisabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_HwKeyEnabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingBackgroundSupport/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingBackgroundVibration/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingContextMenu/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingEncryption/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingHwKeyEvent/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingInstallLocation/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingScreenOrientation/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_Valid/config.xml diff --git a/src/unit_tests/manifest_test.cc b/src/unit_tests/manifest_test.cc index 9e827f5..4bc380a 100644 --- a/src/unit_tests/manifest_test.cc +++ b/src/unit_tests/manifest_test.cc @@ -8,6 +8,8 @@ #include #include +#include + #include #include @@ -49,6 +51,10 @@ class StepParseRunner { return step.process() == ci::Step::Status::OK; } + wgt::WgtBackendData* GetBackendData() const { + return static_cast(context_->backend_data.get()); + } + manifest_x* GetManifest() const { return context_->manifest_data.get(); } @@ -272,5 +278,193 @@ TEST_F(ManifestTest, AppControlElement_MissingURI) { ASSERT_CSTR_EQ(app_controls[0]->uri, ""); } +TEST_F(ManifestTest, SettingsElement_Valid) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto backend_data = runner.GetBackendData(); + auto settings = backend_data->settings.get(); + + ASSERT_EQ(settings.background_support_enabled(), true); + ASSERT_EQ(settings.context_menu_enabled(), false); + ASSERT_EQ(settings.encryption_enabled(), true); + ASSERT_EQ(settings.screen_orientation(), + wgt::parse::SettingInfo::ScreenOrientation::LANDSCAPE); + ASSERT_EQ(settings.install_location(), + wgt::parse::SettingInfo::InstallLocation::INTERNAL); + ASSERT_EQ(settings.hwkey_enabled(), true); + ASSERT_EQ(settings.background_vibration(), true); +} + +TEST_F(ManifestTest, SettingsElement_BackgroundSupportEnabled) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto backend_data = runner.GetBackendData(); + auto settings = backend_data->settings.get(); + ASSERT_EQ(settings.background_support_enabled(), true); +} + +TEST_F(ManifestTest, SettingsElement_BackgroundSupportDisabled) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto backend_data = runner.GetBackendData(); + auto settings = backend_data->settings.get(); + ASSERT_EQ(settings.background_support_enabled(), false); +} + +TEST_F(ManifestTest, SettingsElement_MissingBackgroundSupport) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto backend_data = runner.GetBackendData(); + auto settings = backend_data->settings.get(); + ASSERT_EQ(settings.background_support_enabled(), false); +} + +TEST_F(ManifestTest, SettingsElement_BackgroundVibrationEnabled) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto backend_data = runner.GetBackendData(); + auto settings = backend_data->settings.get(); + ASSERT_EQ(settings.background_vibration(), true); +} + +TEST_F(ManifestTest, SettingsElement_BackgroundVibrationDisabled) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto backend_data = runner.GetBackendData(); + auto settings = backend_data->settings.get(); + ASSERT_EQ(settings.background_vibration(), false); +} + +TEST_F(ManifestTest, SettingsElement_MissingBackgroundVibration) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto backend_data = runner.GetBackendData(); + auto settings = backend_data->settings.get(); + ASSERT_EQ(settings.background_vibration(), false); +} + +TEST_F(ManifestTest, SettingsElement_ContextMenuEnabled) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto backend_data = runner.GetBackendData(); + auto settings = backend_data->settings.get(); + ASSERT_EQ(settings.context_menu_enabled(), true); +} + +TEST_F(ManifestTest, SettingsElement_ContextMenuDisabled) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto backend_data = runner.GetBackendData(); + auto settings = backend_data->settings.get(); + ASSERT_EQ(settings.context_menu_enabled(), false); +} + +TEST_F(ManifestTest, SettingsElement_MissingContextMenu) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto backend_data = runner.GetBackendData(); + auto settings = backend_data->settings.get(); + ASSERT_EQ(settings.context_menu_enabled(), true); +} + +TEST_F(ManifestTest, SettingsElement_EncryptionEnabled) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto backend_data = runner.GetBackendData(); + auto settings = backend_data->settings.get(); + ASSERT_EQ(settings.encryption_enabled(), true); +} + +TEST_F(ManifestTest, SettingsElement_EncryptionDisabled) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto backend_data = runner.GetBackendData(); + auto settings = backend_data->settings.get(); + ASSERT_EQ(settings.encryption_enabled(), false); +} + +TEST_F(ManifestTest, SettingsElement_MissingEncryption) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto backend_data = runner.GetBackendData(); + auto settings = backend_data->settings.get(); + ASSERT_EQ(settings.encryption_enabled(), false); +} + +TEST_F(ManifestTest, SettingsElement_HwKeyEnabled) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto backend_data = runner.GetBackendData(); + auto settings = backend_data->settings.get(); + ASSERT_EQ(settings.hwkey_enabled(), true); +} +TEST_F(ManifestTest, SettingsElement_HwKeyDisabled) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto backend_data = runner.GetBackendData(); + auto settings = backend_data->settings.get(); + ASSERT_EQ(settings.hwkey_enabled(), false); +} +TEST_F(ManifestTest, SettingsElement_MissingHwKeyEvent) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto backend_data = runner.GetBackendData(); + auto settings = backend_data->settings.get(); + ASSERT_EQ(settings.hwkey_enabled(), true); +} + +TEST_F(ManifestTest, SettingsElement_MissingInstallLocation) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto backend_data = runner.GetBackendData(); + auto settings = backend_data->settings.get(); + ASSERT_EQ(settings.install_location(), + wgt::parse::SettingInfo::InstallLocation::AUTO); +} + +TEST_F(ManifestTest, SettingsElement_MissingScreenOrientation) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto backend_data = runner.GetBackendData(); + auto settings = backend_data->settings.get(); + ASSERT_EQ(settings.screen_orientation(), + wgt::parse::SettingInfo::ScreenOrientation::AUTO); +} diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundSupportDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundSupportDisabled/config.xml new file mode 100644 index 0000000..ef25267 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundSupportDisabled/config.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundSupportEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundSupportEnabled/config.xml new file mode 100644 index 0000000..90a4aea --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundSupportEnabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundVibrationDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundVibrationDisabled/config.xml new file mode 100644 index 0000000..421c7b1 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundVibrationDisabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundVibrationEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundVibrationEnabled/config.xml new file mode 100644 index 0000000..90a4aea --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundVibrationEnabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_ContextMenuDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_ContextMenuDisabled/config.xml new file mode 100644 index 0000000..90a4aea --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_ContextMenuDisabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_ContextMenuEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_ContextMenuEnabled/config.xml new file mode 100644 index 0000000..1f688a2 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_ContextMenuEnabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_EncryptionDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_EncryptionDisabled/config.xml new file mode 100644 index 0000000..441d232 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_EncryptionDisabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_EncryptionEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_EncryptionEnabled/config.xml new file mode 100644 index 0000000..90a4aea --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_EncryptionEnabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_HwKeyDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_HwKeyDisabled/config.xml new file mode 100644 index 0000000..3b10bc5 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_HwKeyDisabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_HwKeyEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_HwKeyEnabled/config.xml new file mode 100644 index 0000000..90a4aea --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_HwKeyEnabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingBackgroundSupport/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingBackgroundSupport/config.xml new file mode 100644 index 0000000..ed8fc2a --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingBackgroundSupport/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingBackgroundVibration/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingBackgroundVibration/config.xml new file mode 100644 index 0000000..798ae31 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingBackgroundVibration/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingContextMenu/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingContextMenu/config.xml new file mode 100644 index 0000000..bd72968 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingContextMenu/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingEncryption/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingEncryption/config.xml new file mode 100644 index 0000000..699bdcd --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingEncryption/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingHwKeyEvent/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingHwKeyEvent/config.xml new file mode 100644 index 0000000..5ec89c9 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingHwKeyEvent/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingInstallLocation/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingInstallLocation/config.xml new file mode 100644 index 0000000..523fde8 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingInstallLocation/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingScreenOrientation/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingScreenOrientation/config.xml new file mode 100644 index 0000000..b2b92f3 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingScreenOrientation/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_Valid/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_Valid/config.xml new file mode 100644 index 0000000..90a4aea --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_Valid/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + -- 2.7.4 From 67b2b7d92685e86d5614e0d2d06b0d5b3e3fa42b Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Fri, 11 Mar 2016 14:16:14 +0900 Subject: [PATCH 07/16] Remove unused variable at unit test Change-Id: I78dfb119eeb9b45ef0133631b481191a08996aa8 Signed-off-by: Sangyoon Jang --- src/unit_tests/manifest_test.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/unit_tests/manifest_test.cc b/src/unit_tests/manifest_test.cc index 4bc380a..9eee758 100644 --- a/src/unit_tests/manifest_test.cc +++ b/src/unit_tests/manifest_test.cc @@ -180,8 +180,6 @@ TEST_F(ManifestTest, PrivilegeElement_ValidName) { ASSERT_TRUE(runner.Run()); manifest_x* m = runner.GetManifest(); ASSERT_NE(m, nullptr); - auto apps = GListRange(m->application); - application_x* app = *apps.begin(); std::vector priv_vec; for (const char* priv : GListRange(m->privileges)) { priv_vec.push_back(priv); @@ -196,8 +194,6 @@ TEST_F(ManifestTest, PrivilegeElement_ManyElements) { ASSERT_TRUE(runner.Run()); manifest_x* m = runner.GetManifest(); ASSERT_NE(m, nullptr); - auto apps = GListRange(m->application); - application_x* app = *apps.begin(); std::vector priv_vec; for (const char* priv : GListRange(m->privileges)) { priv_vec.push_back(priv); -- 2.7.4 From ccf2c1dc2a33d638f75f320410146919d991b896 Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Fri, 11 Mar 2016 15:28:32 +0900 Subject: [PATCH 08/16] Check removable when uninstall package Requires: - https://review.tizen.org/gerrit/61899 Change-Id: I02ad18a259206b8923825590a16045b9fd489b12 Signed-off-by: Sangyoon Jang --- src/hybrid/hybrid_installer.cc | 2 ++ src/wgt/wgt_installer.cc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/hybrid/hybrid_installer.cc b/src/hybrid/hybrid_installer.cc index 8e60fc2..834db03 100644 --- a/src/hybrid/hybrid_installer.cc +++ b/src/hybrid/hybrid_installer.cc @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -136,6 +137,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) break; case ci::RequestType::Uninstall: AddStep(pkgmgr_); + AddStep(); AddStep( ci::parse::StepParseManifest::ManifestLocation::INSTALLED, ci::parse::StepParseManifest::StoreLocation::NORMAL); diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc index c1c4e7f..fa66402 100644 --- a/src/wgt/wgt_installer.cc +++ b/src/wgt/wgt_installer.cc @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -130,6 +131,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) } case ci::RequestType::Uninstall: { AddStep(pkgmgr_); + AddStep(); AddStep( ci::parse::StepParseManifest::ManifestLocation::INSTALLED, ci::parse::StepParseManifest::StoreLocation::NORMAL); -- 2.7.4 From 636778918a662fcf965c32c68992883ea382df8c Mon Sep 17 00:00:00 2001 From: Arkadiusz Szulakiewicz Date: Mon, 7 Mar 2016 12:33:34 +0100 Subject: [PATCH 09/16] Add tests for Metadata and Setting element in config.xml Change-Id: Ie32b9d76151ea7ba119f5a742a38caa23cda9f37 --- src/unit_tests/manifest_test.cc | 75 ++++++++++++++++++++++ .../config.xml | 7 ++ .../config.xml | 5 ++ .../config.xml | 6 ++ .../ManifestTest.MetadataElement_Valid/config.xml | 6 ++ .../config.xml | 12 ++++ .../config.xml | 11 ++++ .../config.xml | 11 ++++ .../config.xml | 11 ++++ .../config.xml | 11 ++++ .../config.xml | 11 ++++ .../config.xml | 11 ++++ .../config.xml | 11 ++++ .../config.xml | 11 ++++ .../config.xml | 11 ++++ .../config.xml | 10 +++ .../config.xml | 10 +++ .../config.xml | 10 +++ .../config.xml | 10 +++ .../config.xml | 10 +++ .../config.xml | 10 +++ .../config.xml | 10 +++ .../ManifestTest.SettingElement_Valid/config.xml | 11 ++++ 23 files changed, 291 insertions(+) create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_DuplicateKey/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingKey/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingValue/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_Valid/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportDisabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportEnabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationDisabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationEnabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuDisabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuEnabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionDisabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionEnabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyDisabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyEnabled/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundSupport/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundVibration/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingContextMenu/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingEncryption/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingHwKeyEvent/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingInstallLocation/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingScreenOrientation/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_Valid/config.xml diff --git a/src/unit_tests/manifest_test.cc b/src/unit_tests/manifest_test.cc index 9eee758..183e0b4 100644 --- a/src/unit_tests/manifest_test.cc +++ b/src/unit_tests/manifest_test.cc @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -215,6 +216,7 @@ TEST_F(ManifestTest, PrivilegeElement_MissingName) { ASSERT_FALSE(runner.Run()); } + TEST_F(ManifestTest, AppControlElement_Valid) { StepParseRunner runner(GetMyName()); ASSERT_TRUE(runner.Run()); @@ -464,3 +466,76 @@ TEST_F(ManifestTest, SettingsElement_MissingScreenOrientation) { ASSERT_EQ(settings.screen_orientation(), wgt::parse::SettingInfo::ScreenOrientation::AUTO); } + +TEST_F(ManifestTest, MetadataElement_Valid) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + + std::map meta_data_map; + for (metadata_x* meta_data : GListRange(app->metadata)) { + if (meta_data->value) + meta_data_map[meta_data->key] = meta_data->value; + else + meta_data_map[meta_data->key] = std::string(); + } + ASSERT_EQ(meta_data_map.size(), 2); + ASSERT_CSTR_EQ(meta_data_map["key1"].c_str(), ""); + ASSERT_CSTR_EQ(meta_data_map["key2"].c_str(), "value2"); +} + +TEST_F(ManifestTest, MetadataElement_DuplicateKey) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + + std::map meta_data_map; + for (metadata_x* meta_data : GListRange(app->metadata)) { + meta_data_map[meta_data->key] = meta_data->value; + } + ASSERT_EQ(meta_data_map.size(), 2); + ASSERT_CSTR_EQ(meta_data_map["key1"].c_str(), "key1value"); + ASSERT_CSTR_EQ(meta_data_map["key2"].c_str(), "key2value"); +} + +TEST_F(ManifestTest, MetadataElement_MissingValue) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + + std::map meta_data_map; + for (metadata_x* meta_data : GListRange(app->metadata)) { + if (meta_data->value) + meta_data_map[meta_data->key] = meta_data->value; + else + meta_data_map[meta_data->key] = std::string(); + } + ASSERT_EQ(meta_data_map.size(), 2); + ASSERT_CSTR_EQ(meta_data_map["key1"].c_str(), ""); + ASSERT_CSTR_EQ(meta_data_map["key2"].c_str(), ""); +} + +TEST_F(ManifestTest, MetadataElement_MissingKey) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + + std::map meta_data_map; + for (metadata_x* meta_data : GListRange(app->metadata)) { + if (meta_data->key && meta_data->value) + meta_data_map[meta_data->key] = meta_data->value; + } + ASSERT_EQ(meta_data_map.size(), 0); +} diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_DuplicateKey/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_DuplicateKey/config.xml new file mode 100644 index 0000000..5cafe7e --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_DuplicateKey/config.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingKey/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingKey/config.xml new file mode 100644 index 0000000..66bbf64 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingKey/config.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingValue/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingValue/config.xml new file mode 100644 index 0000000..9f21ae3 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingValue/config.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_Valid/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_Valid/config.xml new file mode 100644 index 0000000..353cfc3 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_Valid/config.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportDisabled/config.xml new file mode 100644 index 0000000..ef25267 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportDisabled/config.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportEnabled/config.xml new file mode 100644 index 0000000..90a4aea --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportEnabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationDisabled/config.xml new file mode 100644 index 0000000..421c7b1 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationDisabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationEnabled/config.xml new file mode 100644 index 0000000..90a4aea --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationEnabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuDisabled/config.xml new file mode 100644 index 0000000..90a4aea --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuDisabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuEnabled/config.xml new file mode 100644 index 0000000..1f688a2 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuEnabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionDisabled/config.xml new file mode 100644 index 0000000..441d232 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionDisabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionEnabled/config.xml new file mode 100644 index 0000000..90a4aea --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionEnabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyDisabled/config.xml new file mode 100644 index 0000000..3b10bc5 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyDisabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyEnabled/config.xml new file mode 100644 index 0000000..90a4aea --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyEnabled/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundSupport/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundSupport/config.xml new file mode 100644 index 0000000..ed8fc2a --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundSupport/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundVibration/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundVibration/config.xml new file mode 100644 index 0000000..798ae31 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundVibration/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingContextMenu/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingContextMenu/config.xml new file mode 100644 index 0000000..bd72968 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingContextMenu/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingEncryption/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingEncryption/config.xml new file mode 100644 index 0000000..699bdcd --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingEncryption/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingHwKeyEvent/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingHwKeyEvent/config.xml new file mode 100644 index 0000000..5ec89c9 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingHwKeyEvent/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingInstallLocation/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingInstallLocation/config.xml new file mode 100644 index 0000000..523fde8 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingInstallLocation/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingScreenOrientation/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingScreenOrientation/config.xml new file mode 100644 index 0000000..b2b92f3 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingScreenOrientation/config.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_Valid/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_Valid/config.xml new file mode 100644 index 0000000..90a4aea --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_Valid/config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + -- 2.7.4 From a7ce47d8b75b0a67e62a53eef99d97b7ff0890f9 Mon Sep 17 00:00:00 2001 From: Arkadiusz Szulakiewicz Date: Mon, 7 Mar 2016 16:07:55 +0100 Subject: [PATCH 10/16] Add tests for Category element in config.xml Change-Id: Icafa7a6120978d2368966438d1b70ed77e937738 --- src/unit_tests/manifest_test.cc | 54 ++++++++++++++++++++++ .../config.xml | 5 ++ .../config.xml | 7 +++ .../ManifestTest.CategoryElement_Valid/config.xml | 5 ++ 4 files changed, 71 insertions(+) create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MissingName/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MultipleElements/config.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_Valid/config.xml diff --git a/src/unit_tests/manifest_test.cc b/src/unit_tests/manifest_test.cc index 183e0b4..da14f60 100644 --- a/src/unit_tests/manifest_test.cc +++ b/src/unit_tests/manifest_test.cc @@ -539,3 +539,57 @@ TEST_F(ManifestTest, MetadataElement_MissingKey) { } ASSERT_EQ(meta_data_map.size(), 0); } + +TEST_F(ManifestTest, CategoryElement_Valid) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + + std::vector categories; + for (const char* category : GListRange(app->category)) { + categories.push_back(category); + } + ASSERT_EQ(categories.size(), 1); + ASSERT_CSTR_EQ(categories[0].c_str(), + "http://tizen.org/category/wearable_clock"); +} + +TEST_F(ManifestTest, CategoryElement_MissingName) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + + std::vector categories; + for (const char* category : GListRange(app->category)) { + categories.push_back(category); + } + ASSERT_TRUE(categories.empty()); +} + +TEST_F(ManifestTest, CategoryElement_MultipleElements) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + auto apps = GListRange(m->application); + application_x* app = *apps.begin(); + + std::vector categories; + for (const char* category : GListRange(app->category)) { + categories.push_back(category); + } + ASSERT_EQ(categories.size(), 3); + ASSERT_CSTR_EQ(categories[0].c_str(), + "http://tizen.org/category/category_0"); + ASSERT_CSTR_EQ(categories[1].c_str(), + "http://tizen.org/category/category_1"); + ASSERT_CSTR_EQ(categories[2].c_str(), + "http://tizen.org/category/category_2"); + +} diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MissingName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MissingName/config.xml new file mode 100644 index 0000000..698d3fd --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MissingName/config.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MultipleElements/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MultipleElements/config.xml new file mode 100644 index 0000000..5e2a900 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MultipleElements/config.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_Valid/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_Valid/config.xml new file mode 100644 index 0000000..55de5ee --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_Valid/config.xml @@ -0,0 +1,5 @@ + + + + + -- 2.7.4 From ab0a6e3c873903e38615d818faf041d855db397a Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Thu, 17 Mar 2016 14:58:06 +0100 Subject: [PATCH 11/16] Fix typo in StepGenerateXml Change-Id: Iebba5702b4ce032f35836e7ede12c93a57e2284e --- src/wgt/step/step_generate_xml.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wgt/step/step_generate_xml.cc b/src/wgt/step/step_generate_xml.cc index 176c908..a90b3bb 100644 --- a/src/wgt/step/step_generate_xml.cc +++ b/src/wgt/step/step_generate_xml.cc @@ -119,10 +119,10 @@ common_installer::Step::Status StepGenerateXml::GenerateApplicationCommonXml( // app-specific attributes switch (type) { case AppCompType::UIAPP: - WriteServiceApplicationAttributes(writer, app); + WriteUIApplicationAttributes(writer, app); break; case AppCompType::SVCAPP: - WriteUIApplicationAttributes(writer, app); + WriteServiceApplicationAttributes(writer, app); break; case AppCompType::WIDGETAPP: WriteWidgetApplicationAttributes(writer, app); -- 2.7.4 From c15c6a779b0c5bce5bf96cb2315b6b190438e7e6 Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Thu, 10 Mar 2016 14:14:03 +0100 Subject: [PATCH 12/16] Rework step/ directory structure Steps are moved to subdirectories according to their namespace. Submit together with: - https://review.tizen.org/gerrit/61795 - https://review.tizen.org/gerrit/61796 - https://review.tizen.org/gerrit/61797 Build to verify, no logic changes were made. Change-Id: Idb6548add52b29a92837d15ef7180587fe902d29 --- src/hybrid/CMakeLists.txt | 8 +- src/hybrid/hybrid_installer.cc | 180 ++++++++++----------- .../{ => configuration}/step_merge_tpk_config.cc | 6 +- .../{ => configuration}/step_merge_tpk_config.h | 10 +- src/hybrid/step/{ => configuration}/step_parse.cc | 6 +- src/hybrid/step/{ => configuration}/step_parse.h | 16 +- .../{ => configuration}/step_stash_tpk_config.cc | 6 +- .../{ => configuration}/step_stash_tpk_config.h | 10 +- .../{ => encryption}/step_encrypt_resources.cc | 6 +- .../step/{ => encryption}/step_encrypt_resources.h | 16 +- src/unit_tests/manifest_test.cc | 4 +- src/unit_tests/smoke_test.cc | 2 +- src/wgt/CMakeLists.txt | 28 ++-- src/wgt/step/{ => configuration}/step_parse.cc | 89 +++++----- src/wgt/step/{ => configuration}/step_parse.h | 12 +- .../{ => configuration}/step_parse_recovery.cc | 6 +- .../step/{ => configuration}/step_parse_recovery.h | 12 +- .../{ => encryption}/step_encrypt_resources.cc | 6 +- .../step/{ => encryption}/step_encrypt_resources.h | 10 +- .../step_remove_encryption_data.cc | 6 +- .../{ => encryption}/step_remove_encryption_data.h | 10 +- .../{ => filesystem}/step_create_symbolic_link.cc | 2 +- .../{ => filesystem}/step_create_symbolic_link.h | 6 +- .../step/{ => filesystem}/step_wgt_patch_icons.cc | 2 +- .../step/{ => filesystem}/step_wgt_patch_icons.h | 6 +- .../step_wgt_patch_storage_directories.cc | 2 +- .../step_wgt_patch_storage_directories.h | 6 +- .../step_wgt_resource_directory.cc | 2 +- .../{ => filesystem}/step_wgt_resource_directory.h | 6 +- src/wgt/step/{ => pkgmgr}/step_generate_xml.cc | 2 +- src/wgt/step/{ => pkgmgr}/step_generate_xml.h | 6 +- src/wgt/step/{ => rds}/step_rds_modify.cc | 2 +- src/wgt/step/{ => rds}/step_rds_modify.h | 7 +- src/wgt/step/{ => rds}/step_rds_parse.cc | 2 +- src/wgt/step/{ => rds}/step_rds_parse.h | 8 +- .../{ => security}/step_add_default_privileges.cc | 2 +- .../{ => security}/step_add_default_privileges.h | 6 +- .../{ => security}/step_check_settings_level.cc | 2 +- .../{ => security}/step_check_settings_level.h | 6 +- .../step_check_wgt_background_category.cc | 2 +- .../step_check_wgt_background_category.h | 8 +- src/wgt/wgt_installer.cc | 161 +++++++++--------- 42 files changed, 351 insertions(+), 344 deletions(-) rename src/hybrid/step/{ => configuration}/step_merge_tpk_config.cc (87%) rename src/hybrid/step/{ => configuration}/step_merge_tpk_config.h (76%) rename src/hybrid/step/{ => configuration}/step_parse.cc (78%) rename src/hybrid/step/{ => configuration}/step_parse.h (59%) rename src/hybrid/step/{ => configuration}/step_stash_tpk_config.cc (82%) rename src/hybrid/step/{ => configuration}/step_stash_tpk_config.h (75%) rename src/hybrid/step/{ => encryption}/step_encrypt_resources.cc (75%) rename src/hybrid/step/{ => encryption}/step_encrypt_resources.h (53%) rename src/wgt/step/{ => configuration}/step_parse.cc (87%) rename src/wgt/step/{ => configuration}/step_parse.h (88%) rename src/wgt/step/{ => configuration}/step_parse_recovery.cc (92%) rename src/wgt/step/{ => configuration}/step_parse_recovery.h (82%) rename src/wgt/step/{ => encryption}/step_encrypt_resources.cc (98%) rename src/wgt/step/{ => encryption}/step_encrypt_resources.h (87%) rename src/wgt/step/{ => encryption}/step_remove_encryption_data.cc (93%) rename src/wgt/step/{ => encryption}/step_remove_encryption_data.h (78%) rename src/wgt/step/{ => filesystem}/step_create_symbolic_link.cc (97%) rename src/wgt/step/{ => filesystem}/step_create_symbolic_link.h (86%) rename src/wgt/step/{ => filesystem}/step_wgt_patch_icons.cc (96%) rename src/wgt/step/{ => filesystem}/step_wgt_patch_icons.h (83%) rename src/wgt/step/{ => filesystem}/step_wgt_patch_storage_directories.cc (97%) rename src/wgt/step/{ => filesystem}/step_wgt_patch_storage_directories.h (82%) rename src/wgt/step/{ => filesystem}/step_wgt_resource_directory.cc (95%) rename src/wgt/step/{ => filesystem}/step_wgt_resource_directory.h (88%) rename src/wgt/step/{ => pkgmgr}/step_generate_xml.cc (99%) rename src/wgt/step/{ => pkgmgr}/step_generate_xml.h (88%) rename src/wgt/step/{ => rds}/step_rds_modify.cc (99%) rename src/wgt/step/{ => rds}/step_rds_modify.h (94%) rename src/wgt/step/{ => rds}/step_rds_parse.cc (97%) rename src/wgt/step/{ => rds}/step_rds_parse.h (90%) rename src/wgt/step/{ => security}/step_add_default_privileges.cc (93%) rename src/wgt/step/{ => security}/step_add_default_privileges.h (86%) rename src/wgt/step/{ => security}/step_check_settings_level.cc (96%) rename src/wgt/step/{ => security}/step_check_settings_level.h (87%) rename src/wgt/step/{ => security}/step_check_wgt_background_category.cc (92%) rename src/wgt/step/{ => security}/step_check_wgt_background_category.h (74%) diff --git a/src/hybrid/CMakeLists.txt b/src/hybrid/CMakeLists.txt index 040d9fc..0e2418f 100644 --- a/src/hybrid/CMakeLists.txt +++ b/src/hybrid/CMakeLists.txt @@ -1,8 +1,8 @@ SET(SRCS - step/step_encrypt_resources.cc - step/step_merge_tpk_config.cc - step/step_parse.cc - step/step_stash_tpk_config.cc + step/configuration/step_merge_tpk_config.cc + step/configuration/step_parse.cc + step/configuration/step_stash_tpk_config.cc + step/encryption/step_encrypt_resources.cc hybrid_installer.cc ) ADD_LIBRARY(${TARGET_LIBNAME_HYBRID} STATIC ${SRCS}) diff --git a/src/hybrid/hybrid_installer.cc b/src/hybrid/hybrid_installer.cc index 834db03..b12354d 100644 --- a/src/hybrid/hybrid_installer.cc +++ b/src/hybrid/hybrid_installer.cc @@ -4,62 +4,62 @@ #include "hybrid/hybrid_installer.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include -#include +#include +#include #include "hybrid/hybrid_backend_data.h" -#include "hybrid/step/step_encrypt_resources.h" -#include "hybrid/step/step_merge_tpk_config.h" -#include "hybrid/step/step_stash_tpk_config.h" -#include "hybrid/step/step_parse.h" -#include "wgt/step/step_check_settings_level.h" -#include "wgt/step/step_check_wgt_background_category.h" -#include "wgt/step/step_create_symbolic_link.h" -#include "wgt/step/step_generate_xml.h" -#include "wgt/step/step_parse_recovery.h" -#include "wgt/step/step_remove_encryption_data.h" -#include "wgt/step/step_wgt_patch_icons.h" -#include "wgt/step/step_wgt_patch_storage_directories.h" +#include "hybrid/step/configuration/step_merge_tpk_config.h" +#include "hybrid/step/configuration/step_parse.h" +#include "hybrid/step/configuration/step_stash_tpk_config.h" +#include "hybrid/step/encryption/step_encrypt_resources.h" +#include "wgt/step/configuration/step_parse_recovery.h" +#include "wgt/step/encryption/step_remove_encryption_data.h" +#include "wgt/step/filesystem/step_create_symbolic_link.h" +#include "wgt/step/filesystem/step_wgt_patch_icons.h" +#include "wgt/step/filesystem/step_wgt_patch_storage_directories.h" +#include "wgt/step/pkgmgr/step_generate_xml.h" +#include "wgt/step/security/step_check_settings_level.h" +#include "wgt/step/security/step_check_wgt_background_category.h" namespace ci = common_installer; @@ -73,17 +73,17 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) case ci::RequestType::Install: AddStep(pkgmgr_); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::PACKAGE, - ci::parse::StepParseManifest::StoreLocation::NORMAL); - AddStep(); - AddStep(true); - AddStep(); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::PACKAGE, + ci::configuration::StepParseManifest::StoreLocation::NORMAL); + AddStep(); + AddStep(true); + AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -103,21 +103,21 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) case ci::RequestType::Update: AddStep(pkgmgr_); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::PACKAGE, - ci::parse::StepParseManifest::StoreLocation::NORMAL); - AddStep(); - AddStep(true); - AddStep(); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::PACKAGE, + ci::configuration::StepParseManifest::StoreLocation::NORMAL); + AddStep(); + AddStep(true); + AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep(); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::INSTALLED, - ci::parse::StepParseManifest::StoreLocation::BACKUP); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, + ci::configuration::StepParseManifest::StoreLocation::BACKUP); AddStep(); AddStep(); AddStep(); @@ -138,9 +138,9 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) case ci::RequestType::Uninstall: AddStep(pkgmgr_); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::INSTALLED, - ci::parse::StepParseManifest::StoreLocation::NORMAL); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, + ci::configuration::StepParseManifest::StoreLocation::NORMAL); AddStep( ci::Plugin::ActionType::Uninstall); AddStep(); @@ -149,7 +149,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep(); AddStep(); AddStep(); break; @@ -160,22 +160,22 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) case ci::RequestType::Delta: AddStep(pkgmgr_); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::PACKAGE, - ci::parse::StepParseManifest::StoreLocation::NORMAL); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::PACKAGE, + ci::configuration::StepParseManifest::StoreLocation::NORMAL); AddStep(); - AddStep(); - AddStep(true); - AddStep(); + AddStep(); + AddStep(true); + AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep(); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::INSTALLED, - ci::parse::StepParseManifest::StoreLocation::BACKUP); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, + ci::configuration::StepParseManifest::StoreLocation::BACKUP); AddStep(); AddStep(); AddStep(); @@ -196,12 +196,12 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) case ci::RequestType::Recovery: AddStep(pkgmgr_); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::RECOVERY, - ci::parse::StepParseManifest::StoreLocation::NORMAL); - AddStep(); - AddStep(); - AddStep(); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::RECOVERY, + ci::configuration::StepParseManifest::StoreLocation::NORMAL); + AddStep(); + AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); diff --git a/src/hybrid/step/step_merge_tpk_config.cc b/src/hybrid/step/configuration/step_merge_tpk_config.cc similarity index 87% rename from src/hybrid/step/step_merge_tpk_config.cc rename to src/hybrid/step/configuration/step_merge_tpk_config.cc index 77f8407..913ad98 100644 --- a/src/hybrid/step/step_merge_tpk_config.cc +++ b/src/hybrid/step/configuration/step_merge_tpk_config.cc @@ -2,14 +2,14 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#include "hybrid/step/step_merge_tpk_config.h" +#include "hybrid/step/configuration/step_merge_tpk_config.h" #include #include "hybrid/hybrid_backend_data.h" namespace hybrid { -namespace parse { +namespace configuration { common_installer::Step::Status StepMergeTpkConfig::process() { HybridBackendData* data = @@ -28,5 +28,5 @@ common_installer::Step::Status StepMergeTpkConfig::process() { return Status::OK; } -} // namespace parse +} // namespace configuration } // namespace hybrid diff --git a/src/hybrid/step/step_merge_tpk_config.h b/src/hybrid/step/configuration/step_merge_tpk_config.h similarity index 76% rename from src/hybrid/step/step_merge_tpk_config.h rename to src/hybrid/step/configuration/step_merge_tpk_config.h index e8476ef..0414abe 100644 --- a/src/hybrid/step/step_merge_tpk_config.h +++ b/src/hybrid/step/configuration/step_merge_tpk_config.h @@ -2,14 +2,14 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#ifndef HYBRID_STEP_STEP_MERGE_TPK_CONFIG_H_ -#define HYBRID_STEP_STEP_MERGE_TPK_CONFIG_H_ +#ifndef HYBRID_STEP_CONFIGURATION_STEP_MERGE_TPK_CONFIG_H_ +#define HYBRID_STEP_CONFIGURATION_STEP_MERGE_TPK_CONFIG_H_ #include #include namespace hybrid { -namespace parse { +namespace configuration { /** * \brief MergeTpkConfig @@ -28,7 +28,7 @@ class StepMergeTpkConfig : public common_installer::Step { SCOPE_LOG_TAG(MergeTpkConfig) }; -} // namespace parse +} // namespace configuration } // namespace hybrid -#endif // HYBRID_STEP_STEP_MERGE_TPK_CONFIG_H_ +#endif // HYBRID_STEP_CONFIGURATION_STEP_MERGE_TPK_CONFIG_H_ diff --git a/src/hybrid/step/step_parse.cc b/src/hybrid/step/configuration/step_parse.cc similarity index 78% rename from src/hybrid/step/step_parse.cc rename to src/hybrid/step/configuration/step_parse.cc index c15fa2a..1e25fbe 100644 --- a/src/hybrid/step/step_parse.cc +++ b/src/hybrid/step/configuration/step_parse.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#include "hybrid/step/step_parse.h" +#include "hybrid/step/configuration/step_parse.h" namespace { @@ -11,12 +11,12 @@ const char kResWgtPath[] = "res/wgt"; } namespace hybrid { -namespace parse { +namespace configuration { bool StepParse::LocateConfigFile() { return Check(context_->unpacked_dir_path.get() / kResWgtPath); } -} // namespace parse +} // namespace configuration } // namespace hybrid diff --git a/src/hybrid/step/step_parse.h b/src/hybrid/step/configuration/step_parse.h similarity index 59% rename from src/hybrid/step/step_parse.h rename to src/hybrid/step/configuration/step_parse.h index aff8a71..4c5b339 100644 --- a/src/hybrid/step/step_parse.h +++ b/src/hybrid/step/configuration/step_parse.h @@ -2,15 +2,15 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#ifndef HYBRID_STEP_STEP_PARSE_H_ -#define HYBRID_STEP_STEP_PARSE_H_ +#ifndef HYBRID_STEP_CONFIGURATION_STEP_PARSE_H_ +#define HYBRID_STEP_CONFIGURATION_STEP_PARSE_H_ #include -#include "wgt/step/step_parse.h" +#include "wgt/step/configuration/step_parse.h" namespace hybrid { -namespace parse { +namespace configuration { /** * \brief This step parse config.xml configuration file of widget @@ -18,16 +18,16 @@ namespace parse { * This subclass overrides location of file and it is used when hybrid package * is installed. */ -class StepParse : public wgt::parse::StepParse { +class StepParse : public wgt::configuration::StepParse { public: - using wgt::parse::StepParse::StepParse; + using wgt::configuration::StepParse::StepParse; bool LocateConfigFile() override; SCOPE_LOG_TAG(Parse) }; -} // namespace parse +} // namespace configuration } // namespace hybrid -#endif // HYBRID_STEP_STEP_PARSE_H_ +#endif // HYBRID_STEP_CONFIGURATION_STEP_PARSE_H_ diff --git a/src/hybrid/step/step_stash_tpk_config.cc b/src/hybrid/step/configuration/step_stash_tpk_config.cc similarity index 82% rename from src/hybrid/step/step_stash_tpk_config.cc rename to src/hybrid/step/configuration/step_stash_tpk_config.cc index c409a44..2ec91e7 100644 --- a/src/hybrid/step/step_stash_tpk_config.cc +++ b/src/hybrid/step/configuration/step_stash_tpk_config.cc @@ -2,12 +2,12 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#include "hybrid/step/step_stash_tpk_config.h" +#include "hybrid/step/configuration/step_stash_tpk_config.h" #include "hybrid/hybrid_backend_data.h" namespace hybrid { -namespace parse { +namespace configuration { common_installer::Step::Status StepStashTpkConfig::process() { HybridBackendData* data = @@ -18,5 +18,5 @@ common_installer::Step::Status StepStashTpkConfig::process() { return Status::OK; } -} // namespace parse +} // namespace configuration } // namespace hybrid diff --git a/src/hybrid/step/step_stash_tpk_config.h b/src/hybrid/step/configuration/step_stash_tpk_config.h similarity index 75% rename from src/hybrid/step/step_stash_tpk_config.h rename to src/hybrid/step/configuration/step_stash_tpk_config.h index 7db654c..7cc889c 100644 --- a/src/hybrid/step/step_stash_tpk_config.h +++ b/src/hybrid/step/configuration/step_stash_tpk_config.h @@ -2,14 +2,14 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#ifndef HYBRID_STEP_STEP_STASH_TPK_CONFIG_H_ -#define HYBRID_STEP_STEP_STASH_TPK_CONFIG_H_ +#ifndef HYBRID_STEP_CONFIGURATION_STEP_STASH_TPK_CONFIG_H_ +#define HYBRID_STEP_CONFIGURATION_STEP_STASH_TPK_CONFIG_H_ #include #include namespace hybrid { -namespace parse { +namespace configuration { /** * \brief StepCheckHybrid @@ -28,7 +28,7 @@ class StepStashTpkConfig : public common_installer::Step { SCOPE_LOG_TAG(StashTpkConfig) }; -} // namespace parse +} // namespace configuration } // namespace hybrid -#endif // HYBRID_STEP_STEP_STASH_TPK_CONFIG_H_ +#endif // HYBRID_STEP_CONFIGURATION_STEP_STASH_TPK_CONFIG_H_ diff --git a/src/hybrid/step/step_encrypt_resources.cc b/src/hybrid/step/encryption/step_encrypt_resources.cc similarity index 75% rename from src/hybrid/step/step_encrypt_resources.cc rename to src/hybrid/step/encryption/step_encrypt_resources.cc index a4411b6..2265a35 100644 --- a/src/hybrid/step/step_encrypt_resources.cc +++ b/src/hybrid/step/encryption/step_encrypt_resources.cc @@ -2,15 +2,15 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#include "hybrid/step/step_encrypt_resources.h" +#include "hybrid/step/encryption/step_encrypt_resources.h" namespace hybrid { -namespace encrypt { +namespace encryption { void StepEncryptResources::SetEncryptionRoot() { input_ = context_->unpacked_dir_path.get() / "res/wgt"; } -} // namespace encrypt +} // namespace encryption } // namespace hybrid diff --git a/src/hybrid/step/step_encrypt_resources.h b/src/hybrid/step/encryption/step_encrypt_resources.h similarity index 53% rename from src/hybrid/step/step_encrypt_resources.h rename to src/hybrid/step/encryption/step_encrypt_resources.h index c86e510..ec66852 100644 --- a/src/hybrid/step/step_encrypt_resources.h +++ b/src/hybrid/step/encryption/step_encrypt_resources.h @@ -2,24 +2,24 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#ifndef HYBRID_STEP_STEP_ENCRYPT_RESOURCES_H_ -#define HYBRID_STEP_STEP_ENCRYPT_RESOURCES_H_ +#ifndef HYBRID_STEP_ENCRYPTION_STEP_ENCRYPT_RESOURCES_H_ +#define HYBRID_STEP_ENCRYPTION_STEP_ENCRYPT_RESOURCES_H_ #include -#include "wgt/step/step_encrypt_resources.h" +#include "wgt/step/encryption/step_encrypt_resources.h" namespace hybrid { -namespace encrypt { +namespace encryption { /** * \brief Step that encrypt application resources files if flagged to do so * * This is variant for hybrid package */ -class StepEncryptResources : public wgt::encrypt::StepEncryptResources { +class StepEncryptResources : public wgt::encryption::StepEncryptResources { public: - using wgt::encrypt::StepEncryptResources::StepEncryptResources; + using wgt::encryption::StepEncryptResources::StepEncryptResources; private: void SetEncryptionRoot() override; @@ -27,7 +27,7 @@ class StepEncryptResources : public wgt::encrypt::StepEncryptResources { SCOPE_LOG_TAG(EncryptResources) }; -} // namespace encrypt +} // namespace encryption } // namespace hybrid -#endif // HYBRID_STEP_STEP_ENCRYPT_RESOURCES_H_ +#endif // HYBRID_STEP_ENCRYPTION_STEP_ENCRYPT_RESOURCES_H_ diff --git a/src/unit_tests/manifest_test.cc b/src/unit_tests/manifest_test.cc index da14f60..46d2f8b 100644 --- a/src/unit_tests/manifest_test.cc +++ b/src/unit_tests/manifest_test.cc @@ -18,7 +18,7 @@ #include #include -#include "wgt/step/step_parse.h" +#include "wgt/step/configuration/step_parse.h" #include "wgt/wgt_backend_data.h" #define ASSERT_CSTR_EQ(STR1, STR2) \ @@ -48,7 +48,7 @@ class StepParseRunner { bool Run() { PrepareContext(); - wgt::parse::StepParse step(context_.get(), !ignore_start_files_); + wgt::configuration::StepParse step(context_.get(), !ignore_start_files_); return step.process() == ci::Step::Status::OK; } diff --git a/src/unit_tests/smoke_test.cc b/src/unit_tests/smoke_test.cc index 5f3c772..00bc484 100644 --- a/src/unit_tests/smoke_test.cc +++ b/src/unit_tests/smoke_test.cc @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/wgt/CMakeLists.txt b/src/wgt/CMakeLists.txt index 6cb1e7a..6dbb9c9 100644 --- a/src/wgt/CMakeLists.txt +++ b/src/wgt/CMakeLists.txt @@ -1,20 +1,20 @@ # Target - sources SET(SRCS rds_parser.cc - step/step_check_settings_level.cc - step/step_check_wgt_background_category.cc - step/step_create_symbolic_link.cc - step/step_encrypt_resources.cc - step/step_generate_xml.cc - step/step_parse.cc - step/step_remove_encryption_data.cc - step/step_parse_recovery.cc - step/step_rds_parse.cc - step/step_rds_modify.cc - step/step_wgt_patch_icons.cc - step/step_wgt_patch_storage_directories.cc - step/step_wgt_resource_directory.cc - step/step_add_default_privileges.cc + step/configuration/step_parse.cc + step/configuration/step_parse_recovery.cc + step/encryption/step_encrypt_resources.cc + step/encryption/step_remove_encryption_data.cc + step/filesystem/step_create_symbolic_link.cc + step/filesystem/step_wgt_patch_icons.cc + step/filesystem/step_wgt_patch_storage_directories.cc + step/filesystem/step_wgt_resource_directory.cc + step/pkgmgr/step_generate_xml.cc + step/rds/step_rds_modify.cc + step/rds/step_rds_parse.cc + step/security/step_add_default_privileges.cc + step/security/step_check_settings_level.cc + step/security/step_check_wgt_background_category.cc wgt_app_query_interface.cc wgt_installer.cc ) diff --git a/src/wgt/step/step_parse.cc b/src/wgt/step/configuration/step_parse.cc similarity index 87% rename from src/wgt/step/step_parse.cc rename to src/wgt/step/configuration/step_parse.cc index 935b303..35e248e 100644 --- a/src/wgt/step/step_parse.cc +++ b/src/wgt/step/configuration/step_parse.cc @@ -3,7 +3,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_parse.h" +#include "wgt/step/configuration/step_parse.h" #include @@ -83,7 +83,7 @@ void SetApplicationXDefaults(application_x* application) { } // namespace namespace wgt { -namespace parse { +namespace configuration { namespace app_keys = wgt::application_widget_keys; namespace sc = std::chrono; @@ -95,7 +95,7 @@ StepParse::StepParse(common_installer::InstallerContext* context, } std::set StepParse::ExtractPrivileges( - std::shared_ptr perm_info) const { + std::shared_ptr perm_info) const { return perm_info->GetAPIPermissions(); } @@ -129,15 +129,15 @@ bool StepParse::FillInstallationInfo(manifest_x* manifest) { } bool StepParse::FillIconPaths(manifest_x* manifest) { - std::shared_ptr app_info = - std::static_pointer_cast( + std::shared_ptr app_info = + std::static_pointer_cast( parser_->GetManifestData(app_keys::kTizenApplicationKey)); if (!app_info) { LOG(ERROR) << "Application info manifest data has not been found."; return false; } - std::shared_ptr icons_info = - std::static_pointer_cast( + std::shared_ptr icons_info = + std::static_pointer_cast( parser_->GetManifestData(app_keys::kIconsKey)); if (icons_info.get()) { for (auto& application_icon : icons_info->icons()) { @@ -153,9 +153,9 @@ bool StepParse::FillIconPaths(manifest_x* manifest) { } bool StepParse::FillWidgetInfo(manifest_x* manifest) { - std::shared_ptr wgt_info = - std::static_pointer_cast(parser_->GetManifestData( - app_keys::kWidgetKey)); + std::shared_ptr wgt_info = + std::static_pointer_cast( + parser_->GetManifestData(app_keys::kWidgetKey)); if (!wgt_info.get()) { LOG(ERROR) << "Widget info manifest data has not been found."; return false; @@ -211,8 +211,8 @@ bool StepParse::FillWidgetInfo(manifest_x* manifest) { author->lang = strdup(DEFAULT_LOCALE); manifest->author = g_list_append(manifest->author, author); - std::shared_ptr settings_info = - std::static_pointer_cast( + std::shared_ptr settings_info = + std::static_pointer_cast( parser_->GetManifestData( wgt::application_widget_keys::kTizenSettingKey)); if (settings_info) { @@ -238,17 +238,17 @@ bool StepParse::FillWidgetInfo(manifest_x* manifest) { } bool StepParse::FillMainApplicationInfo(manifest_x* manifest) { - std::shared_ptr app_info = - std::static_pointer_cast( + std::shared_ptr app_info = + std::static_pointer_cast( parser_->GetManifestData(app_keys::kTizenApplicationKey)); if (!app_info) { LOG(ERROR) << "Application info manifest data has not been found."; return false; } bool has_watch_catergory = false; - std::shared_ptr category_info = - std::static_pointer_cast(parser_->GetManifestData( - app_keys::kTizenCategoryKey)); + std::shared_ptr category_info = + std::static_pointer_cast( + parser_->GetManifestData(app_keys::kTizenCategoryKey)); if (category_info) { has_watch_catergory = std::find_if(category_info->categories.begin(), category_info->categories.end(), @@ -298,8 +298,8 @@ bool StepParse::FillMainApplicationInfo(manifest_x* manifest) { } bool StepParse::FillServiceApplicationInfo(manifest_x* manifest) { - std::shared_ptr service_list = - std::static_pointer_cast( + std::shared_ptr service_list = + std::static_pointer_cast( parser_->GetManifestData(app_keys::kTizenServiceKey)); if (!service_list) return true; @@ -363,8 +363,9 @@ bool StepParse::FillServiceApplicationInfo(manifest_x* manifest) { bool StepParse::FillBackgroundCategoryInfo(manifest_x* manifest) { auto manifest_data = parser_->GetManifestData( app_keys::kTizenBackgroundCategoryKey); - std::shared_ptr bc_list = - std::static_pointer_cast(manifest_data); + std::shared_ptr bc_list = + std::static_pointer_cast( + manifest_data); if (!bc_list) return true; @@ -381,8 +382,8 @@ bool StepParse::FillBackgroundCategoryInfo(manifest_x* manifest) { } bool StepParse::FillAppControl(manifest_x* manifest) { - std::shared_ptr app_info_list = - std::static_pointer_cast( + std::shared_ptr app_info_list = + std::static_pointer_cast( parser_->GetManifestData(app_keys::kTizenApplicationAppControlsKey)); application_x* app = @@ -401,9 +402,9 @@ bool StepParse::FillAppControl(manifest_x* manifest) { } bool StepParse::FillPrivileges(manifest_x* manifest) { - std::shared_ptr perm_info = - std::static_pointer_cast(parser_->GetManifestData( - app_keys::kTizenPermissionsKey)); + std::shared_ptr perm_info = + std::static_pointer_cast( + parser_->GetManifestData(app_keys::kTizenPermissionsKey)); std::set privileges; if (perm_info) privileges = ExtractPrivileges(perm_info); @@ -416,9 +417,9 @@ bool StepParse::FillPrivileges(manifest_x* manifest) { } bool StepParse::FillCategories(manifest_x* manifest) { - std::shared_ptr category_info = - std::static_pointer_cast(parser_->GetManifestData( - app_keys::kTizenCategoryKey)); + std::shared_ptr category_info = + std::static_pointer_cast( + parser_->GetManifestData(app_keys::kTizenCategoryKey)); if (!category_info) return true; @@ -432,9 +433,9 @@ bool StepParse::FillCategories(manifest_x* manifest) { } bool StepParse::FillMetadata(manifest_x* manifest) { - std::shared_ptr meta_info = - std::static_pointer_cast(parser_->GetManifestData( - app_keys::kTizenMetaDataKey)); + std::shared_ptr meta_info = + std::static_pointer_cast( + parser_->GetManifestData(app_keys::kTizenMetaDataKey)); if (!meta_info) return true; @@ -445,9 +446,9 @@ bool StepParse::FillMetadata(manifest_x* manifest) { } bool StepParse::FillAccounts(manifest_x* manifest) { - std::shared_ptr account_info = - std::static_pointer_cast(parser_->GetManifestData( - app_keys::kAccountKey)); + std::shared_ptr account_info = + std::static_pointer_cast( + parser_->GetManifestData(app_keys::kAccountKey)); if (!account_info) return true; common_installer::AccountInfo info; @@ -534,12 +535,12 @@ common_installer::Step::Status StepParse::process() { } // Copy data from ManifestData to InstallerContext - std::shared_ptr info = - std::static_pointer_cast( + std::shared_ptr info = + std::static_pointer_cast( parser_->GetManifestData( wgt::application_widget_keys::kTizenApplicationKey)); - std::shared_ptr wgt_info = - std::static_pointer_cast( + std::shared_ptr wgt_info = + std::static_pointer_cast( parser_->GetManifestData( wgt::application_widget_keys::kTizenWidgetKey)); @@ -570,8 +571,8 @@ common_installer::Step::Status StepParse::process() { context_->recovery_info.get().recovery_file->WriteAndCommitFileContent(); } - std::shared_ptr perm_info = - std::static_pointer_cast( + std::shared_ptr perm_info = + std::static_pointer_cast( parser_->GetManifestData( wgt::application_widget_keys::kTizenPermissionsKey)); parser::PermissionSet permissions; @@ -581,8 +582,8 @@ common_installer::Step::Status StepParse::process() { WgtBackendData* backend_data = static_cast(context_->backend_data.get()); - std::shared_ptr settings_info = - std::static_pointer_cast( + std::shared_ptr settings_info = + std::static_pointer_cast( parser_->GetManifestData( wgt::application_widget_keys::kTizenSettingKey)); if (settings_info) @@ -624,5 +625,5 @@ bool StepParse::Check(const boost::filesystem::path& widget_path) { return true; } -} // namespace parse +} // namespace configuration } // namespace wgt diff --git a/src/wgt/step/step_parse.h b/src/wgt/step/configuration/step_parse.h similarity index 88% rename from src/wgt/step/step_parse.h rename to src/wgt/step/configuration/step_parse.h index dc723cb..17a7ed6 100644 --- a/src/wgt/step/step_parse.h +++ b/src/wgt/step/configuration/step_parse.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_PARSE_H_ -#define WGT_STEP_STEP_PARSE_H_ +#ifndef WGT_STEP_CONFIGURATION_STEP_PARSE_H_ +#define WGT_STEP_CONFIGURATION_STEP_PARSE_H_ #include @@ -20,7 +20,7 @@ #include namespace wgt { -namespace parse { +namespace configuration { /** * \brief This step parse config.xml configuration file of widget @@ -43,7 +43,7 @@ class StepParse : public common_installer::Step { private: std::set ExtractPrivileges( - std::shared_ptr perm_info) const; + std::shared_ptr perm_info) const; std::string GetPackageVersion(const std::string& manifest_version); @@ -67,7 +67,7 @@ class StepParse : public common_installer::Step { SCOPE_LOG_TAG(Parse) }; -} // namespace parse +} // namespace configuration } // namespace wgt -#endif // WGT_STEP_STEP_PARSE_H_ +#endif // WGT_STEP_CONFIGURATION_STEP_PARSE_H_ diff --git a/src/wgt/step/step_parse_recovery.cc b/src/wgt/step/configuration/step_parse_recovery.cc similarity index 92% rename from src/wgt/step/step_parse_recovery.cc rename to src/wgt/step/configuration/step_parse_recovery.cc index 218c2d5..0d8f3dc 100644 --- a/src/wgt/step/step_parse_recovery.cc +++ b/src/wgt/step/configuration/step_parse_recovery.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_parse_recovery.h" +#include "wgt/step/configuration/step_parse_recovery.h" #include #include @@ -14,7 +14,7 @@ const char kResWgtPath[] = "res/wgt"; } namespace wgt { -namespace parse { +namespace configuration { StepParseRecovery::StepParseRecovery( common_installer::InstallerContext* context) @@ -52,5 +52,5 @@ bool StepParseRecovery::LocateConfigFile() { return false; } -} // namespace parse +} // namespace configuration } // namespace wgt diff --git a/src/wgt/step/step_parse_recovery.h b/src/wgt/step/configuration/step_parse_recovery.h similarity index 82% rename from src/wgt/step/step_parse_recovery.h rename to src/wgt/step/configuration/step_parse_recovery.h index b5ed147..ad3015d 100644 --- a/src/wgt/step/step_parse_recovery.h +++ b/src/wgt/step/configuration/step_parse_recovery.h @@ -2,15 +2,15 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_PARSE_RECOVERY_H_ -#define WGT_STEP_STEP_PARSE_RECOVERY_H_ +#ifndef WGT_STEP_CONFIGURATION_STEP_PARSE_RECOVERY_H_ +#define WGT_STEP_CONFIGURATION_STEP_PARSE_RECOVERY_H_ #include -#include "wgt/step/step_parse.h" +#include "wgt/step/configuration/step_parse.h" namespace wgt { -namespace parse { +namespace configuration { /** * \brief The StepParseRecovery class * Retrievies package information from config.xml during RECOVERY. @@ -57,7 +57,7 @@ class StepParseRecovery : public StepParse { SCOPE_LOG_TAG(ParseRecovery) }; -} // namespace parse +} // namespace configuration } // namespace wgt -#endif // WGT_STEP_STEP_PARSE_RECOVERY_H_ +#endif // WGT_STEP_CONFIGURATION_STEP_PARSE_RECOVERY_H_ diff --git a/src/wgt/step/step_encrypt_resources.cc b/src/wgt/step/encryption/step_encrypt_resources.cc similarity index 98% rename from src/wgt/step/step_encrypt_resources.cc rename to src/wgt/step/encryption/step_encrypt_resources.cc index 51c1aec..8528ca9 100644 --- a/src/wgt/step/step_encrypt_resources.cc +++ b/src/wgt/step/encryption/step_encrypt_resources.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_encrypt_resources.h" +#include "wgt/step/encryption/step_encrypt_resources.h" #include @@ -27,7 +27,7 @@ const std::set encryptSet { ".html", ".htm", ".css", ".js"}; namespace wgt { -namespace encrypt { +namespace encryption { namespace bf = boost::filesystem; namespace bs = boost::system; @@ -214,5 +214,5 @@ bool StepEncryptResources::ToBeEncrypted(const bf::path &file) { return false; } -} // namespace encrypt +} // namespace encryption } // namespace wgt diff --git a/src/wgt/step/step_encrypt_resources.h b/src/wgt/step/encryption/step_encrypt_resources.h similarity index 87% rename from src/wgt/step/step_encrypt_resources.h rename to src/wgt/step/encryption/step_encrypt_resources.h index d6a8b19..628b0e9 100644 --- a/src/wgt/step/step_encrypt_resources.h +++ b/src/wgt/step/encryption/step_encrypt_resources.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_ENCRYPT_RESOURCES_H_ -#define WGT_STEP_STEP_ENCRYPT_RESOURCES_H_ +#ifndef WGT_STEP_ENCRYPTION_STEP_ENCRYPT_RESOURCES_H_ +#define WGT_STEP_ENCRYPTION_STEP_ENCRYPT_RESOURCES_H_ #include @@ -13,7 +13,7 @@ #include "wgt/wgt_backend_data.h" namespace wgt { -namespace encrypt { +namespace encryption { /** * \brief Step that encrypt application resources files if flagged to do so @@ -66,7 +66,7 @@ class StepEncryptResources : public common_installer::Step { SCOPE_LOG_TAG(EncryptResources) }; -} // namespace encrypt +} // namespace encryption } // namespace wgt -#endif // WGT_STEP_STEP_ENCRYPT_RESOURCES_H_ +#endif // WGT_STEP_ENCRYPTION_STEP_ENCRYPT_RESOURCES_H_ diff --git a/src/wgt/step/step_remove_encryption_data.cc b/src/wgt/step/encryption/step_remove_encryption_data.cc similarity index 93% rename from src/wgt/step/step_remove_encryption_data.cc rename to src/wgt/step/encryption/step_remove_encryption_data.cc index 0c601d3..4baa502 100644 --- a/src/wgt/step/step_remove_encryption_data.cc +++ b/src/wgt/step/encryption/step_remove_encryption_data.cc @@ -2,14 +2,14 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_remove_encryption_data.h" +#include "wgt/step/encryption/step_remove_encryption_data.h" #include #include namespace wgt { -namespace encrypt { +namespace encryption { common_installer::Step::Status StepRemoveEncryptionData::process() { wae_app_type_e enc_type = @@ -50,5 +50,5 @@ common_installer::Step::Status StepRemoveEncryptionData::process() { return common_installer::Step::Status::ERROR; } -} // namespace encrypt +} // namespace encryption } // namespace wgt diff --git a/src/wgt/step/step_remove_encryption_data.h b/src/wgt/step/encryption/step_remove_encryption_data.h similarity index 78% rename from src/wgt/step/step_remove_encryption_data.h rename to src/wgt/step/encryption/step_remove_encryption_data.h index 6156e99..f372e39 100644 --- a/src/wgt/step/step_remove_encryption_data.h +++ b/src/wgt/step/encryption/step_remove_encryption_data.h @@ -2,15 +2,15 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_REMOVE_ENCRYPTION_DATA_H_ -#define WGT_STEP_STEP_REMOVE_ENCRYPTION_DATA_H_ +#ifndef WGT_STEP_ENCRYPTION_STEP_REMOVE_ENCRYPTION_DATA_H_ +#define WGT_STEP_ENCRYPTION_STEP_REMOVE_ENCRYPTION_DATA_H_ #include #include namespace wgt { -namespace encrypt { +namespace encryption { /** * This step remove encryption keys used for encryption during installation @@ -33,7 +33,7 @@ class StepRemoveEncryptionData : public common_installer::Step { SCOPE_LOG_TAG(RemoveEncryptionData) }; -} // namespace encrypt +} // namespace encryption } // namespace wgt -#endif // WGT_STEP_STEP_REMOVE_ENCRYPTION_DATA_H_ +#endif // WGT_STEP_ENCRYPTION_STEP_REMOVE_ENCRYPTION_DATA_H_ diff --git a/src/wgt/step/step_create_symbolic_link.cc b/src/wgt/step/filesystem/step_create_symbolic_link.cc similarity index 97% rename from src/wgt/step/step_create_symbolic_link.cc rename to src/wgt/step/filesystem/step_create_symbolic_link.cc index d8a18e7..bd3cc03 100644 --- a/src/wgt/step/step_create_symbolic_link.cc +++ b/src/wgt/step/filesystem/step_create_symbolic_link.cc @@ -3,7 +3,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_create_symbolic_link.h" +#include "wgt/step/filesystem/step_create_symbolic_link.h" #include #include diff --git a/src/wgt/step/step_create_symbolic_link.h b/src/wgt/step/filesystem/step_create_symbolic_link.h similarity index 86% rename from src/wgt/step/step_create_symbolic_link.h rename to src/wgt/step/filesystem/step_create_symbolic_link.h index df51fde..0efa491 100644 --- a/src/wgt/step/step_create_symbolic_link.h +++ b/src/wgt/step/filesystem/step_create_symbolic_link.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_CREATE_SYMBOLIC_LINK_H_ -#define WGT_STEP_STEP_CREATE_SYMBOLIC_LINK_H_ +#ifndef WGT_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_ +#define WGT_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_ #include @@ -58,4 +58,4 @@ class StepCreateSymbolicLink : public common_installer::Step { } // namespace filesystem } // namespace wgt -#endif // WGT_STEP_STEP_CREATE_SYMBOLIC_LINK_H_ +#endif // WGT_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_ diff --git a/src/wgt/step/step_wgt_patch_icons.cc b/src/wgt/step/filesystem/step_wgt_patch_icons.cc similarity index 96% rename from src/wgt/step/step_wgt_patch_icons.cc rename to src/wgt/step/filesystem/step_wgt_patch_icons.cc index 45da3de..d9a1827 100644 --- a/src/wgt/step/step_wgt_patch_icons.cc +++ b/src/wgt/step/filesystem/step_wgt_patch_icons.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_wgt_patch_icons.h" +#include "wgt/step/filesystem/step_wgt_patch_icons.h" #include diff --git a/src/wgt/step/step_wgt_patch_icons.h b/src/wgt/step/filesystem/step_wgt_patch_icons.h similarity index 83% rename from src/wgt/step/step_wgt_patch_icons.h rename to src/wgt/step/filesystem/step_wgt_patch_icons.h index c5eabaa..d4ff8fb 100644 --- a/src/wgt/step/step_wgt_patch_icons.h +++ b/src/wgt/step/filesystem/step_wgt_patch_icons.h @@ -2,8 +2,8 @@ // Use of this source code is governed by an apache-2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_WGT_PATCH_ICONS_H_ -#define WGT_STEP_STEP_WGT_PATCH_ICONS_H_ +#ifndef WGT_STEP_FILESYSTEM_STEP_WGT_PATCH_ICONS_H_ +#define WGT_STEP_FILESYSTEM_STEP_WGT_PATCH_ICONS_H_ #include @@ -34,4 +34,4 @@ class StepWgtPatchIcons : public common_installer::Step { } // namespace filesystem } // namespace wgt -#endif // WGT_STEP_STEP_WGT_PATCH_ICONS_H_ +#endif // WGT_STEP_FILESYSTEM_STEP_WGT_PATCH_ICONS_H_ diff --git a/src/wgt/step/step_wgt_patch_storage_directories.cc b/src/wgt/step/filesystem/step_wgt_patch_storage_directories.cc similarity index 97% rename from src/wgt/step/step_wgt_patch_storage_directories.cc rename to src/wgt/step/filesystem/step_wgt_patch_storage_directories.cc index e6f976e..3c5d9e9 100644 --- a/src/wgt/step/step_wgt_patch_storage_directories.cc +++ b/src/wgt/step/filesystem/step_wgt_patch_storage_directories.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by an apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_wgt_patch_storage_directories.h" +#include "wgt/step/filesystem/step_wgt_patch_storage_directories.h" #include #include diff --git a/src/wgt/step/step_wgt_patch_storage_directories.h b/src/wgt/step/filesystem/step_wgt_patch_storage_directories.h similarity index 82% rename from src/wgt/step/step_wgt_patch_storage_directories.h rename to src/wgt/step/filesystem/step_wgt_patch_storage_directories.h index 89992df..c3a61e9 100644 --- a/src/wgt/step/step_wgt_patch_storage_directories.h +++ b/src/wgt/step/filesystem/step_wgt_patch_storage_directories.h @@ -2,8 +2,8 @@ // Use of this source code is governed by an apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_WGT_PATCH_STORAGE_DIRECTORIES_H_ -#define WGT_STEP_STEP_WGT_PATCH_STORAGE_DIRECTORIES_H_ +#ifndef WGT_STEP_FILESYSTEM_STEP_WGT_PATCH_STORAGE_DIRECTORIES_H_ +#define WGT_STEP_FILESYSTEM_STEP_WGT_PATCH_STORAGE_DIRECTORIES_H_ #include #include @@ -36,4 +36,4 @@ class StepWgtPatchStorageDirectories : } // namespace filesystem } // namespace wgt -#endif // WGT_STEP_STEP_WGT_PATCH_STORAGE_DIRECTORIES_H_ +#endif // WGT_STEP_FILESYSTEM_STEP_WGT_PATCH_STORAGE_DIRECTORIES_H_ diff --git a/src/wgt/step/step_wgt_resource_directory.cc b/src/wgt/step/filesystem/step_wgt_resource_directory.cc similarity index 95% rename from src/wgt/step/step_wgt_resource_directory.cc rename to src/wgt/step/filesystem/step_wgt_resource_directory.cc index 33671e7..cf2e57f 100644 --- a/src/wgt/step/step_wgt_resource_directory.cc +++ b/src/wgt/step/filesystem/step_wgt_resource_directory.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_wgt_resource_directory.h" +#include "wgt/step/filesystem/step_wgt_resource_directory.h" #include diff --git a/src/wgt/step/step_wgt_resource_directory.h b/src/wgt/step/filesystem/step_wgt_resource_directory.h similarity index 88% rename from src/wgt/step/step_wgt_resource_directory.h rename to src/wgt/step/filesystem/step_wgt_resource_directory.h index 60717ec..7fa9a4c 100644 --- a/src/wgt/step/step_wgt_resource_directory.h +++ b/src/wgt/step/filesystem/step_wgt_resource_directory.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_WGT_RESOURCE_DIRECTORY_H_ -#define WGT_STEP_STEP_WGT_RESOURCE_DIRECTORY_H_ +#ifndef WGT_STEP_FILESYSTEM_STEP_WGT_RESOURCE_DIRECTORY_H_ +#define WGT_STEP_FILESYSTEM_STEP_WGT_RESOURCE_DIRECTORY_H_ #include @@ -59,4 +59,4 @@ class StepWgtResourceDirectory : public common_installer::Step { } // namespace filesystem } // namespace wgt -#endif // WGT_STEP_STEP_WGT_RESOURCE_DIRECTORY_H_ +#endif // WGT_STEP_FILESYSTEM_STEP_WGT_RESOURCE_DIRECTORY_H_ diff --git a/src/wgt/step/step_generate_xml.cc b/src/wgt/step/pkgmgr/step_generate_xml.cc similarity index 99% rename from src/wgt/step/step_generate_xml.cc rename to src/wgt/step/pkgmgr/step_generate_xml.cc index a90b3bb..0b21b3c 100644 --- a/src/wgt/step/step_generate_xml.cc +++ b/src/wgt/step/pkgmgr/step_generate_xml.cc @@ -3,7 +3,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_generate_xml.h" +#include "wgt/step/pkgmgr/step_generate_xml.h" #include #include diff --git a/src/wgt/step/step_generate_xml.h b/src/wgt/step/pkgmgr/step_generate_xml.h similarity index 88% rename from src/wgt/step/step_generate_xml.h rename to src/wgt/step/pkgmgr/step_generate_xml.h index 0f62498..00b82e6 100644 --- a/src/wgt/step/step_generate_xml.h +++ b/src/wgt/step/pkgmgr/step_generate_xml.h @@ -3,8 +3,8 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_GENERATE_XML_H_ -#define WGT_STEP_STEP_GENERATE_XML_H_ +#ifndef WGT_STEP_PKGMGR_STEP_GENERATE_XML_H_ +#define WGT_STEP_PKGMGR_STEP_GENERATE_XML_H_ #include @@ -43,4 +43,4 @@ class StepGenerateXml : public common_installer::Step { } // namespace pkgmgr } // namespace wgt -#endif // WGT_STEP_STEP_GENERATE_XML_H_ +#endif // WGT_STEP_PKGMGR_STEP_GENERATE_XML_H_ diff --git a/src/wgt/step/step_rds_modify.cc b/src/wgt/step/rds/step_rds_modify.cc similarity index 99% rename from src/wgt/step/step_rds_modify.cc rename to src/wgt/step/rds/step_rds_modify.cc index 95fab9f..83937cf 100644 --- a/src/wgt/step/step_rds_modify.cc +++ b/src/wgt/step/rds/step_rds_modify.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_rds_modify.h" +#include "wgt/step/rds/step_rds_modify.h" #include diff --git a/src/wgt/step/step_rds_modify.h b/src/wgt/step/rds/step_rds_modify.h similarity index 94% rename from src/wgt/step/step_rds_modify.h rename to src/wgt/step/rds/step_rds_modify.h index 4f0a289..31d4c3b 100644 --- a/src/wgt/step/step_rds_modify.h +++ b/src/wgt/step/rds/step_rds_modify.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_RDS_MODIFY_H_ -#define WGT_STEP_STEP_RDS_MODIFY_H_ +#ifndef WGT_STEP_RDS_STEP_RDS_MODIFY_H_ +#define WGT_STEP_RDS_STEP_RDS_MODIFY_H_ #include #include @@ -84,4 +84,5 @@ class StepRDSModify : public common_installer::Step { }; } // namespace rds } // namespace wgt -#endif // WGT_STEP_STEP_RDS_MODIFY_H_ + +#endif // WGT_STEP_RDS_STEP_RDS_MODIFY_H_ diff --git a/src/wgt/step/step_rds_parse.cc b/src/wgt/step/rds/step_rds_parse.cc similarity index 97% rename from src/wgt/step/step_rds_parse.cc rename to src/wgt/step/rds/step_rds_parse.cc index 2a459a0..31ce2b4 100644 --- a/src/wgt/step/step_rds_parse.cc +++ b/src/wgt/step/rds/step_rds_parse.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_rds_parse.h" +#include "wgt/step/rds/step_rds_parse.h" #include diff --git a/src/wgt/step/step_rds_parse.h b/src/wgt/step/rds/step_rds_parse.h similarity index 90% rename from src/wgt/step/step_rds_parse.h rename to src/wgt/step/rds/step_rds_parse.h index 5aea60e..649df10 100644 --- a/src/wgt/step/step_rds_parse.h +++ b/src/wgt/step/rds/step_rds_parse.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_RDS_PARSE_H_ -#define WGT_STEP_STEP_RDS_PARSE_H_ +#ifndef WGT_STEP_RDS_STEP_RDS_PARSE_H_ +#define WGT_STEP_RDS_STEP_RDS_PARSE_H_ #include @@ -56,6 +56,8 @@ class StepRDSParse : public common_installer::Step { private: boost::filesystem::path rds_file_path_; }; + } // namespace rds } // namespace wgt -#endif // WGT_STEP_STEP_RDS_PARSE_H_ + +#endif // WGT_STEP_RDS_STEP_RDS_PARSE_H_ diff --git a/src/wgt/step/step_add_default_privileges.cc b/src/wgt/step/security/step_add_default_privileges.cc similarity index 93% rename from src/wgt/step/step_add_default_privileges.cc rename to src/wgt/step/security/step_add_default_privileges.cc index 18eb902..3cbbe1f 100644 --- a/src/wgt/step/step_add_default_privileges.cc +++ b/src/wgt/step/security/step_add_default_privileges.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_add_default_privileges.h" +#include "wgt/step/security/step_add_default_privileges.h" #include diff --git a/src/wgt/step/step_add_default_privileges.h b/src/wgt/step/security/step_add_default_privileges.h similarity index 86% rename from src/wgt/step/step_add_default_privileges.h rename to src/wgt/step/security/step_add_default_privileges.h index 928ab84..b7759a9 100644 --- a/src/wgt/step/step_add_default_privileges.h +++ b/src/wgt/step/security/step_add_default_privileges.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_ADD_DEFAULT_PRIVILEGES_H_ -#define WGT_STEP_STEP_ADD_DEFAULT_PRIVILEGES_H_ +#ifndef WGT_STEP_SECURITY_STEP_ADD_DEFAULT_PRIVILEGES_H_ +#define WGT_STEP_SECURITY_STEP_ADD_DEFAULT_PRIVILEGES_H_ #include @@ -56,4 +56,4 @@ class StepAddDefaultPrivileges : public common_installer::Step { } // namespace security } // namespace wgt -#endif // WGT_STEP_STEP_ADD_DEFAULT_PRIVILEGES_H_ +#endif // WGT_STEP_SECURITY_STEP_ADD_DEFAULT_PRIVILEGES_H_ diff --git a/src/wgt/step/step_check_settings_level.cc b/src/wgt/step/security/step_check_settings_level.cc similarity index 96% rename from src/wgt/step/step_check_settings_level.cc rename to src/wgt/step/security/step_check_settings_level.cc index 9df2b19..270eb04 100644 --- a/src/wgt/step/step_check_settings_level.cc +++ b/src/wgt/step/security/step_check_settings_level.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_check_settings_level.h" +#include "wgt/step/security/step_check_settings_level.h" #include #include diff --git a/src/wgt/step/step_check_settings_level.h b/src/wgt/step/security/step_check_settings_level.h similarity index 87% rename from src/wgt/step/step_check_settings_level.h rename to src/wgt/step/security/step_check_settings_level.h index bac5bf2..3dfd8ac 100644 --- a/src/wgt/step/step_check_settings_level.h +++ b/src/wgt/step/security/step_check_settings_level.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_CHECK_SETTINGS_LEVEL_H_ -#define WGT_STEP_STEP_CHECK_SETTINGS_LEVEL_H_ +#ifndef WGT_STEP_SECURITY_STEP_CHECK_SETTINGS_LEVEL_H_ +#define WGT_STEP_SECURITY_STEP_CHECK_SETTINGS_LEVEL_H_ #include @@ -56,4 +56,4 @@ class StepCheckSettingsLevel : public common_installer::Step { } // namespace security } // namespace wgt -#endif // WGT_STEP_STEP_CHECK_SETTINGS_LEVEL_H_ +#endif // WGT_STEP_SECURITY_STEP_CHECK_SETTINGS_LEVEL_H_ diff --git a/src/wgt/step/step_check_wgt_background_category.cc b/src/wgt/step/security/step_check_wgt_background_category.cc similarity index 92% rename from src/wgt/step/step_check_wgt_background_category.cc rename to src/wgt/step/security/step_check_wgt_background_category.cc index 087b37b..cd59ef6 100644 --- a/src/wgt/step/step_check_wgt_background_category.cc +++ b/src/wgt/step/security/step_check_wgt_background_category.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "wgt/step/step_check_wgt_background_category.h" +#include "wgt/step/security/step_check_wgt_background_category.h" #include #include diff --git a/src/wgt/step/step_check_wgt_background_category.h b/src/wgt/step/security/step_check_wgt_background_category.h similarity index 74% rename from src/wgt/step/step_check_wgt_background_category.h rename to src/wgt/step/security/step_check_wgt_background_category.h index 33b5b23..dd21574 100644 --- a/src/wgt/step/step_check_wgt_background_category.h +++ b/src/wgt/step/security/step_check_wgt_background_category.h @@ -2,10 +2,10 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#ifndef WGT_STEP_STEP_CHECK_WGT_BACKGROUND_CATEGORY_H_ -#define WGT_STEP_STEP_CHECK_WGT_BACKGROUND_CATEGORY_H_ +#ifndef WGT_STEP_SECURITY_STEP_CHECK_WGT_BACKGROUND_CATEGORY_H_ +#define WGT_STEP_SECURITY_STEP_CHECK_WGT_BACKGROUND_CATEGORY_H_ -#include +#include #include namespace wgt { @@ -28,4 +28,4 @@ class StepCheckWgtBackgroundCategory : } // namespace security } // namespace wgt -#endif // WGT_STEP_STEP_CHECK_WGT_BACKGROUND_CATEGORY_H_ +#endif // WGT_STEP_SECURITY_STEP_CHECK_WGT_BACKGROUND_CATEGORY_H_ diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc index fa66402..d332c57 100644 --- a/src/wgt/wgt_installer.cc +++ b/src/wgt/wgt_installer.cc @@ -5,63 +5,65 @@ #include "wgt/wgt_installer.h" #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include "wgt/step/step_add_default_privileges.h" -#include "wgt/step/step_check_settings_level.h" -#include "wgt/step/step_check_wgt_background_category.h" -#include "wgt/step/step_create_symbolic_link.h" -#include "wgt/step/step_encrypt_resources.h" -#include "wgt/step/step_generate_xml.h" -#include "wgt/step/step_parse.h" -#include "wgt/step/step_parse_recovery.h" -#include "wgt/step/step_rds_modify.h" -#include "wgt/step/step_rds_parse.h" -#include "wgt/step/step_remove_encryption_data.h" -#include "wgt/step/step_wgt_patch_icons.h" -#include "wgt/step/step_wgt_patch_storage_directories.h" -#include "wgt/step/step_wgt_resource_directory.h" + +#include "wgt/step/configuration/step_parse.h" +#include "wgt/step/configuration/step_parse_recovery.h" +#include "wgt/step/encryption/step_encrypt_resources.h" +#include "wgt/step/encryption/step_remove_encryption_data.h" +#include "wgt/step/filesystem/step_create_symbolic_link.h" +#include "wgt/step/filesystem/step_wgt_patch_icons.h" +#include "wgt/step/filesystem/step_wgt_patch_storage_directories.h" +#include "wgt/step/filesystem/step_wgt_resource_directory.h" +#include "wgt/step/pkgmgr/step_generate_xml.h" +#include "wgt/step/rds/step_rds_modify.h" +#include "wgt/step/rds/step_rds_parse.h" +#include "wgt/step/security/step_add_default_privileges.h" +#include "wgt/step/security/step_check_settings_level.h" +#include "wgt/step/security/step_check_wgt_background_category.h" namespace ci = common_installer; @@ -76,13 +78,13 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) case ci::RequestType::Install : { AddStep(pkgmgr_); AddStep(); - AddStep(true); - AddStep(); + AddStep(true); + AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -102,17 +104,17 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) case ci::RequestType::Update: { AddStep(pkgmgr_); AddStep(); - AddStep(true); - AddStep(); + AddStep(true); + AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::INSTALLED, - ci::parse::StepParseManifest::StoreLocation::BACKUP); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, + ci::configuration::StepParseManifest::StoreLocation::BACKUP); AddStep(); AddStep(); AddStep(); @@ -132,9 +134,9 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) case ci::RequestType::Uninstall: { AddStep(pkgmgr_); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::INSTALLED, - ci::parse::StepParseManifest::StoreLocation::NORMAL); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, + ci::configuration::StepParseManifest::StoreLocation::NORMAL); AddStep(); AddStep( ci::Plugin::ActionType::Uninstall); @@ -143,19 +145,19 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep(); AddStep(); AddStep(); break; } case ci::RequestType::Reinstall: { AddStep(pkgmgr_); - AddStep(false); + AddStep(false); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::INSTALLED, - ci::parse::StepParseManifest::StoreLocation::BACKUP); - AddStep(); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, + ci::configuration::StepParseManifest::StoreLocation::BACKUP); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -165,19 +167,20 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(pkgmgr_); AddStep(); // TODO(t.iwanek): manifest is parsed twice... - AddStep(false); // start file may not have changed + AddStep(false); + // start file may not have changed AddStep("res/wgt/"); - AddStep(true); - AddStep(); + AddStep(true); + AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); AddStep(); - AddStep( - ci::parse::StepParseManifest::ManifestLocation::INSTALLED, - ci::parse::StepParseManifest::StoreLocation::BACKUP); + AddStep( + ci::configuration::StepParseManifest::ManifestLocation::INSTALLED, + ci::configuration::StepParseManifest::StoreLocation::BACKUP); AddStep(); AddStep(); AddStep(); @@ -197,7 +200,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) case ci::RequestType::Recovery: { AddStep(pkgmgr_); AddStep(); - AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); -- 2.7.4 From ffe3ee9014033ca87189450935a5d07e99a52eeb Mon Sep 17 00:00:00 2001 From: JongHeon Choi Date: Fri, 18 Mar 2016 11:03:18 +0900 Subject: [PATCH 13/16] Modify symlink for watchapp Change-Id: I209698d952602b90bd72dd0c3b445d743d1c26ad --- src/wgt/step/filesystem/step_create_symbolic_link.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wgt/step/filesystem/step_create_symbolic_link.cc b/src/wgt/step/filesystem/step_create_symbolic_link.cc index bd3cc03..397c7d8 100644 --- a/src/wgt/step/filesystem/step_create_symbolic_link.cc +++ b/src/wgt/step/filesystem/step_create_symbolic_link.cc @@ -44,6 +44,8 @@ common_installer::Step::Status StepCreateSymbolicLink::process() { if (strcmp(app->component_type, "uiapp") == 0) { bf::create_symlink(bf::path(WRT_LAUNCHER), exec_path, error); + } else if (strcmp(app->component_type, "watchapp") == 0) { + bf::create_symlink(bf::path(WRT_LAUNCHER), exec_path, error); } else { bf::create_symlink(kWrtServiceBinaryPath, exec_path, error); } -- 2.7.4 From bf079f38d5dfdb0ac0ec1c12b29d0ffd3d6338d6 Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Thu, 24 Mar 2016 10:06:29 +0100 Subject: [PATCH 14/16] Typo Change-Id: Ia956bce9cfb391d7540f3632a98ad64e74e1334a --- src/unit_tests/smoke_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unit_tests/smoke_test.cc b/src/unit_tests/smoke_test.cc index 00bc484..7086e91 100644 --- a/src/unit_tests/smoke_test.cc +++ b/src/unit_tests/smoke_test.cc @@ -303,7 +303,7 @@ ci::AppInstaller::Result Reinstall(const bf::path& path, ci::AppInstaller::Result DeltaInstall(const bf::path& path, const bf::path& delta_package, PackageType type) { if (Install(path, type) != ci::AppInstaller::Result::OK) { - LOG(ERROR) << "Failed to install application. Cannot perform RDS"; + LOG(ERROR) << "Failed to install application. Cannot perform delta update"; return ci::AppInstaller::Result::UNKNOWN; } return Install(delta_package, type); -- 2.7.4 From 6c6807c018afaa6189cf53ed60a5c2a224cde01d Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Fri, 25 Mar 2016 11:32:25 +0100 Subject: [PATCH 15/16] Implement coping TEP in wgt and hybrid backend To verify, run install|update for wgt package and hybrid package, check if tep_package was copied (use any file as tep package) wgt-backend -i ${wgt_or_hybrid_package} -e ${your tep zip} Given tep file should be copied into res/ directory in package files. Change-Id: I87e38d76f582646ed01a1b74b7ec7580ca1fe4bb --- src/hybrid/hybrid_installer.cc | 6 ++++++ src/wgt/wgt_installer.cc | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/hybrid/hybrid_installer.cc b/src/hybrid/hybrid_installer.cc index b12354d..9d5675f 100644 --- a/src/hybrid/hybrid_installer.cc +++ b/src/hybrid/hybrid_installer.cc @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -34,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -86,6 +88,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -122,6 +125,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -134,6 +138,8 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep( ci::Plugin::ActionType::Upgrade); + // TODO(t.iwanek): this step is supposed to be removed as it is quickfix + AddStep(); break; case ci::RequestType::Uninstall: AddStep(pkgmgr_); diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc index d332c57..b0a5dea 100644 --- a/src/wgt/wgt_installer.cc +++ b/src/wgt/wgt_installer.cc @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -37,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -88,6 +90,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -119,6 +122,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -129,6 +133,8 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep( ci::Plugin::ActionType::Upgrade); AddStep(); + // TODO(t.iwanek): this step is supposed to be removed as it is quickfix + AddStep(); break; } case ci::RequestType::Uninstall: { -- 2.7.4 From 730251e509028a658d3aa48a76cbc813af074855 Mon Sep 17 00:00:00 2001 From: jongmyeong ko Date: Fri, 1 Apr 2016 04:26:29 -0700 Subject: [PATCH 16/16] Revert "Implement coping TEP in wgt and hybrid backend" This reverts commit 6c6807c018afaa6189cf53ed60a5c2a224cde01d. Change-Id: I9ee651776b024abcacc5fd47f44a0d4dbb6e2d1f --- src/hybrid/hybrid_installer.cc | 6 ------ src/wgt/wgt_installer.cc | 6 ------ 2 files changed, 12 deletions(-) diff --git a/src/hybrid/hybrid_installer.cc b/src/hybrid/hybrid_installer.cc index 9d5675f..b12354d 100644 --- a/src/hybrid/hybrid_installer.cc +++ b/src/hybrid/hybrid_installer.cc @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -35,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -88,7 +86,6 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); - AddStep(); AddStep(); AddStep(); AddStep(); @@ -125,7 +122,6 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep(); AddStep(); - AddStep(); AddStep(); AddStep(); AddStep(); @@ -138,8 +134,6 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr) AddStep(); AddStep( ci::Plugin::ActionType::Upgrade); - // TODO(t.iwanek): this step is supposed to be removed as it is quickfix - AddStep(); break; case ci::RequestType::Uninstall: AddStep(pkgmgr_); diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc index b0a5dea..d332c57 100644 --- a/src/wgt/wgt_installer.cc +++ b/src/wgt/wgt_installer.cc @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -38,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -90,7 +88,6 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); - AddStep(); AddStep(); AddStep(); AddStep(); @@ -122,7 +119,6 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep(); AddStep(); AddStep(); - AddStep(); AddStep(); AddStep(); AddStep(); @@ -133,8 +129,6 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr) AddStep( ci::Plugin::ActionType::Upgrade); AddStep(); - // TODO(t.iwanek): this step is supposed to be removed as it is quickfix - AddStep(); break; } case ci::RequestType::Uninstall: { -- 2.7.4