From: Junseok Kim Date: Fri, 14 Jun 2024 09:06:33 +0000 (+0900) Subject: Add new tests for output resolution X-Git-Tag: accepted/tizen/unified/20240727.112808~42 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee900cd32f21ee703aa5ade6d1d4aaa3fd76fde9;p=platform%2Fcore%2Fuifw%2Fe-tizen-testcase.git Add new tests for output resolution Change-Id: I0a8b1b9039673d189304b2ea0561b3bde0445813 --- diff --git a/src/Makefile.am b/src/Makefile.am index 42ce04a..6c51ce3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -29,7 +29,8 @@ testcase/0016_background_state.cpp \ testcase/0017_input_sync.cpp \ testcase/0018_input_region.cpp \ testcase/0019_cnp.cpp \ -testcase/0020_dnd.cpp +testcase/0020_dnd.cpp \ +testcase/0021_output_resolution.cpp e_tizen_unittests_SOURCES = \ e_test_main.cpp \ diff --git a/src/testcase/0021_output_resolution.cpp b/src/testcase/0021_output_resolution.cpp new file mode 100644 index 0000000..d7c59c6 --- /dev/null +++ b/src/testcase/0021_output_resolution.cpp @@ -0,0 +1,79 @@ +#include + +#include "e_test_event.h" +#include "e_test_base.h" +#include "e_test_efl_util.h" + +#define CONFIGURED_OUTPUT_RESOLUTION_W 1280 +#define CONFIGURED_OUTPUT_RESOLUTION_H 720 + +#define BASE_OUTPUT_RESOLUTION_W 640 +#define BASE_OUTPUT_RESOLUTION_H 540 + +class etTestOutputResolution : public ::etTCBase +{ +public: + etTestOutputResolution() { }; + ~etTestOutputResolution() { }; + +protected: + std::string testCaseName; + std::string testName; + etWin *tw_red = NULL; + + void initTC(); +}; + +void +etTestOutputResolution::initTC() +{ + const ::testing::TestInfo *const test_info = ::testing::UnitTest::GetInstance()->current_test_info(); + + testCaseName = test_info->test_case_name(); + testName = test_info->name(); +} + +TEST_F(etTestOutputResolution, basic) +{ + int res = 0; + + initTC(); + + res = etRunner::get().setConfiguredOutputResolution(CONFIGURED_OUTPUT_RESOLUTION_W, CONFIGURED_OUTPUT_RESOLUTION_H); + ASSERT_EQ(res, 1); + + tw_red = initNormalWin("TCWin_Red", 0, 0, 100, 100, E_TC_WIN_COLOR_RED); + showTCWin(tw_red); + ASSERT_FOCUS_IN(tw_red); + ASSERT_TRUE(tw_red != NULL) << "failed to initiation window"; + + res = etRunner::get().unsetConfiguredOutputResolution(); + ASSERT_EQ(res, 0); + + ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE); +} + +TEST_F(etTestOutputResolution, base_output_resolution_basic) +{ + int res = 0; + + initTC(); + + res = etRunner::get().setConfiguredOutputResolution(CONFIGURED_OUTPUT_RESOLUTION_W, CONFIGURED_OUTPUT_RESOLUTION_H); + ASSERT_EQ(res, 1); + res = etRunner::get().setBaseOutputResolution(getpid(), BASE_OUTPUT_RESOLUTION_W, BASE_OUTPUT_RESOLUTION_H); + ASSERT_EQ(res, 1); + + tw_red = initNormalWin("TCWin_Red", 0, 0, 100, 100, E_TC_WIN_COLOR_RED); + showTCWin(tw_red); + ASSERT_FOCUS_IN(tw_red); + ASSERT_TRUE(tw_red != NULL) << "failed to initiation window"; + + res = etRunner::get().unsetBaseOutputResolution(getpid()); + ASSERT_EQ(res, 0); + + res = etRunner::get().unsetConfiguredOutputResolution(); + ASSERT_EQ(res, 0); + + ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE); +} \ No newline at end of file