virtual: send set_physical_size when voutput connect
[platform/core/uifw/libtdm.git] / haltests / src / tc_tdm_client.cpp
index c637d88..6be6821 100644 (file)
@@ -1483,6 +1483,8 @@ void TDMVirtualOutput::SetUpTestCase(void)
 
 void TDMVirtualOutput::TearDownTestCase(void)
 {
+//     TDM_UT_WAIT("check & press");
+
        if (voutput)
                tdm_client_voutput_destroy(voutput);
 
@@ -1514,30 +1516,37 @@ bool TDMVirtualOutput::PrepareVOutput(void)
        return true;
 }
 
+static void
+_tc_tdm_client_virutual_make_available_mode(tdm_client_output_mode *modes, int count)
+{
+       int i;
+
+       for (i = 0; i < count; i++) {
+               modes[i].clock = 25200;
+               modes[i].hdisplay = 640;
+               modes[i].hsync_start = 656;
+               modes[i].hsync_end = 752;
+               modes[i].htotal = 800;
+               modes[i].hskew = 0;
+               modes[i].vdisplay = 480;
+               modes[i].vsync_start = 490;
+               modes[i].vsync_end = 492;
+               modes[i].vtotal = 525;
+               modes[i].vscan = 0;
+               modes[i].vrefresh = 30;
+               modes[i].flags = 0;
+               modes[i].type = 0;
+               snprintf(modes[i].name, TDM_NAME_LEN, "%dx%d_%d", modes[i].hdisplay, modes[i].vdisplay, i);
+       }
+}
+
 TEST_F(TDMVirtualOutput, SetAvailableModes)
 {
        tdm_error ret;
        tdm_client_output_mode modes[this->MODE_COUNT];
-       int i, count = this->MODE_COUNT;
-
-       for (i = 0; i < count; i++)
-       {
-               modes[i].clock = 1;
-               modes[i].hdisplay = 2;
-               modes[i].hsync_start = 3;
-               modes[i].hsync_end = 4;
-               modes[i].htotal = 5;
-               modes[i].hskew = 6;
-               modes[i].vdisplay = 7;
-               modes[i].vsync_start = 8;
-               modes[i].vsync_end = 9;
-               modes[i].vtotal = 10;
-               modes[i].vscan = 11;
-               modes[i].vrefresh = 12;
-               modes[i].flags = 13;
-               modes[i].type = 14;
-               snprintf(modes[i].name, TDM_NAME_LEN, "TestModeSetting %d", i);
-       }
+       int count = this->MODE_COUNT;
+
+       _tc_tdm_client_virutual_make_available_mode(modes, count);
 
        ret = tdm_client_voutput_set_available_modes(this->voutput, modes, count);
        ASSERT_EQ(ret, TDM_ERROR_NONE);
@@ -1588,11 +1597,21 @@ TEST_F(TDMVirtualOutput, Connect)
 {
        tdm_error ret;
        tdm_client_output *output;
+       unsigned int mmWidth = 300, mmHeight = 150;
+       tdm_client_output_mode modes[this->MODE_COUNT];
+       int count = this->MODE_COUNT;
 
        output = tdm_client_voutput_get_client_output(this->voutput, &ret);
        ASSERT_EQ(ret, TDM_ERROR_NONE);
        ASSERT_NE(output, NULL);
 
+       ret = tdm_client_voutput_set_physical_size(this->voutput, mmWidth, mmHeight);
+       ASSERT_EQ(ret, TDM_ERROR_NONE);
+
+       _tc_tdm_client_virutual_make_available_mode(modes, count);
+       ret = tdm_client_voutput_set_available_modes(this->voutput, modes, count);
+       ASSERT_EQ(ret, TDM_ERROR_NONE);
+
        ret = tdm_client_output_connect(output);
        ASSERT_EQ(ret, TDM_ERROR_NONE);
 
@@ -1604,6 +1623,8 @@ TEST_F(TDMVirtualOutput, Disconnect)
        tdm_error ret;
        tdm_client_output *output;
 
+//     TDM_UT_WAIT("check & press");
+
        output = tdm_client_voutput_get_client_output(this->voutput, &ret);
        ASSERT_EQ(ret, TDM_ERROR_NONE);
        ASSERT_NE(output, NULL);