2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 #include <dali/public-api/dali-core.h>
23 #include <dali-test-suite-utils.h>
25 // Internal headers are allowed here
30 void utc_dali_internal_core_startup()
32 test_return_value = TET_UNDEF;
35 void utc_dali_internal_core_cleanup()
37 test_return_value = TET_PASS;
43 class RelayoutSignalHandler : public Dali::ConnectionTracker
47 RelayoutSignalHandler( TestApplication& application )
48 : mApplication( application ),
49 mSignalCalled( false )
53 // callback to be connected to RelayoutSignal
54 void RelayoutCallback( Actor actor )
56 tet_infoline("RelayoutCallback is called");
60 mApplication.SendNotification();
63 TestApplication& mApplication;
67 } // anonymous namespace
69 int UtcDaliCoreProcessEvents(void)
71 TestApplication application;
72 tet_infoline("Testing Dali::Integration::Core::ProcessEvents");
74 Vector3 size( 100.0f, 100.0f, 0.0f );
75 Vector3 position( 100.0f, 100.0f, 0.0f );
77 Actor actor = Actor::New();
78 actor.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
79 actor.SetSize( size );
80 actor.SetPosition( position );
81 Stage::GetCurrent().Add( actor );
83 RelayoutSignalHandler relayoutSignal( application );
84 actor.OnRelayoutSignal().Connect( &relayoutSignal, &RelayoutSignalHandler::RelayoutCallback );
86 application.SendNotification();
88 DALI_TEST_EQUALS( relayoutSignal.mSignalCalled, true, TEST_LOCATION );
90 DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(), size, TEST_LOCATION );
91 DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::POSITION ).Get< Vector3 >(), position, TEST_LOCATION );