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-timer.cpp;h=2259719908e71cf73be249a325254e83a52137cb;hp=2f1ce14ab3032c492b1529101ae577d550a6af0f;hb=d07dc4c4a6067ba3080184d862bca40a90d1789c;hpb=8ad943a28e16767f5fe2fc92d18b38f8808bdc99 diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-timer.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-timer.cpp index 2f1ce14..2259719 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-timer.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-timer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -35,6 +35,7 @@ class Timer; typedef IntrusivePtr TimerPtr; Dali::Timer::TimerSignalType gTickSignal; +int gTimerCount = 0; /** * Implementation of the timer @@ -98,10 +99,12 @@ TimerPtr Timer::New( unsigned int milliSec ) Timer::Timer( unsigned int milliSec ) : mInterval( milliSec ) { + ++gTimerCount; } Timer::~Timer() { + --gTimerCount; } void Timer::Start() @@ -141,7 +144,11 @@ Dali::Timer::TimerSignalType& Timer::TickSignal() void Timer::MockEmitSignal() { - gTickSignal.Emit(); + if( gTimerCount > 1 ) + { + // Only emit the signal if we have more than just the timer created in the test function + gTickSignal.Emit(); + } } @@ -227,3 +234,18 @@ void Timer::MockEmitSignal() } // namespace Dali + +namespace Test +{ + +int GetTimerCount() +{ + return Dali::Internal::Adaptor::gTimerCount; +} + +void EmitGlobalTimerSignal() +{ + Dali::Internal::Adaptor::gTickSignal.Emit(); +} + +}