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
int ret = ALARM_ERROR_NONE;
time(&now);
- now += 20;
+ now += 5;
localtime_r(&now, &date);
noti = notification_create(NOTIFICATION_TYPE_NOTI);
"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;
}
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();
{
int tid;
int ret = ALARM_ERROR_NONE;
- int delay = 1;
+ int delay = 5;
notification_h noti;
noti = notification_create(NOTIFICATION_TYPE_NOTI);
"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;
}
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;
}