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%2Ftest-application.h;h=747b488cad75535877ddf3b8f31f236aa6bc679a;hp=a490c96a900581a9f06a974f1634ddf8eccad707;hb=09fea2d3984ac0100f87f480335d674cbb9384a1;hpb=30f6ca1e541089b19f2b349a8a12d8a5bcaf2f9e diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h index a490c96..747b488 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h @@ -1,21 +1,22 @@ #ifndef __DALI_TEST_APPLICATION_H__ #define __DALI_TEST_APPLICATION_H__ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * Copyright (c) 2017 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ // INTERNAL INCLUDES #include @@ -24,6 +25,8 @@ #include "test-gl-abstraction.h" #include "test-render-controller.h" #include +#include +#include namespace Dali { @@ -46,20 +49,25 @@ public: static const unsigned int DEFAULT_RENDER_INTERVAL = 1; + static const unsigned int RENDER_FRAME_INTERVAL = 16; + TestApplication( size_t surfaceWidth = DEFAULT_SURFACE_WIDTH, size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT, float horizontalDpi = DEFAULT_HORIZONTAL_DPI, - float verticalDpi = DEFAULT_VERTICAL_DPI ); + float verticalDpi = DEFAULT_VERTICAL_DPI, + ResourcePolicy::DataRetention policy = ResourcePolicy::DALI_DISCARDS_ALL_DATA); TestApplication( bool initialize, size_t surfaceWidth = DEFAULT_SURFACE_WIDTH, size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT, float horizontalDpi = DEFAULT_HORIZONTAL_DPI, - float verticalDpi = DEFAULT_VERTICAL_DPI ); + float verticalDpi = DEFAULT_VERTICAL_DPI, + ResourcePolicy::DataRetention policy = ResourcePolicy::DALI_DISCARDS_ALL_DATA); void Initialize(); virtual ~TestApplication(); - static void LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message); + static void LogMessage( Dali::Integration::Log::DebugPriority level, std::string& message ); + static void LogContext( bool start, const char* tag ); Dali::Integration::Core& GetCore(); TestPlatformAbstraction& GetPlatform(); TestRenderController& GetRenderController(); @@ -69,11 +77,17 @@ public: void ProcessEvent(const Integration::Event& event); void SendNotification(); void SetSurfaceWidth( unsigned int width, unsigned height ); - bool Render( unsigned int intervalMilliseconds = DEFAULT_RENDER_INTERVAL ); + void SetTopMargin( unsigned int margin ); + bool Render( unsigned int intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL ); unsigned int GetUpdateStatus(); bool UpdateOnly( unsigned int intervalMilliseconds = DEFAULT_RENDER_INTERVAL ); bool RenderOnly( ); void ResetContext(); + bool GetRenderNeedsUpdate(); + unsigned int Wait( unsigned int durationToWait ); + +private: + void DoUpdate( unsigned int intervalMilliseconds, const char* location=NULL ); protected: TestPlatformAbstraction mPlatformAbstraction; @@ -92,6 +106,8 @@ protected: unsigned int mFrame; Vector2 mDpi; + unsigned int mLastVSyncTime; + ResourcePolicy::DataRetention mDataRetentionPolicy; }; } // Dali