From: Jiwoong Im Date: Wed, 7 Dec 2016 00:30:11 +0000 (+0900) Subject: [UTC][capi-appfw-alarm][Non-ACR][Fix notification alarm tc] X-Git-Tag: Public_Final_RC6~35^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=987fcf7f57ae9edd815acde31bd90f8f811a8a73;p=test%2Ftct%2Fnative%2Fapi.git [UTC][capi-appfw-alarm][Non-ACR][Fix notification alarm tc] Change-Id: I90d14e4aec9ca8471f385b4616b2948f4c14ba02 Signed-off-by: Jiwoong Im --- diff --git a/src/utc/alarm/utc_alarm.c b/src/utc/alarm/utc_alarm.c index 452ba3005..9e791ebbc 100755 --- a/src/utc/alarm/utc_alarm.c +++ b/src/utc/alarm/utc_alarm.c @@ -1415,6 +1415,21 @@ int utc_alarm_get_global_n(void) return 0; } +static gboolean _noti_check(gpointer data) +{ + notification_h noti; + + noti = notification_load_by_tag("alarm-utc"); + alarm_cancel_all(); + assert_neq_with_exit(noti, NULL); + + notification_delete(noti); + notification_free(noti); + normal_exit(0); + + return FALSE; +} + /** * @testcase utc_alarm_schedule_noti_once_at_date_p * @since_tizen 3.0 @@ -1434,7 +1449,7 @@ int utc_alarm_schedule_noti_once_at_date_p(void) int ret = ALARM_ERROR_NONE; time(&now); - now += 20; + now += 5; localtime_r(&now, &date); noti = notification_create(NOTIFICATION_TYPE_NOTI); @@ -1443,13 +1458,21 @@ int utc_alarm_schedule_noti_once_at_date_p(void) "test", NULL, NOTIFICATION_VARIABLE_TYPE_NONE); assert_eq_with_exit(ret, NOTIFICATION_ERROR_NONE); + ret = notification_set_display_applist(noti, + NOTIFICATION_DISPLAY_APP_INDICATOR | + NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | + NOTIFICATION_DISPLAY_APP_TICKER); + assert_eq_with_exit(ret, NOTIFICATION_ERROR_NONE); + + ret = notification_set_tag(noti, "alarm-utc"); + assert_eq_with_exit(ret, NOTIFICATION_ERROR_NONE); + ret = alarm_schedule_noti_once_at_date(noti, &date, &tid); + assert_eq_with_exit(ret, ALARM_ERROR_NONE); notification_free(noti); - alarm_cancel_all(); - assert_eq_with_exit(ret, ALARM_ERROR_NONE); - normal_exit(0); + g_timeout_add_seconds(10, _noti_check, ¬i); return 0; } @@ -1603,7 +1626,7 @@ int utc_alarm_schedule_noti_after_delay_n2(void) int delay = 1; int period = 1; - ret = alarm_schedule_after_delay(NULL, delay, period, &tid); + ret = alarm_schedule_noti_after_delay(NULL, delay, period, &tid); alarm_cancel_all(); @@ -1625,7 +1648,7 @@ int utc_alarm_schedule_noti_once_after_delay_p(void) { int tid; int ret = ALARM_ERROR_NONE; - int delay = 1; + int delay = 5; notification_h noti; noti = notification_create(NOTIFICATION_TYPE_NOTI); @@ -1634,13 +1657,21 @@ int utc_alarm_schedule_noti_once_after_delay_p(void) "test", NULL, NOTIFICATION_VARIABLE_TYPE_NONE); assert_eq_with_exit(ret, NOTIFICATION_ERROR_NONE); + ret = notification_set_display_applist(noti, + NOTIFICATION_DISPLAY_APP_INDICATOR | + NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | + NOTIFICATION_DISPLAY_APP_TICKER); + assert_eq_with_exit(ret, NOTIFICATION_ERROR_NONE); + + ret = notification_set_tag(noti, "alarm-utc"); + assert_eq_with_exit(ret, NOTIFICATION_ERROR_NONE); + ret = alarm_schedule_noti_once_after_delay(noti, delay, &tid); + assert_eq_with_exit(ret, ALARM_ERROR_NONE); notification_free(noti); - alarm_cancel_all(); - assert_eq_with_exit(ret, ALARM_ERROR_NONE); - normal_exit(0); + g_timeout_add_seconds(10, _noti_check, ¬i); return 0; } @@ -1717,23 +1748,39 @@ int utc_alarm_schedule_noti_with_recurrence_week_flag_p(void) int ret = ALARM_ERROR_NONE; notification_h noti; + time(&now); + now += 5; + localtime_r(&now, &date); + noti = notification_create(NOTIFICATION_TYPE_NOTI); ret = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, "test", NULL, NOTIFICATION_VARIABLE_TYPE_NONE); assert_eq_with_exit(ret, NOTIFICATION_ERROR_NONE); - time(&now); - localtime_r(&now, &date); - date.tm_sec += 3; + ret = notification_set_display_applist(noti, + NOTIFICATION_DISPLAY_APP_INDICATOR | + NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | + NOTIFICATION_DISPLAY_APP_TICKER); + assert_eq_with_exit(ret, NOTIFICATION_ERROR_NONE); + + ret = notification_set_tag(noti, "alarm-utc"); + assert_eq_with_exit(ret, NOTIFICATION_ERROR_NONE); - ret = alarm_schedule_noti_with_recurrence_week_flag(noti, &date, ALARM_WEEK_FLAG_MONDAY, &tid); + ret = alarm_schedule_noti_with_recurrence_week_flag(noti, &date, + ALARM_WEEK_FLAG_SUNDAY | + ALARM_WEEK_FLAG_MONDAY | + ALARM_WEEK_FLAG_TUESDAY | + ALARM_WEEK_FLAG_WEDNESDAY | + ALARM_WEEK_FLAG_THURSDAY | + ALARM_WEEK_FLAG_FRIDAY | + ALARM_WEEK_FLAG_SATURDAY + , &tid); + assert_eq_with_exit(ret, ALARM_ERROR_NONE); notification_free(noti); - alarm_cancel_all(); - assert_eq_with_exit(ret, ALARM_ERROR_NONE); - normal_exit(0); + g_timeout_add_seconds(10, _noti_check, ¬i); return 0; }