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=1b576bc8a03b665302217d8868bb43c939d5add4;hp=3c83f7e9961afe6494de7a6a68d86a262a44cd68;hb=b694e7e2ae624e206e1548b1a863c554eb9cd4d7;hpb=3a289377436005f632a2dca8916706879b7e3a28 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 3c83f7e..1b576bc 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) 2014 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. @@ -21,8 +21,9 @@ // INTERNAL INCLUDES #include #include - -#include "toolkit-orientation.h" +#include +#include +#include namespace Dali { @@ -38,9 +39,10 @@ public: size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT, float horizontalDpi = DEFAULT_HORIZONTAL_DPI, float verticalDpi = DEFAULT_VERTICAL_DPI ) - : TestApplication( false, surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi ) + : TestApplication( 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(); @@ -62,19 +64,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(CreateBufferImage(width, height, color)); - application.SendNotification(); - application.Render(); - return actor; -} - - -#endif // __DALI_TOOLKIT_TEST_APPLICATION_H__ +#endif // DALI_TOOLKIT_TEST_APPLICATION_H