Add FrontBufferRendering property in WindowData
[platform/core/uifw/dali-adaptor.git] / automated-tests / src / dali-adaptor / utc-Dali-WindowData.cpp
1 /*
2  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 #include <dali-test-suite-utils.h>
19 #include <dali/public-api/adaptor-framework/window-data.h>
20
21 using namespace Dali;
22
23 int UtcDaliWindowData01(void)
24 {
25   // Test default values
26   WindowData windowData;
27
28   DALI_TEST_CHECK(windowData.GetWindowType() == WindowType::NORMAL);
29   DALI_TEST_CHECK(windowData.GetTransparency() == true);
30   DALI_TEST_CHECK(windowData.GetPositionSize().x == 0);
31   DALI_TEST_CHECK(windowData.GetPositionSize().y == 0);
32   DALI_TEST_CHECK(windowData.GetPositionSize().width == 0);
33   DALI_TEST_CHECK(windowData.GetPositionSize().height == 0);
34
35   END_TEST;
36 }
37
38 int UtcDaliWindowData02(void)
39 {
40   // Test SetTransparency and GetTransparency
41   WindowData windowData;
42   windowData.SetTransparency(false);
43
44   DALI_TEST_CHECK(windowData.GetTransparency() == false);
45
46   END_TEST;
47 }
48
49 int UtcDaliWindowData03(void)
50 {
51   // Test SetWindowType and GetWindowType
52   WindowData windowData;
53   windowData.SetWindowType(WindowType::UTILITY);
54
55   DALI_TEST_CHECK(windowData.GetWindowType() == WindowType::UTILITY);
56
57   END_TEST;
58 }
59
60 int UtcDaliWindowData04(void)
61 {
62   // Test SetPositionSize and GetPositionSize
63   WindowData      windowData;
64   Dali::Rect<int> rect(100, 200, 300, 400);
65   windowData.SetPositionSize(rect);
66
67   DALI_TEST_CHECK(windowData.GetPositionSize().x == 100);
68   DALI_TEST_CHECK(windowData.GetPositionSize().y == 200);
69   DALI_TEST_CHECK(windowData.GetPositionSize().width == 300);
70   DALI_TEST_CHECK(windowData.GetPositionSize().height == 400);
71
72   END_TEST;
73 }
74
75 int UtcDaliWindowData05(void)
76 {
77   // Test SetFrontBufferRendering and GetFrontBufferRendering
78   WindowData windowData;
79   windowData.SetFrontBufferRendering(true);
80
81   DALI_TEST_CHECK(windowData.GetFrontBufferRendering() == true);
82
83   END_TEST;
84 }