X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftoolkit-test-application.h;h=49a4c6f137b199c980d56fa354fa7fb15e26ebbb;hp=2b1db83ee031c5795593763c0565051d0d41154c;hb=6154e1e69b7cd3afb49213c4f6f5730dd3df074e;hpb=a0424ec129d3799ee0dab4a46600d167b2b7c71c 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 2b1db83..49a4c6f 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 @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_TEST_APPLICATION_H__ -#define __DALI_TOOLKIT_TEST_APPLICATION_H__ +#ifndef DALI_TOOLKIT_TEST_APPLICATION_H +#define DALI_TOOLKIT_TEST_APPLICATION_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -18,18 +18,29 @@ * */ +// EXTERNAL INCLUDES +#include + // INTERNAL INCLUDES #include #include -#include +#include #include -#include +#include +#include "test-application.h" + +//#undef assert namespace Dali { +class Adaptor; +class Window; + /** * Adds some functionality on top of TestApplication that is required by the Toolkit. + * + * This includes creation and destruction of the Adaptor and Window classes. */ class ToolkitTestApplication : public TestApplication { @@ -38,40 +49,9 @@ public: ToolkitTestApplication( size_t surfaceWidth = DEFAULT_SURFACE_WIDTH, size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT, float horizontalDpi = DEFAULT_HORIZONTAL_DPI, - float verticalDpi = DEFAULT_VERTICAL_DPI ) - : TestApplication( surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi ) - { - 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() - { - // Need to delete core before we delete the adaptor. - delete mCore; - mCore = NULL; - } + float verticalDpi = DEFAULT_VERTICAL_DPI ); - //ToolkitOrientation& GetOrientation() - //{ - //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(); - } + ~ToolkitTestApplication() override; /** * @brief Executes the idle callbacks. @@ -79,28 +59,14 @@ public: * 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(); - } - } + void RunIdles(); private: - //ToolkitOrientation mOrientation; + + std::unique_ptr mMainWindow; + std::unique_ptr< Adaptor > mAdaptor; }; } // namespace Dali -#endif // __DALI_TOOLKIT_TEST_APPLICATION_H__ +#endif // DALI_TOOLKIT_TEST_APPLICATION_H