diff options
author | YoungHun Cho <hoon.cho@samsung.com> | 2017-08-21 15:41:52 +0900 |
---|---|---|
committer | YoungHun Cho <hoon.cho@samsung.com> | 2017-08-21 15:59:32 +0900 |
commit | c34341de985e0d0f983e3de21ccffe517e320c2a (patch) | |
tree | 47ff7ca521eb369d728f38ea5da81b4926e9cec9 | |
parent | d26c273ae50a1b2fd9e41220b99feabd32f48d50 (diff) | |
download | w3-home-c34341de985e0d0f983e3de21ccffe517e320c2a.tar.gz w3-home-c34341de985e0d0f983e3de21ccffe517e320c2a.tar.bz2 w3-home-c34341de985e0d0f983e3de21ccffe517e320c2a.zip |
apps focus text : 3 lines
Change-Id: I15c08ad52e59861a6cedde339bf4832efea2ac04
-rwxr-xr-x | CMakeLists.txt | 1 | ||||
-rwxr-xr-x | res/edje/circle/apps_base_layout_circle.edc | 4 | ||||
-rwxr-xr-x | src/apps/apps_view_circle.c | 9 | ||||
-rwxr-xr-x | src/moments/moments_control_view.c | 5 | ||||
-rwxr-xr-x | src/widget.c | 1 | ||||
-rwxr-xr-x | test/feature_test/feature_test.c | 1 | ||||
-rwxr-xr-x | test/feature_test/feature_test.h | 2 | ||||
-rwxr-xr-x | test/feature_test/group_feature_apps_focus_text.c | 107 | ||||
-rwxr-xr-x | test/test_function.h | 2 |
9 files changed, 127 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 73a2d78..3719099 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -236,6 +236,7 @@ ADD_EXECUTABLE(${PROJECT_NAME} test/feature_test/group_feature_moments_controls_state.c test/feature_test/group_feature_moments_control_button_status_behavior.c test/feature_test/group_feature_moments_center_layout_show.c + test/feature_test/group_feature_apps_focus_text.c test/unit/unit_assert.c test/unit/unit.c diff --git a/res/edje/circle/apps_base_layout_circle.edc b/res/edje/circle/apps_base_layout_circle.edc index d0de33e..4751b49 100755 --- a/res/edje/circle/apps_base_layout_circle.edc +++ b/res/edje/circle/apps_base_layout_circle.edc @@ -48,8 +48,8 @@ collections { type: TEXTBLOCK; description { state: "default" 0.0; - rel1 { relative: 0.291 0.348; to: SIZE_SETTER; } - rel2 { relative: 0.708 0.638; to: SIZE_SETTER; } + rel1 { relative: 0.291 0.291; to: SIZE_SETTER; } + rel2 { relative: 0.708 0.708; to: SIZE_SETTER; } color: 255 255 255 255; visible: 1; fixed: 1 1; diff --git a/src/apps/apps_view_circle.c b/src/apps/apps_view_circle.c index 5e15e8c..dfc7975 100755 --- a/src/apps/apps_view_circle.c +++ b/src/apps/apps_view_circle.c @@ -572,3 +572,12 @@ static void __read_focus_text(void) free(markup_str); } +#include "test.h" +#if TEST_MODE +void __t__set_focus_text(char *label) +{ + __set_focus_text(label); +} + +#endif + diff --git a/src/moments/moments_control_view.c b/src/moments/moments_control_view.c index 9b8cc8f..3909d1d 100755 --- a/src/moments/moments_control_view.c +++ b/src/moments/moments_control_view.c @@ -101,7 +101,7 @@ void moments_control_init(void) moments_control_brightness_status_changed_cb(NULL, NULL); moments_control_do_not_disturb_status_changed_cb(NULL, NULL); moments_control_flight_mode_status_changed_cb(NULL, NULL); - moments_control_volume_status_changed_cb(0, NULL, NULL); + moments_control_volume_status_changed_cb(0, 0, NULL); } void moments_control_fini(void) @@ -196,6 +196,7 @@ __fail: control_info_t *moments_control_create_button(Evas_Object *base_layout, int button_id) { control_info_t *button = (control_info_t *)malloc(sizeof(control_info_t)); + if (button == NULL) return NULL; button->index = control_button_list[button_id].index; button->btn_type = control_button_list[button_id].btn_type; @@ -341,7 +342,7 @@ static void __set_state_stand_alone(void) moments_control_clear_button_list(); control_info_t *brightness_button = moments_control_create_button(s_info.control_layout, MOMENTS_CONTROLS_BRIGHTNESS); - moments_control_push_to_button_list(brightness_button ); + moments_control_push_to_button_list(brightness_button); control_info_t *do_not_disturb_button = moments_control_create_button(s_info.control_layout, MOMENTS_CONTROLS_DO_NOT_DISTURB); moments_control_push_to_button_list(do_not_disturb_button); diff --git a/src/widget.c b/src/widget.c index aed3960..1a01284 100755 --- a/src/widget.c +++ b/src/widget.c @@ -528,7 +528,6 @@ static void _widget_scroll_cb(void *data, Evas_Object *scroller, void *event_inf { Evas_Object *current_page = NULL; page_info_s *page_info = NULL; - const char *widget_instance_id = NULL; current_page = scroller_get_focused_page(scroller); ret_if(!current_page); diff --git a/test/feature_test/feature_test.c b/test/feature_test/feature_test.c index 07caaaf..de0b761 100755 --- a/test/feature_test/feature_test.c +++ b/test/feature_test/feature_test.c @@ -39,6 +39,7 @@ void feature_test(void) TEST_GROUP_ADD("group_feature_moments_controls_state", group_feature_moments_controls_state); TEST_GROUP_ADD("group_feature_moments_control_button_status_behavior", group_feature_moments_control_button_status_behavior); TEST_GROUP_ADD("group_feature_moments_center_layout_show", group_feature_moments_center_layout_show); + TEST_GROUP_ADD("group_feature_apps_focus_text", group_feature_apps_focus_text); TEST_RUN(__test_complete_cb); } diff --git a/test/feature_test/feature_test.h b/test/feature_test/feature_test.h index 97867e3..3f5095a 100755 --- a/test/feature_test/feature_test.h +++ b/test/feature_test/feature_test.h @@ -36,6 +36,8 @@ void group_feature_moments_controls_show(unit_group_t * group); void group_feature_moments_controls_state(unit_group_t * group); void group_feature_moments_control_button_status_behavior(unit_group_t * group); void group_feature_moments_center_layout_show(unit_group_t * group); +void group_feature_apps_focus_text(unit_group_t * group); + #endif diff --git a/test/feature_test/group_feature_apps_focus_text.c b/test/feature_test/group_feature_apps_focus_text.c new file mode 100755 index 0000000..1c30b45 --- /dev/null +++ b/test/feature_test/group_feature_apps_focus_text.c @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2016 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "test.h" +#if TEST_MODE + +#include "feature_test.h" +#include "../test_function.h" +#include "apps/apps.h" + +static struct { + unit_group_t * group; +} s_info = { + .group = NULL, +}; + +static void __group_set_up(void) +{ + apps_show(); + + TEST_GROUP_SET_UP_DONE(0.5, s_info.group); +} + +static void __group_tear_down(void) +{ + apps_hide(); + + TEST_GROUP_TEAR_DOWN_DONE(2.0, s_info.group); +} + +static void __set_up(void) +{ + s_info.group->set_up_complete(s_info.group); +} + +static void __tear_down(void) +{ + s_info.group->tear_down_complete(s_info.group); +} + +static unit_case_func_t __continue_case_done(void * data) +{ + TEST_CASE_DONE(s_info.group); +} + +static unit_case_func_t __case_check_one_line(void * data) +{ + __t__set_focus_text("Kkkkkkkk"); + + TEST_CASE_CONTINUE(2.0, __continue_case_done, data); +} + +static unit_case_func_t __case_check_two_line(void * data) +{ + __t__set_focus_text("Kkkkkkkk Kkkkkkkk"); + + TEST_CASE_CONTINUE(2.0, __continue_case_done, data); +} + +static unit_case_func_t __case_check_three_line(void * data) +{ + __t__set_focus_text("Kkkkkkkk Kkkkkkkk Kkkkkkkk"); + + TEST_CASE_CONTINUE(2.0, __continue_case_done, data); +} + +static unit_case_func_t __case_check_four_line(void * data) +{ + __t__set_focus_text("Kkkkkkkk Kkkkkkkk Kkkkkkkk Kkkkkkkk"); + + TEST_CASE_CONTINUE(2.0, __continue_case_done, data); +} + +void group_feature_apps_focus_text(unit_group_t * group) +{ + s_info.group = group; + s_info.group->set_up = __set_up; + s_info.group->tear_down = __tear_down; + + TEST_GROUP_SET_UP(s_info.group, __group_set_up); + TEST_CASE_ADD(s_info.group, __case_check_one_line, NULL); + TEST_CASE_ADD(s_info.group, __case_check_two_line, NULL); + TEST_CASE_ADD(s_info.group, __case_check_three_line, NULL); + TEST_CASE_ADD(s_info.group, __case_check_four_line, NULL); + + TEST_GROUP_TEAR_DOWN(s_info.group, __group_tear_down); + + TEST_GROUP_RUN(s_info.group); +} + + +#endif + + diff --git a/test/test_function.h b/test/test_function.h index b19edbf..955a2ce 100755 --- a/test/test_function.h +++ b/test/test_function.h @@ -89,6 +89,8 @@ extern void __t__set_moments_control_volume_level(int level); extern int __t__get_moments_control_volume_level(); extern void __t__set_moments_control_brightness_level(int level); extern int __t__get_moments_control_brightness_level(void); + +extern void __t__set_focus_text(char *label); #endif #endif |