#include <Elementary.h>
#include <vconf.h>
+extern Evas_Object *__t__get_window(void);
+extern Evas_Object *__t__get_layout(void);
+
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 {
+ int current_step;
Ecore_Timer * group_timer;
unit_group_t * group;
int current_case;
void(*case_pool[CASE_COUNT + 1])(bool * is_passed);
} s_info = {
+ .current_step = 0,
.group_timer = NULL,
.group = NULL,
.current_case = 0,
.case_pool = {
__case_start_on_animation,
- __case_check_animation,
+ __case_check_animation, /* x 8 */
__case_check_finish_animation,
NULL,
},
static void __set_up(void) {}
static void __tear_down(void) {}
+static void test_elm_exit(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);
+ boot_exit = test_elm_exit;
+ init_animation(TYPE_ON);
*is_passed = true;
}
static void __case_check_animation(bool * is_passed)
{
+ int rx, ry, rw, rh;
+ Evas_Object *window = __t__get_window();
+ evas_object_geometry_get(window, &rx, &ry, &rw, &rh);
+ TEST_ASSERT_EQUAL_INT(rx, BOOT_X);
+ TEST_ASSERT_EQUAL_INT(ry, BOOT_Y);
+ TEST_ASSERT_EQUAL_INT(rw, BOOT_W);
+ TEST_ASSERT_EQUAL_INT(rh, BOOT_H);
+ TEST_ASSERT_TRUE(evas_object_visible_get(window));
+
+ Evas_Object *layout = __t__get_layout();
+ evas_object_geometry_get(window, &rx, &ry, &rw, &rh);
+ TEST_ASSERT_EQUAL_INT(rx, BOOT_X);
+ TEST_ASSERT_EQUAL_INT(ry, BOOT_Y);
+ TEST_ASSERT_EQUAL_INT(rw, BOOT_W);
+ TEST_ASSERT_EQUAL_INT(rh, BOOT_H);
+ TEST_ASSERT_TRUE(evas_object_visible_get(layout));
+
+ if (s_info.current_step < 8) {
+ s_info.current_case -= 1;
+ }
+
+ s_info.current_step += 1;
+
*is_passed = true;
}
static void __case_check_finish_animation(bool * is_passed)
{
+ int is_finished = -1;
+
+ vconf_get_int(VCONFKEY_BOOT_ANIMATION_FINISHED, &is_finished);
+ TEST_ASSERT_TRUE(is_finished == 1);
+
*is_passed = true;
}
s_info.group_timer = NULL;
}
+ s_info.current_step = 0;
s_info.current_case = 0;
s_info.group = group;
- s_info.group_timer = ecore_timer_add(0.5, __group_timer_callback, NULL);
+ /* 0.7 because boot-animation take 6 sec, we should not use divisor */
+ s_info.group_timer = ecore_timer_add(0.7, __group_timer_callback, NULL);
}
#endif
#include <Elementary.h>
#include <vconf.h>
-static struct {
- Ecore_Timer * feature_test_run_timer;
-} s_info = {
- .feature_test_run_timer = NULL,
-};
-
-static Eina_Bool __run_timer_callback(void * data)
-{
- feature_test();
-
- s_info.feature_test_run_timer = NULL;
- return ECORE_CALLBACK_CANCEL;
-}
-
int main(int argc, char *argv[])
{
unit_init();
function_test();
- 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;
- }
+ feature_test();
- s_info.feature_test_run_timer = ecore_timer_add(1, __run_timer_callback, NULL);
-
elm_run();
unit_fini();