*
*/
-extern int init_animation(int state);
-extern int fini_animation(void);
+#include <Elementary.h>
+
+int init_animation(int state);
+int fini_animation(void);
+Evas_Object *create_layout(Evas_Object *win, const char *file_name);
+Evas_Object *create_window(void);
+char *get_layout_file_name(int state, int w, int h);
+Eina_Bool is_layout_file_exist(const char *file_name);
#define FILE_PATH PREFIX"/share/edje/"
#define DEFAULT_ON PREFIX"/share/edje/720x1280_PowerOn.edj"
#define DEFAULT_OFF PREFIX"/share/edje/720x1280_PowerOff.edj"
-#define GRP_OFF "poweroff"
-#define GRP_ON "poweron"
+#define GRP_ANIM "animation"
#ifdef ARM_TYPE
#define DEFAULT_POWERON_WAV PREFIX"/share/keysound/poweron.ogg"
}
collections {
- group { name: "poweroff";
+ group { name: "animation";
parts {
part {
name: "bg";
collections {
group {
- name: "poweron";
+ name: "animation";
parts {
part {
}
collections {
- group { name: "poweroff";
+ group { name: "animation";
parts {
part {
name: "bg";
collections {
group {
- name: "poweron";
+ name: "animation";
parts {
part {
}
collections {
- group { name: "poweroff";
+ group { name: "animation";
parts {
part {
name: "bg";
collections {
group {
- name: "poweron";
+ name: "animation";
parts {
part {
}
collections {
- group { name: "poweroff";
+ group { name: "animation";
parts {
part { name: "poweroff";
collections {
group {
- name: "poweron";
+ name: "animation";
parts {
part {
#include <dirent.h>
#include <vconf.h>
-#include <Elementary.h>
#include <efl_util.h>
#include "boot.h"
}
}
-static Eina_Bool __layout_file_set(Evas_Object *layout, const char *file_name, int state)
-{
- if (state == TYPE_OFF) {
- if (!elm_layout_file_set(layout, file_name, GRP_OFF)) {
- return EINA_FALSE;
- }
- } else {
- if (!elm_layout_file_set(layout, file_name, GRP_ON)) {
- return EINA_FALSE;
- }
- }
-
- evas_object_show(layout);
-
- return EINA_TRUE;
-}
-
static void __fini_layout(void)
{
if (s_animation.layout) {
}
}
-static Evas_Object *__create_window(void)
+Evas_Object *create_window(void)
{
_D("Create Window");
printf("Create Window\n");
return win;
}
-static char *__get_layout_file_name(int state, int w, int h)
+char *get_layout_file_name(int state, int w, int h)
{
char file_name[1024];
int ret = 0;
if (state == TYPE_OFF) {
- snprintf(file_name, sizeof(file_name), FILE_PATH"%dx%d_PowerOff.edj", s_animation.w, s_animation.h);
+ snprintf(file_name, sizeof(file_name), FILE_PATH"%dx%d_PowerOff.edj", w, h);
} else {
- snprintf(file_name, sizeof(file_name), FILE_PATH"%dx%d_PowerOn.edj", s_animation.w, s_animation.h);
+ snprintf(file_name, sizeof(file_name), FILE_PATH"%dx%d_PowerOn.edj", w, h);
}
_D("File name for Animation is: %s", file_name);
return strdup(file_name);
}
-Eina_Bool __is_layout_file_exist(const char *file_name)
+Eina_Bool is_layout_file_exist(const char *file_name)
{
int ret = 0;
return EINA_FALSE;
}
}
-static Evas_Object *__create_layout(Evas_Object *win)
+
+Evas_Object *create_layout(Evas_Object *win, const char *file_name)
{
Evas_Object *layout = elm_layout_add(win);
if (!layout) {
elm_win_resize_object_add(s_animation.win, layout);
elm_layout_signal_callback_add(layout, "end", "animation", __animation_finished_cb, NULL);
+ if (!elm_layout_file_set(layout, file_name, GRP_ANIM)) {
+ _E("Failed to layout file set");
+ return NULL;
+ }
+
+ evas_object_show(layout);
+
return layout;
}
s_animation.state = state;
- s_animation.win = __create_window();
+ s_animation.win = create_window();
if (!s_animation.win) {
_E("Failed to create a new window");
printf("Failed to create a new window\n");
return EXIT_FAILURE;
}
- s_animation.layout = __create_layout(s_animation.win);
- if (!s_animation.layout) {
- _E("Failed to create layout");
- evas_object_del(s_animation.win);
- return EXIT_FAILURE;
- }
-
char *layout_file_name = NULL;
- layout_file_name = __get_layout_file_name(state, s_animation.w, s_animation.h);
+ layout_file_name = get_layout_file_name(state, s_animation.w, s_animation.h);
if (!layout_file_name) {
_E("Failed to get layout file name");
return EXIT_FAILURE;
}
- if (!__is_layout_file_exist(layout_file_name)) {
+ if (!is_layout_file_exist(layout_file_name)) {
_E("This file is not exist");
free(layout_file_name);
return EXIT_FAILURE;
}
- if (!__layout_file_set(s_animation.layout, layout_file_name, state)) {
- _E("Failed to set layaout file");
+ s_animation.layout = create_layout(s_animation.win, layout_file_name);
+ if (!s_animation.layout) {
+ _E("Failed to create layout");
free(layout_file_name);
+ evas_object_del(s_animation.win);
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
-#include "test.h"
-#if TEST_MODE
-Evas_Object *__t_create_window(void)
-{
- return __create_window();
-}
-
-Evas_Object *__t_create_layout(Evas_Object *win)
-{
- return __create_layout(win);
-}
-
-char *__t_get_layout_file_name(int state, int w, int h)
-{
- return __get_layout_file_name(state, w, h);
-}
-
-Eina_Bool __t_layout_file_set(Evas_Object *layout, const char *layout_file_name, int state)
-{
- return __layout_file_set(layout, layout_file_name, state);
-}
-
-Eina_Bool __t_is_layout_file_exist(const char *file_name)
-{
- return __is_layout_file_exist(file_name);
-}
-#endif
#include <Elementary.h>
-#define TEST_GROUP_COUNT 0
-
static void __complete_group_cb(void);
static void __run_next_group(void);
+#define TEST_GROUP_COUNT 1
+
static struct {
int current_group;
char group_name[TEST_GROUP_COUNT + 1][128];
} s_info = {
.current_group = 0,
.group_name = {
+ "group_feature_on_animation",
""
},
.group_starter_pool = {
+ group_feature_on_animation,
NULL,
},
};
static void __run_next_group(void)
{
if (s_info.group_starter_pool[s_info.current_group] == NULL) {
+ elm_exit();
return ;
}
#include <app.h>
void feature_test(void);
+void group_feature_on_animation(unit_group_t * group);
#endif
--- /dev/null
+#include "test.h"
+#if TEST_MODE
+
+#include "feature_test.h"
+#include "boot.h"
+#include "animation.h"
+
+#include <Elementary.h>
+#include <vconf.h>
+
+static void __case_start_on_animation(bool * is_passed);
+static void __case_check_animation(bool * is_passed);
+static void __case_check_finish_animation(bool * is_passed);
+
+#define CASE_COUNT 10
+
+static struct {
+ Ecore_Timer * group_timer;
+ unit_group_t * group;
+ int current_case;
+ void(*case_pool[CASE_COUNT + 1])(bool * is_passed);
+} s_info = {
+ .group_timer = NULL,
+ .group = NULL,
+ .current_case = 0,
+ .case_pool = {
+ __case_start_on_animation,
+ __case_check_animation,
+ __case_check_finish_animation,
+ NULL,
+ },
+};
+
+static Eina_Bool __group_timer_callback(void * data);
+
+static void __set_up(void) {}
+static void __tear_down(void) {}
+
+static void __case_start_on_animation(bool * is_passed)
+{
+ int is_finished = -1;
+ vconf_set_int(VCONFKEY_BOOT_ANIMATION_FINISHED, 0);
+
+ vconf_get_int(VCONFKEY_BOOT_ANIMATION_FINISHED, &is_finished);
+ TEST_ASSERT_TRUE(is_finished == 0);
+
+ //init_animation(TYPE_ON);
+
+ *is_passed = true;
+}
+
+static void __case_check_animation(bool * is_passed)
+{
+ *is_passed = true;
+}
+
+static void __case_check_finish_animation(bool * is_passed)
+{
+ *is_passed = true;
+}
+
+static Eina_Bool __group_timer_callback(void * data)
+{
+ if (s_info.case_pool[s_info.current_case] == NULL) {
+ s_info.group->finish(s_info.group);
+
+ s_info.group_timer = NULL;
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ TEST_CASE(s_info.group, s_info.case_pool[s_info.current_case]);
+ s_info.current_case += 1;
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+void group_feature_on_animation(unit_group_t * group)
+{
+ if (s_info.group_timer) {
+ ecore_timer_del(s_info.group_timer);
+ s_info.group_timer = NULL;
+ }
+
+ s_info.current_case = 0;
+ s_info.group = group;
+ s_info.group_timer = ecore_timer_add(0.5, __group_timer_callback, NULL);
+}
+
+#endif
+
#if TEST_MODE
#include "function_test.h"
+#include "animation.h"
+
#include <Elementary.h>
#define LAYOUT "/usr/share/edje/720x1280_PowerOn.edj"
#define LAYOUT_H 1280
#define STATE 1
-extern Evas_Object *__t_create_window(void);
-extern Evas_Object *__t_create_layout(Evas_Object *win);
-extern char *__t_get_layout_file_name(int state, int w, int h);
-extern Eina_Bool __t_is_layout_file_exist(const char *file_name);
-extern Eina_Bool __t_layout_file_set(Evas_Object *layout, const char *file_name, int state);
+static void __case_get_layout_file_name(bool * is_passed);
static struct {
Evas_Object *win;
static void __set_up(void)
{
- s_info.win = __t_create_window();
+ s_info.win = create_window();
}
static void __tear_down(void)
{
{
TEST_ASSERT_TRUE(s_info.win != NULL);
- Evas_Object *layout = __t_create_layout(s_info.win);
+ char *file_name = "/usr/share/edje/720x1280_PowerOn.edj";
+
+ Evas_Object *layout = create_layout(s_info.win, file_name);
+ TEST_ASSERT_TRUE(layout != NULL);
+ TEST_ASSERT_TRUE(evas_object_visible_get(layout));
+ evas_object_del(layout);
+
+ file_name = "/usr/share/edje/720x1280_PowerOff.edj";
+ layout = create_layout(s_info.win, file_name);
+ TEST_ASSERT_TRUE(layout != NULL);
+ TEST_ASSERT_TRUE(evas_object_visible_get(layout));
+ evas_object_del(layout);
+
+ file_name = "/usr/share/edje/360x360_PowerOn.edj";
+ layout = create_layout(s_info.win, file_name);
+ TEST_ASSERT_TRUE(layout != NULL);
+ TEST_ASSERT_TRUE(evas_object_visible_get(layout));
+ evas_object_del(layout);
+
+ file_name = "/usr/share/edje/360x360_PowerOff.edj";
+ layout = create_layout(s_info.win, file_name);
TEST_ASSERT_TRUE(layout != NULL);
- TEST_ASSERT_EQUAL_STRING(__t_get_layout_file_name(STATE, LAYOUT_W, LAYOUT_H), LAYOUT);
- TEST_ASSERT_TRUE(__t_is_layout_file_exist(LAYOUT));
- TEST_ASSERT_TRUE(__t_layout_file_set(layout, LAYOUT, STATE));
TEST_ASSERT_TRUE(evas_object_visible_get(layout));
+ evas_object_del(layout);
+
+ file_name = "/usr/share/edje/480x800_PowerOff.edj";
+ layout = create_layout(s_info.win, file_name);
+ TEST_ASSERT_TRUE(layout != NULL);
+ TEST_ASSERT_TRUE(evas_object_visible_get(layout));
+ evas_object_del(layout);
+
+ file_name = "/usr/share/edje/480x800_PowerOn.edj";
+ layout = create_layout(s_info.win, file_name);
+ TEST_ASSERT_TRUE(layout != NULL);
+ TEST_ASSERT_TRUE(evas_object_visible_get(layout));
+ evas_object_del(layout);
+
+ file_name = "/usr/share/720x1280_PowerOn.edj";
+ layout = create_layout(s_info.win, file_name);
+ TEST_ASSERT_TRUE(layout == NULL);
+ evas_object_del(layout);
+
+ file_name = "/usr/share/edje/2x2_PowerOn.edj";
+ layout = create_layout(s_info.win, file_name);
+ TEST_ASSERT_TRUE(layout == NULL);
+ evas_object_del(layout);
+
+ *is_passed = true;
+}
+
+static void __case_get_layout_file_name(bool * is_passed)
+{
+ char * file_name = get_layout_file_name(0, 720, 1280);
+ TEST_ASSERT_EQUAL_STRING("/usr/share/edje/720x1280_PowerOn.edj", file_name);
+ free(file_name);
+
+ file_name = get_layout_file_name(3, 720, 1280);
+ TEST_ASSERT_EQUAL_STRING("/usr/share/edje/720x1280_PowerOn.edj", file_name);
+ free(file_name);
+
+ file_name = get_layout_file_name(2, 1280, 720);
+ TEST_ASSERT_EQUAL_STRING("/usr/share/edje/720x1280_PowerOff.edj", file_name);
+ free(file_name);
+
+ file_name = get_layout_file_name(1, 360, 360);
+ TEST_ASSERT_EQUAL_STRING("/usr/share/edje/360x360_PowerOn.edj", file_name);
+ free(file_name);
+
+ file_name = get_layout_file_name(2, 360, 360);
+ TEST_ASSERT_EQUAL_STRING("/usr/share/edje/360x360_PowerOff.edj", file_name);
+ free(file_name);
+
+ file_name = get_layout_file_name(1, 480, 800);
+ TEST_ASSERT_EQUAL_STRING("/usr/share/edje/480x800_PowerOn.edj", file_name);
+ free(file_name);
+
+ file_name = get_layout_file_name(2, 480, 800);
+ TEST_ASSERT_EQUAL_STRING("/usr/share/edje/480x800_PowerOff.edj", file_name);
+ free(file_name);
+
+ file_name = get_layout_file_name(3, 480, 800);
+ TEST_ASSERT_EQUAL_STRING("/usr/share/edje/480x800_PowerOn.edj", file_name);
+ free(file_name);
+
+ *is_passed = true;
+}
+
+static void __case_is_layout_file_exist(bool * is_passed)
+{
+ char *file_name = "/usr/share/edje/480x800_PowerOn.edj";
+ TEST_ASSERT_TRUE(is_layout_file_exist(file_name));
+
+ file_name = "/usr/share/edje/360x360_PowerOff.edj";
+ TEST_ASSERT_TRUE(is_layout_file_exist(file_name));
+
+ file_name = "/usr/share/edje/720x1280_PowerOff.edj";
+ TEST_ASSERT_TRUE(is_layout_file_exist(file_name));
+
+ file_name = "/usr/share/edje/720x1280_PowerOn.edj";
+ TEST_ASSERT_TRUE(is_layout_file_exist(file_name));
+
+ file_name = "/usr/share/edje/1280x720_PowerOn.edj";
+ TEST_ASSERT_TRUE(is_layout_file_exist(file_name) == EINA_FALSE);
+
+ file_name = "/usr/share/edje/800x_480_PowerOn.edj";
+ TEST_ASSERT_TRUE(is_layout_file_exist(file_name) == EINA_FALSE);
+
+ file_name = "/usr/share/720x1280_PowerOn.edj";
+ TEST_ASSERT_TRUE(is_layout_file_exist(file_name) == EINA_FALSE);
*is_passed = true;
}
void group_function_create_window(unit_group_t * group)
{
TEST_CASE(group, __case_create_win);
+ TEST_CASE(group, __case_get_layout_file_name);
+ TEST_CASE(group, __case_is_layout_file_exist);
TEST_CASE(group, __case_create_layout);
group->finish(group);
static Eina_Bool __run_timer_callback(void * data)
{
+ feature_test();
+
s_info.feature_test_run_timer = NULL;
return ECORE_CALLBACK_CANCEL;
}
function_test();
- init_animation(1);
+ Evas_Object * win = create_window();
+
+ if (s_info.feature_test_run_timer) {
+ ecore_timer_del(s_info.feature_test_run_timer);
+ s_info.feature_test_run_timer = NULL;
+ }
+
+ s_info.feature_test_run_timer = ecore_timer_add(1, __run_timer_callback, NULL);
elm_run();