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=85df495991f628ff5b46089eb66762cb3d4c4c26;hp=8722ab33d8e3170a47ba1501ef4185b089931d44;hb=8a647e87a01c5c78451653c1264a9eea81ac9b20;hpb=90b76ea06a1d553df0840f7dde4437ff242320f3 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 8722ab3..85df495 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. @@ -18,16 +18,29 @@ * */ +// EXTERNAL INCLUDES +#include + // INTERNAL INCLUDES #include +#include +#include +#include +#include +#include "test-application.h" -#include "toolkit-orientation.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 { @@ -36,37 +49,24 @@ 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(); - } + float verticalDpi = DEFAULT_VERTICAL_DPI ); - ~ToolkitTestApplication() - { - // Need to delete core before we delete the adaptor. - delete mCore; - mCore = NULL; - } + ~ToolkitTestApplication() override; - //ToolkitOrientation& GetOrientation() - //{ - //return mOrientation; - //} + /** + * @brief Executes the idle callbacks. + * + * Some controls like the text-field and the text-editor connect callbacks to the + * idle signal. + */ + void RunIdles(); private: - //ToolkitOrientation mOrientation; + + std::unique_ptr mMainWindow; + std::unique_ptr< Adaptor > mAdaptor; }; } // 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