Update common test util
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / test-application.cpp
index 3f7318a..6636676 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -154,6 +154,11 @@ void TestApplication::SetSurfaceWidth( unsigned int width, unsigned height )
   mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight );
 }
 
+void TestApplication::SetTopMargin( unsigned int margin )
+{
+  mCore->SetTopMargin( margin );
+}
+
 void TestApplication::DoUpdate( unsigned int intervalMilliseconds, const char* location )
 {
   if( GetUpdateStatus() == 0 &&
@@ -198,10 +203,6 @@ bool TestApplication::GetRenderNeedsUpdate()
 {
   return mRenderStatus.NeedsUpdate();
 }
-bool TestApplication::GetRenderHasRendered()
-{
-  return mRenderStatus.HasRendered();
-}
 
 bool TestApplication::RenderOnly( )
 {
@@ -220,5 +221,17 @@ void TestApplication::ResetContext()
   mCore->ContextCreated();
 }
 
+unsigned int TestApplication::Wait( unsigned int durationToWait )
+{
+  int time = 0;
+
+  for(unsigned int i = 0; i <= ( durationToWait / RENDER_FRAME_INTERVAL); i++)
+  {
+    SendNotification();
+    Render(RENDER_FRAME_INTERVAL);
+    time += RENDER_FRAME_INTERVAL;
+  }
+  return time;
+}
 
 } // Namespace dali