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=49a4c6f137b199c980d56fa354fa7fb15e26ebbb;hb=e9075a50279076fa8d070e8ee53b7922779a8b66;hp=5cc5befc8fd21a46945f4cac1212e2c5d98e0f21;hpb=27833bb592e5b8a271f12754dee5f1836becab51;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 5cc5bef..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) 2016 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,17 +18,29 @@ * */ +// EXTERNAL INCLUDES +#include + // INTERNAL INCLUDES #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 { @@ -37,39 +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( false, surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi ) - { - Initialize(); - - // 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. @@ -77,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