From 728329241be7dd142df0a498ec97f54e90962f02 Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Fri, 4 Mar 2016 14:02:17 +0100 Subject: [PATCH] Manifest tests - defaults for manifest_x Requires: - https://review.tizen.org/gerrit/61384 - https://review.tizen.org/gerrit/61385 Verify: /usr/bin/tpk-backend-ut/manifest-test --gtest_filter=*_SetManifestXDefaults 4 tests should pass. Change-Id: Idb94fe4415db2ebdab0e329a8968f3ad6b6db6b0 --- .../manifest_test_service_application.cc | 38 ++++++++++++++++++++++ src/unit_tests/manifest_test_ui_application.cc | 13 ++++++-- src/unit_tests/manifest_test_watch_application.cc | 38 ++++++++++++++++++++++ src/unit_tests/manifest_test_widget_application.cc | 38 ++++++++++++++++++++++ .../tizen-manifest.xml | 5 +++ .../tizen-manifest.xml | 5 +++ .../tizen-manifest.xml | 5 +++ .../tizen-manifest.xml | 5 +++ 8 files changed, 144 insertions(+), 3 deletions(-) create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.ServiceApplicationElement_SetManifestXDefaults/tizen-manifest.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.UIApplicationElement_SetManifestXDefaults/tizen-manifest.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.WatchApplicationElement_SetManifestXDefaults/tizen-manifest.xml create mode 100644 src/unit_tests/test_samples/manifest/ManifestTest.WidgetApplicationElement_SetManifestXDefaults/tizen-manifest.xml diff --git a/src/unit_tests/manifest_test_service_application.cc b/src/unit_tests/manifest_test_service_application.cc index 1493435..264b4ee 100644 --- a/src/unit_tests/manifest_test_service_application.cc +++ b/src/unit_tests/manifest_test_service_application.cc @@ -521,3 +521,41 @@ TEST_F(ManifestTest, ServiceApplicationElement_Icon_Valid) { ASSERT_EQ(bf::path((*icons.begin())->text).filename().string(), "test_icon.png"); } + +TEST_F(ManifestTest, ServiceApplicationElement_SetManifestXDefaults) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + ASSERT_CSTR_EQ(m->package, "package0id"); + ASSERT_CSTR_EQ(m->version, "1.0.0"); + ASSERT_CSTR_EQ(m->installlocation, "auto"); + ASSERT_CSTR_EQ(m->appsetting, "false"); + ASSERT_CSTR_EQ(m->type, "tpk"); + ASSERT_NE(m->installed_time, nullptr); + ASSERT_CSTR_EQ(m->mainapp_id, "package0id.appid"); + ASSERT_CSTR_EQ(m->nodisplay_setting, "false"); + ASSERT_CSTR_EQ(m->support_disable, "false"); + ASSERT_CSTR_EQ(m->api_version, "2.3"); + auto apps = GListRange(m->application); + ASSERT_EQ(Size(&apps), 1); + application_x* app = *apps.begin(); + ASSERT_CSTR_EQ(app->appid, "package0id.appid"); + ASSERT_NE(app->exec, nullptr); + ASSERT_CSTR_EQ(app->nodisplay, "true"); + ASSERT_CSTR_EQ(app->multiple, "false"); + ASSERT_CSTR_EQ(app->taskmanage, "true"); + ASSERT_CSTR_EQ(app->enabled, "true"); + ASSERT_CSTR_EQ(app->hwacceleration, "default"); + ASSERT_CSTR_EQ(app->screenreader, "use-system-setting"); + ASSERT_CSTR_EQ(app->component_type, "svcapp"); + ASSERT_CSTR_EQ(app->mainapp, "true"); + ASSERT_CSTR_EQ(app->recentimage, "false"); + ASSERT_CSTR_EQ(app->launchcondition, "false"); + ASSERT_CSTR_EQ(app->indicatordisplay, "true"); + ASSERT_CSTR_EQ(app->effectimage_type, "image"); + ASSERT_CSTR_EQ(app->guestmode_visibility, "true"); + ASSERT_CSTR_EQ(app->permission_type, "normal"); + ASSERT_CSTR_EQ(app->submode, "false"); + ASSERT_CSTR_EQ(app->process_pool, "false"); +} diff --git a/src/unit_tests/manifest_test_ui_application.cc b/src/unit_tests/manifest_test_ui_application.cc index 8b4b935..c550bb3 100644 --- a/src/unit_tests/manifest_test_ui_application.cc +++ b/src/unit_tests/manifest_test_ui_application.cc @@ -584,10 +584,9 @@ TEST_F(ManifestTest, UIApplicationElement_SetManifestXDefaults) { ASSERT_NE(m, nullptr); ASSERT_CSTR_EQ(m->package, "package0id"); ASSERT_CSTR_EQ(m->version, "1.0.0"); - ASSERT_CSTR_EQ(m->installlocation, "internal-only"); + ASSERT_CSTR_EQ(m->installlocation, "auto"); ASSERT_CSTR_EQ(m->appsetting, "false"); ASSERT_CSTR_EQ(m->type, "tpk"); - ASSERT_NE(m->package_size, nullptr); ASSERT_NE(m->installed_time, nullptr); ASSERT_CSTR_EQ(m->mainapp_id, "package0id.appid"); ASSERT_CSTR_EQ(m->nodisplay_setting, "false"); @@ -604,7 +603,15 @@ TEST_F(ManifestTest, UIApplicationElement_SetManifestXDefaults) { ASSERT_CSTR_EQ(app->enabled, "true"); ASSERT_CSTR_EQ(app->hwacceleration, "default"); ASSERT_CSTR_EQ(app->screenreader, "use-system-setting"); - ASSERT_CSTR_EQ(app->screenreader, "use-system-setting"); ASSERT_CSTR_EQ(app->component_type, "uiapp"); ASSERT_CSTR_EQ(app->mainapp, "true"); + ASSERT_CSTR_EQ(app->recentimage, "false"); + ASSERT_CSTR_EQ(app->launchcondition, "false"); + ASSERT_CSTR_EQ(app->indicatordisplay, "true"); + ASSERT_CSTR_EQ(app->effectimage_type, "image"); + ASSERT_CSTR_EQ(app->guestmode_visibility, "true"); + ASSERT_CSTR_EQ(app->permission_type, "normal"); + ASSERT_CSTR_EQ(app->component_type, "uiapp"); + ASSERT_CSTR_EQ(app->submode, "false"); + ASSERT_CSTR_EQ(app->process_pool, "false"); } diff --git a/src/unit_tests/manifest_test_watch_application.cc b/src/unit_tests/manifest_test_watch_application.cc index f1703a4..0fcfcd8 100644 --- a/src/unit_tests/manifest_test_watch_application.cc +++ b/src/unit_tests/manifest_test_watch_application.cc @@ -109,3 +109,41 @@ TEST_F(ManifestTest, WatchApplicationElement_AmbientSupport_Invalid) { StepParseRunner runner(GetMyName()); ASSERT_FALSE(runner.Run()); } + +TEST_F(ManifestTest, WatchApplicationElement_SetManifestXDefaults) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + ASSERT_CSTR_EQ(m->package, "package0id"); + ASSERT_CSTR_EQ(m->version, "1.0.0"); + ASSERT_CSTR_EQ(m->installlocation, "auto"); + ASSERT_CSTR_EQ(m->appsetting, "false"); + ASSERT_CSTR_EQ(m->type, "tpk"); + ASSERT_NE(m->installed_time, nullptr); + ASSERT_CSTR_EQ(m->mainapp_id, "package0id.appid"); + ASSERT_CSTR_EQ(m->nodisplay_setting, "false"); + ASSERT_CSTR_EQ(m->support_disable, "false"); + ASSERT_CSTR_EQ(m->api_version, "2.3"); + auto apps = GListRange(m->application); + ASSERT_EQ(Size(&apps), 1); + application_x* app = *apps.begin(); + ASSERT_CSTR_EQ(app->appid, "package0id.appid"); + ASSERT_NE(app->exec, nullptr); + ASSERT_CSTR_EQ(app->nodisplay, "false"); + ASSERT_CSTR_EQ(app->multiple, "false"); + ASSERT_CSTR_EQ(app->taskmanage, "false"); + ASSERT_CSTR_EQ(app->enabled, "true"); + ASSERT_CSTR_EQ(app->hwacceleration, "default"); + ASSERT_CSTR_EQ(app->screenreader, "use-system-setting"); + ASSERT_CSTR_EQ(app->component_type, "watchapp"); + ASSERT_CSTR_EQ(app->mainapp, "true"); + ASSERT_CSTR_EQ(app->recentimage, "false"); + ASSERT_CSTR_EQ(app->launchcondition, "false"); + ASSERT_CSTR_EQ(app->indicatordisplay, "true"); + ASSERT_CSTR_EQ(app->effectimage_type, "image"); + ASSERT_CSTR_EQ(app->guestmode_visibility, "true"); + ASSERT_CSTR_EQ(app->permission_type, "normal"); + ASSERT_CSTR_EQ(app->submode, "false"); + ASSERT_CSTR_EQ(app->process_pool, "false"); +} diff --git a/src/unit_tests/manifest_test_widget_application.cc b/src/unit_tests/manifest_test_widget_application.cc index bf75425..4ed9446 100644 --- a/src/unit_tests/manifest_test_widget_application.cc +++ b/src/unit_tests/manifest_test_widget_application.cc @@ -148,3 +148,41 @@ TEST_F(ManifestTest, WidgetApplicationElement_Main_TakeMarked) { } // preview, update-period, support-size are supposed to be parsed by plugin + +TEST_F(ManifestTest, WidgetApplicationElement_SetManifestXDefaults) { + StepParseRunner runner(GetMyName()); + ASSERT_TRUE(runner.Run()); + manifest_x* m = runner.GetManifest(); + ASSERT_NE(m, nullptr); + ASSERT_CSTR_EQ(m->package, "package0id"); + ASSERT_CSTR_EQ(m->version, "1.0.0"); + ASSERT_CSTR_EQ(m->installlocation, "auto"); + ASSERT_CSTR_EQ(m->appsetting, "false"); + ASSERT_CSTR_EQ(m->type, "tpk"); + ASSERT_NE(m->installed_time, nullptr); + ASSERT_CSTR_EQ(m->mainapp_id, "package0id.appid"); + ASSERT_CSTR_EQ(m->nodisplay_setting, "false"); + ASSERT_CSTR_EQ(m->support_disable, "false"); + ASSERT_CSTR_EQ(m->api_version, "2.3"); + auto apps = GListRange(m->application); + ASSERT_EQ(Size(&apps), 1); + application_x* app = *apps.begin(); + ASSERT_CSTR_EQ(app->appid, "package0id.appid"); + ASSERT_NE(app->exec, nullptr); + ASSERT_CSTR_EQ(app->nodisplay, "true"); + ASSERT_CSTR_EQ(app->multiple, "false"); + ASSERT_CSTR_EQ(app->taskmanage, "false"); + ASSERT_CSTR_EQ(app->enabled, "true"); + ASSERT_CSTR_EQ(app->hwacceleration, "default"); + ASSERT_CSTR_EQ(app->screenreader, "use-system-setting"); + ASSERT_CSTR_EQ(app->component_type, "widgetapp"); + ASSERT_CSTR_EQ(app->mainapp, "true"); + ASSERT_CSTR_EQ(app->recentimage, "false"); + ASSERT_CSTR_EQ(app->launchcondition, "false"); + ASSERT_CSTR_EQ(app->indicatordisplay, "false"); + ASSERT_CSTR_EQ(app->effectimage_type, "image"); + ASSERT_CSTR_EQ(app->guestmode_visibility, "true"); + ASSERT_CSTR_EQ(app->permission_type, "normal"); + ASSERT_CSTR_EQ(app->submode, "false"); + ASSERT_CSTR_EQ(app->process_pool, "false"); +} diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ServiceApplicationElement_SetManifestXDefaults/tizen-manifest.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ServiceApplicationElement_SetManifestXDefaults/tizen-manifest.xml new file mode 100644 index 0000000..08f42fa --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.ServiceApplicationElement_SetManifestXDefaults/tizen-manifest.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.UIApplicationElement_SetManifestXDefaults/tizen-manifest.xml b/src/unit_tests/test_samples/manifest/ManifestTest.UIApplicationElement_SetManifestXDefaults/tizen-manifest.xml new file mode 100644 index 0000000..f0bba4a --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.UIApplicationElement_SetManifestXDefaults/tizen-manifest.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.WatchApplicationElement_SetManifestXDefaults/tizen-manifest.xml b/src/unit_tests/test_samples/manifest/ManifestTest.WatchApplicationElement_SetManifestXDefaults/tizen-manifest.xml new file mode 100644 index 0000000..8e9bcce --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.WatchApplicationElement_SetManifestXDefaults/tizen-manifest.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.WidgetApplicationElement_SetManifestXDefaults/tizen-manifest.xml b/src/unit_tests/test_samples/manifest/ManifestTest.WidgetApplicationElement_SetManifestXDefaults/tizen-manifest.xml new file mode 100644 index 0000000..55e6da9 --- /dev/null +++ b/src/unit_tests/test_samples/manifest/ManifestTest.WidgetApplicationElement_SetManifestXDefaults/tizen-manifest.xml @@ -0,0 +1,5 @@ + + + + + -- 2.7.4