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-platform-abstraction.cpp;h=3962870196b72279c6da776ccf3d184b424fa01d;hp=190aa63c1fb645c981a61288e2885af17184d741;hb=e5d379064ba0e9a68d1d2680906952dbde263f34;hpb=07a73413cfefa18105d94f952efb62884b8ed9a1 diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp index 190aa63..39628701 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 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. @@ -28,7 +28,9 @@ TestPlatformAbstraction::TestPlatformAbstraction() mClosestSize(), mLoadFileResult(), mSaveFileResult( false ), - mSynchronouslyLoadedResource() + mSynchronouslyLoadedResource(), + mTimerId(0), + mCallbackFunction(nullptr) { Initialize(); } @@ -82,7 +84,6 @@ bool TestPlatformAbstraction::LoadShaderBinaryFile( const std::string& filename, return mLoadFileResult.loadResult; } - /** Call this every test */ void TestPlatformAbstraction::Initialize() { @@ -144,4 +145,24 @@ void TestPlatformAbstraction::SetDecodedBitmap( Integration::BitmapPtr bitmap ) mDecodedBitmap = bitmap; } +uint32_t TestPlatformAbstraction::StartTimer( uint32_t milliseconds, CallbackBase* callback ) +{ + mCallbackFunction = callback; + mTimerId++; + return mTimerId; +} + +void TestPlatformAbstraction::TriggerTimer() +{ + if (mCallbackFunction != nullptr) + { + CallbackBase::Execute( *mCallbackFunction ); + } +} + +void TestPlatformAbstraction::CancelTimer ( uint32_t timerId ) +{ + mCallbackFunction = nullptr; +} + } // namespace Dali