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>
25 using namespace Dali::Toolkit;
27 void dali_style_manager_startup(void)
29 test_return_value = TET_UNDEF;
32 void dali_style_manager_cleanup(void)
34 test_return_value = TET_PASS;
37 int UtcDaliStyleManagerGet(void)
39 ToolkitTestApplication application;
41 tet_infoline(" UtcDaliStyleManagerGet");
45 type = TypeRegistry::Get().GetTypeInfo( "StyleManager" );
46 DALI_TEST_CHECK( type );
47 BaseHandle handle = type.CreateInstance();
48 DALI_TEST_CHECK( handle );
52 manager = StyleManager::Get();
53 DALI_TEST_CHECK(manager);
55 StyleManager newManager = StyleManager::Get();
56 DALI_TEST_CHECK(newManager);
58 // Check that focus manager is a singleton
59 DALI_TEST_CHECK(manager == newManager);
63 int UtcDaliStyleManagerSetOrientationValue(void)
65 ToolkitTestApplication application;
67 tet_infoline( " UtcDaliStyleManagerSetOrientationValue" );
69 StyleManager manager = StyleManager::Get();
72 manager.SetOrientationValue( orientation1 );
73 DALI_TEST_CHECK( manager.GetOrientationValue() == orientation1 );
75 int orientation2 = 180;
76 manager.SetOrientationValue( orientation2 );
77 DALI_TEST_CHECK( manager.GetOrientationValue() == orientation2 );
82 int UtcDaliStyleManagerSetOrientation(void)
84 ToolkitTestApplication application;
86 tet_infoline( " UtcDaliStyleManagerSetOrientation" );
88 StyleManager manager = StyleManager::Get();
90 Orientation orientation;
92 manager.SetOrientation( orientation );
94 DALI_TEST_CHECK( manager.GetOrientation() == orientation );
99 int UtcDaliStyleManagerSetStyleConstant(void)
101 ToolkitTestApplication application;
103 tet_infoline( " UtcDaliStyleManagerSetStyleConstant" );
105 StyleManager manager = StyleManager::Get();
107 std::string key( "key" );
108 Property::Value value( 100 );
110 manager.SetStyleConstant( key, value );
112 Property::Value returnedValue;
113 manager.GetStyleConstant( key, returnedValue );
115 DALI_TEST_CHECK( value.Get<int>() == returnedValue.Get<int>() );
117 std::string key2( "key2" );
118 Property::Value returnedValue2;
119 DALI_TEST_CHECK( !manager.GetStyleConstant( key2, returnedValue2 ) );