(Automated Tests) Changes required after removal of time getters from PlatformAbstraction
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-timer.cpp
index 4ab6a57..2f1ce14 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
@@ -20,7 +20,7 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/object/base-object.h>
-#include <dali/public-api/signals/dali-signal-v2.h>
+#include <dali/public-api/signals/dali-signal.h>
 
 namespace Dali
 {
@@ -34,12 +34,17 @@ class Timer;
 
 typedef IntrusivePtr<Timer> TimerPtr;
 
+Dali::Timer::TimerSignalType gTickSignal;
+
 /**
  * Implementation of the timer
  */
 class Timer : public BaseObject
 {
 public:
+  void MockEmitSignal();
+
+public:
   static TimerPtr New( unsigned int milliSec );
   Timer( unsigned int milliSec );
   virtual ~Timer();
@@ -53,7 +58,7 @@ public:
 
 public: // Signals
 
-  Dali::Timer::TimerSignalV2& TickSignal();
+  Dali::Timer::TimerSignalType& TickSignal();
 
 private: // Implementation
 
@@ -63,7 +68,6 @@ private: // Implementation
 
 private: // Data
 
-  Dali::Timer::TimerSignalV2 mTickSignal;
   unsigned int mInterval;
 };
 
@@ -87,7 +91,7 @@ inline const Timer& GetImplementation(const Dali::Timer& timer)
 
 TimerPtr Timer::New( unsigned int milliSec )
 {
-  TimerPtr timerImpl = new Timer(10);
+  TimerPtr timerImpl = new Timer( milliSec );
   return timerImpl;
 }
 
@@ -128,11 +132,19 @@ bool Timer::Tick()
   return false;
 }
 
-Dali::Timer::TimerSignalV2& Timer::TickSignal()
+Dali::Timer::TimerSignalType& Timer::TickSignal()
+{
+  return gTickSignal;
+}
+
+// Mock setup functions:
+
+void Timer::MockEmitSignal()
 {
-  return mTickSignal;
+  gTickSignal.Emit();
 }
 
+
 } // namespace Adaptor
 
 } // namespace Internal
@@ -196,7 +208,7 @@ bool Timer::IsRunning() const
   return true;
 }
 
-Timer::TimerSignalV2& Timer::TickSignal()
+Timer::TimerSignalType& Timer::TickSignal()
 {
   return Internal::Adaptor::GetImplementation( *this ).TickSignal();
 }
@@ -206,5 +218,12 @@ Timer::Timer(Internal::Adaptor::Timer* timer)
 {
 }
 
+// Mock setup functions:
+
+void Timer::MockEmitSignal()
+{
+  Internal::Adaptor::GetImplementation( *this ).MockEmitSignal();
+}
+
 } // namespace Dali