2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.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
8 // http://floralicense.org/license/
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.
19 #include <dali-toolkit-test-suite-utils.h>
20 #include <dali-toolkit/dali-toolkit.h>
21 #include <dali/integration-api/events/touch-event-integ.h>
22 #include <dali-toolkit/public-api/styling/style-manager.h>
26 using namespace Dali::Toolkit;
28 void dali_style_manager_startup(void)
30 test_return_value = TET_UNDEF;
33 void dali_style_manager_cleanup(void)
35 test_return_value = TET_PASS;
38 int UtcDaliStyleManagerGet(void)
40 ToolkitTestApplication application;
42 tet_infoline(" UtcDaliStyleManagerGet");
46 type = TypeRegistry::Get().GetTypeInfo( "StyleManager" );
47 DALI_TEST_CHECK( type );
48 BaseHandle handle = type.CreateInstance();
49 DALI_TEST_CHECK( handle );
53 manager = StyleManager::Get();
54 DALI_TEST_CHECK(manager);
56 StyleManager newManager = StyleManager::Get();
57 DALI_TEST_CHECK(newManager);
59 // Check that focus manager is a singleton
60 DALI_TEST_CHECK(manager == newManager);
64 int UtcDaliStyleManagerSetOrientationValue(void)
66 ToolkitTestApplication application;
68 tet_infoline( " UtcDaliStyleManagerSetOrientationValue" );
70 StyleManager manager = StyleManager::Get();
73 manager.SetOrientationValue( orientation1 );
74 DALI_TEST_CHECK( manager.GetOrientationValue() == orientation1 );
76 int orientation2 = 180;
77 manager.SetOrientationValue( orientation2 );
78 DALI_TEST_CHECK( manager.GetOrientationValue() == orientation2 );
83 int UtcDaliStyleManagerSetOrientation(void)
85 ToolkitTestApplication application;
87 tet_infoline( " UtcDaliStyleManagerSetOrientation" );
89 StyleManager manager = StyleManager::Get();
91 Orientation orientation;
93 manager.SetOrientation( orientation );
95 DALI_TEST_CHECK( manager.GetOrientation() == orientation );
100 int UtcDaliStyleManagerSetStyleConstant(void)
102 ToolkitTestApplication application;
104 tet_infoline( " UtcDaliStyleManagerSetStyleConstant" );
106 StyleManager manager = StyleManager::Get();
108 std::string key( "key" );
109 Property::Value value( 100 );
111 manager.SetStyleConstant( key, value );
113 Property::Value returnedValue;
114 manager.GetStyleConstant( key, returnedValue );
116 DALI_TEST_CHECK( value.Get<int>() == returnedValue.Get<int>() );
118 std::string key2( "key2" );
119 Property::Value returnedValue2;
120 DALI_TEST_CHECK( !manager.GetStyleConstant( key2, returnedValue2 ) );