__instance_drop(instance_h);
} else {
LOGD("%s is created", id);
+ aul_widget_instance_add(class_id, id);
ret = __send_update_status(class_id, id,
WIDGET_INSTANCE_EVENT_CREATE, 0, NULL);
if (ret < 0)
LOGE("Fail to send create status (%d) ", ret);
- aul_widget_instance_add(class_id, id);
-
ret = bundle_get_byte(b, WIDGET_K_PERIOD, (void **)&period,
&size);
if (ret == BUNDLE_ERROR_NONE && *period > 0) {
TEST_F(WidgetAppTest, widget_app_add_event_handler) {
app_event_handler_h handle;
+ EXPECT_CALL(GetMock<SystemInfoMock>(),
+ system_info_get_platform_bool(_, _)).
+ WillOnce(DoAll(
+ SetArgPointee<1>(true),
+ Return(0)));
int ret = widget_app_add_event_handler(&handle, APP_EVENT_LOW_MEMORY,
__app_event_cb, nullptr);
EXPECT_EQ(WIDGET_ERROR_NONE, ret);
TEST_F(WidgetAppTest, widget_app_remove_event_handler) {
app_event_handler_h handle;
+ EXPECT_CALL(GetMock<SystemInfoMock>(),
+ system_info_get_platform_bool(_, _)).
+ WillRepeatedly(DoAll(
+ SetArgPointee<1>(true),
+ Return(0)));
int ret = widget_app_add_event_handler(&handle, APP_EVENT_LOW_MEMORY,
__app_event_cb, nullptr);
ret = widget_app_remove_event_handler(handle);