From: Arkadiusz Szulakiewicz Date: Fri, 4 Mar 2016 09:03:02 +0000 (+0100) Subject: Add tests for Setting element in config.xml X-Git-Tag: accepted/tizen/ivi/20160310.061821 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=37de9c237f4d5f2ea391e494175ddfacd7f7c8ce;p=platform%2Fcore%2Fappfw%2Fwgt-backend.git Add tests for Setting element in config.xml Change-Id: I5611261dc271b305191526e4e774e48f16d02e36 --- 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 @@ + + + + + + + + + + +