virtual (client): Add APIs and implementation for related commit.
[platform/core/uifw/libtdm.git] / haltests / src / tc_tdm_client.cpp
index 1ee78c5..fc43491 100644 (file)
@@ -1598,6 +1598,38 @@ TEST_F(TDMVirtualOutput, FailTestSetPhysicalSize)
        ASSERT_EQ(ret, TDM_ERROR_INVALID_PARAMETER);
 }
 
+static void
+_tc_tdm_client_voutput_commit_handler(tdm_client_voutput *voutput, void *user_data)
+{
+       int *flag;
+       flag = (int *)user_data;
+       *flag = 1;
+}
+
+TEST_F(TDMVirtualOutput, AddCommitHandler)
+{
+       tdm_error ret;
+       int flag_callback_called = 0;
+
+       ret = tdm_client_voutput_add_commit_handler(this->voutput,
+                                                                                               _tc_tdm_client_voutput_commit_handler,
+                                                                                               &flag_callback_called);
+       ASSERT_EQ(ret, TDM_ERROR_NONE);
+//     ASSERT_EQ(flag_callback_called, 1);
+
+       tdm_client_voutput_remove_commit_handler(this->voutput,
+                                                                                        _tc_tdm_client_voutput_commit_handler,
+                                                                                        &flag_callback_called);
+}
+
+TEST_F(TDMVirtualOutput, CommitDone)
+{
+       tdm_error ret;
+
+       ret = tdm_client_voutput_commit_done(this->voutput);
+       ASSERT_EQ(ret, TDM_ERROR_NONE);
+}
+
 TEST_F(TDMVirtualOutput, GetClientOutput)
 {
        tdm_error ret;