X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftoolkit-test-application.h;h=1301b8f2ccb05fe8c659ca2ffe68785155a807ca;hb=59314022f6789147a47a8b098433e211b6185625;hp=e8e4466a320c965e4662456ac0ba85c51c82e8d1;hpb=ad9e64505734ea0a7b6f58198b8dd192e613ee6d;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.h index e8e4466..1301b8f 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.h @@ -2,7 +2,7 @@ #define __DALI_TOOLKIT_TEST_APPLICATION_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +20,10 @@ // INTERNAL INCLUDES #include - -#include "toolkit-orientation.h" +#include +#include +#include +#include namespace Dali { @@ -40,6 +42,15 @@ public: : TestApplication( false, surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi ) { Initialize(); + auto singletonService = SingletonService::Get(); + Test::SetApplication( singletonService, *this ); + + // set the DPI value for font rendering + Dali::TextAbstraction::FontClient fontClient = Dali::TextAbstraction::FontClient::Get(); + if( fontClient ) + { + fontClient.SetDpi( mDpi.x, mDpi.y ); + } } ~ToolkitTestApplication() @@ -54,19 +65,43 @@ public: //return mOrientation; //} + /** + * @brief Creates an adaptor implementation for those controls like the + * text-field and the text-editor which connects a callback to the idle signal. + */ + void CreateAdaptor() + { + Adaptor::Get(); + } + + /** + * @brief Executes the idle callbacks. + * + * Some controls like the text-field and the text-editor connect callbacks to the + * idle signal. + */ + void RunIdles() + { + if( Adaptor::IsAvailable() ) + { + for( Vector::Iterator it = Internal::Adaptor::Adaptor::mCallbacks.Begin(), + endIt = Internal::Adaptor::Adaptor::mCallbacks.End(); + it != endIt; + ++it ) + { + CallbackBase* callback = *it; + + CallbackBase::Execute( *callback ); + } + + Internal::Adaptor::Adaptor::mCallbacks.Clear(); + } + } + private: //ToolkitOrientation mOrientation; }; } // namespace Dali -inline ImageActor CreateSolidColorImageActor(ToolkitTestApplication& application, const Vector4& color, int width, int height) -{ - ImageActor actor = ImageActor::New(CreateBitmapImage(width, height, color)); - application.SendNotification(); - application.Render(); - return actor; -} - - #endif // __DALI_TOOLKIT_TEST_APPLICATION_H__