Removed TouchEvent from dali-core
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-ScrollBar.cpp
index 1d32e33..676bebd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -19,6 +19,7 @@
 #include <stdlib.h>
 #include <string>
 #include <dali-toolkit-test-suite-utils.h>
+#include "dali-toolkit-test-utils/toolkit-timer.h"
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali/devel-api/actors/actor-devel.h>
 #include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
@@ -116,6 +117,8 @@ static Vector2 PerformGestureSwipe(ToolkitTestApplication& application, Vector2
 
   for(int i = 0; i < frames; i++)
   {
+    Test::EmitGlobalTimerSignal();
+
     pos += direction; // Move in this direction
     time += RENDER_FRAME_INTERVAL;
     TestMovePan( application, pos, time);
@@ -274,11 +277,11 @@ int UtcDaliToolkitScrollBarSetScrollPropertySourceP(void)
 
   float scrollBarHeight = 100.0f;
   scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, scrollBarHeight, 0.0f) );
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   // Create a source actor that owns the scroll properties required by the scroll bar
   Actor sourceActor = Actor::New();
-  Stage::GetCurrent().Add( sourceActor );
+  application.GetScene().Add( sourceActor );
 
   // Register the scroll properties
   Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition",  0.0f );
@@ -356,7 +359,7 @@ int UtcDaliToolkitScrollBarSetScrollPropertySourceP(void)
 
   // Create another source actor
   Actor newSourceActor = Actor::New();
-  Stage::GetCurrent().Add( newSourceActor );
+  application.GetScene().Add( newSourceActor );
 
   // Register the scroll properties
   Property::Index newPropertyScrollPosition = newSourceActor.RegisterProperty( "sourcePosition",  0.0f );
@@ -520,7 +523,7 @@ int UtcDaliToolkitScrollBarSetScrollPositionIntervalsP(void)
   scrollBar.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
 
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   // Connect to the ScrollPositionIntervalReached signal
   scrollBar.ScrollPositionIntervalReachedSignal().Connect( &OnScrollPositionIntervalReached );
@@ -531,7 +534,7 @@ int UtcDaliToolkitScrollBarSetScrollPositionIntervalsP(void)
 
   // Create a source actor that owns the scroll properties required by the scroll bar
   Actor sourceActor = Actor::New();
-  Stage::GetCurrent().Add( sourceActor );
+  application.GetScene().Add( sourceActor );
 
   // Register the scroll properties
   Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition",  0.0f );
@@ -703,11 +706,11 @@ int UtcDaliToolkitScrollBarSetIndicatorHeightPolicyP(void)
 
   float scrollBarHeight = 100.0f;
   scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, scrollBarHeight, 0.0f) );
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   // Create a source actor that owns the scroll properties required by the scroll bar
   Actor sourceActor = Actor::New();
-  Stage::GetCurrent().Add( sourceActor );
+  application.GetScene().Add( sourceActor );
 
   // Register the scroll properties
   Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition",  0.0f );
@@ -795,7 +798,7 @@ int UtcDaliToolkitScrollBarSetIndicatorFixedHeightP(void)
 
   float scrollBarHeight = 100.0f;
   scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, scrollBarHeight, 0.0f) );
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   Actor indicator = scrollBar.GetScrollIndicator();
   DALI_TEST_CHECK( indicator );
@@ -855,7 +858,7 @@ int UtcDaliToolkitScrollBarSetIndicatorShowDurationP(void)
   ScrollBar scrollBar = ScrollBar::New();
   DALI_TEST_CHECK( scrollBar );
 
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   Actor indicator = scrollBar.GetScrollIndicator();
   DALI_TEST_CHECK( indicator );
@@ -935,7 +938,7 @@ int UtcDaliToolkitScrollBarSetIndicatorShowDurationN(void)
   ScrollBar scrollBar = ScrollBar::New();
   DALI_TEST_CHECK( scrollBar );
 
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   Actor indicator = scrollBar.GetScrollIndicator();
   DALI_TEST_CHECK( indicator );
@@ -1027,7 +1030,7 @@ int UtcDaliToolkitScrollBarSetIndicatorHideDurationP(void)
   ScrollBar scrollBar = ScrollBar::New();
   DALI_TEST_CHECK( scrollBar );
 
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   Actor indicator = scrollBar.GetScrollIndicator();
   DALI_TEST_CHECK( indicator );
@@ -1107,7 +1110,7 @@ int UtcDaliToolkitScrollBarSetIndicatorHideDurationN(void)
   ScrollBar scrollBar = ScrollBar::New();
   DALI_TEST_CHECK( scrollBar );
 
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   Actor indicator = scrollBar.GetScrollIndicator();
   DALI_TEST_CHECK( indicator );
@@ -1199,7 +1202,7 @@ int UtcDaliToolkitScrollBarShowIndicatorP(void)
   ScrollBar scrollBar = ScrollBar::New();
   DALI_TEST_CHECK( scrollBar );
 
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   Actor indicator = scrollBar.GetScrollIndicator();
   DALI_TEST_CHECK( indicator );
@@ -1244,7 +1247,7 @@ int UtcDaliToolkitScrollBarShowIndicatorN(void)
   ScrollBar scrollBar = ScrollBar::New();
   DALI_TEST_CHECK( scrollBar );
 
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   Actor indicator = scrollBar.GetScrollIndicator();
   DALI_TEST_CHECK( indicator );
@@ -1286,7 +1289,7 @@ int UtcDaliToolkitScrollBarHideIndicatorP(void)
   ScrollBar scrollBar = ScrollBar::New();
   DALI_TEST_CHECK( scrollBar );
 
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   Actor indicator = scrollBar.GetScrollIndicator();
   DALI_TEST_CHECK( indicator );
@@ -1331,7 +1334,7 @@ int UtcDaliToolkitScrollBarHideIndicatorN(void)
   ScrollBar scrollBar = ScrollBar::New();
   DALI_TEST_CHECK( scrollBar );
 
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   Actor indicator = scrollBar.GetScrollIndicator();
   DALI_TEST_CHECK( indicator );
@@ -1373,7 +1376,7 @@ int UtcDaliToolkitScrollBarActionShowIndicator(void)
   ScrollBar scrollBar = ScrollBar::New();
   DALI_TEST_CHECK( scrollBar );
 
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   Actor indicator = scrollBar.GetScrollIndicator();
   DALI_TEST_CHECK( indicator );
@@ -1419,7 +1422,7 @@ int UtcDaliToolkitScrollBarActionHideIndicator(void)
   ScrollBar scrollBar = ScrollBar::New();
   DALI_TEST_CHECK( scrollBar );
 
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   Actor indicator = scrollBar.GetScrollIndicator();
   DALI_TEST_CHECK( indicator );
@@ -1465,7 +1468,7 @@ int UtcDaliToolkitScrollBarActionShowTransientIndicator(void)
   ScrollBar scrollBar = ScrollBar::New();
   DALI_TEST_CHECK( scrollBar );
 
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   Actor indicator = scrollBar.GetScrollIndicator();
   DALI_TEST_CHECK( indicator );
@@ -1529,7 +1532,7 @@ int UtcDaliToolkitScrollBarActionShowTransientIndicatorImmediate(void)
   ScrollBar scrollBar = ScrollBar::New();
   DALI_TEST_CHECK( scrollBar );
 
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   Actor indicator = scrollBar.GetScrollIndicator();
   DALI_TEST_CHECK( indicator );
@@ -1589,7 +1592,7 @@ int UtcDaliToolkitScrollBarActionShowTransientIndicatorDuringHide(void)
   ScrollBar scrollBar = ScrollBar::New();
   DALI_TEST_CHECK( scrollBar );
 
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   Actor indicator = scrollBar.GetScrollIndicator();
   DALI_TEST_CHECK( indicator );
@@ -1682,7 +1685,7 @@ int UtcDaliToolkitScrollBarPanFinishedSignalP(void)
   scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
   scrollBar.SetIndicatorFixedHeight(50.0f);
 
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   // Connect the pan finished signal
   ConnectionTracker connectionTracker;
@@ -1696,7 +1699,7 @@ int UtcDaliToolkitScrollBarPanFinishedSignalP(void)
 
   // Create a source actor that owns the scroll properties required by the scroll bar
   Actor sourceActor = Actor::New();
-  Stage::GetCurrent().Add( sourceActor );
+  application.GetScene().Add( sourceActor );
 
   // Register the scroll properties
   Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition",  0.0f );
@@ -1740,7 +1743,7 @@ int UtcDaliToolkitScrollBarPanFinishedSignalN(void)
   scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
   scrollBar.SetIndicatorFixedHeight(50.0f);
 
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   // Connect the pan finished signal
   ConnectionTracker connectionTracker;
@@ -1758,7 +1761,7 @@ int UtcDaliToolkitScrollBarPanFinishedSignalN(void)
 
   // Create a source actor that owns the scroll properties required by the scroll bar
   Actor sourceActor = Actor::New();
-  Stage::GetCurrent().Add( sourceActor );
+  application.GetScene().Add( sourceActor );
 
   // Register the scroll properties
   Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition",  0.0f );
@@ -1803,7 +1806,7 @@ int UtcDaliToolkitScrollBarScrollPositionIntervalReachedSignalP(void)
   scrollBar.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
 
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
   ConnectionTracker connectionTracker;
 
   // Connect to the ScrollPositionIntervalReached signal
@@ -1817,7 +1820,7 @@ int UtcDaliToolkitScrollBarScrollPositionIntervalReachedSignalP(void)
 
   // Create a source actor that owns the scroll properties required by the scroll bar
   Actor sourceActor = Actor::New();
-  Stage::GetCurrent().Add( sourceActor );
+  application.GetScene().Add( sourceActor );
 
   // Register the scroll properties
   Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition",  0.0f );
@@ -1919,7 +1922,7 @@ int UtcDaliToolkitScrollBarScrollPositionIntervalReachedSignalN(void)
   scrollBar.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
 
-  Stage::GetCurrent().Add( scrollBar );
+  application.GetScene().Add( scrollBar );
 
   // Connect to the ScrollPositionIntervalReached signal
   scrollBar.ScrollPositionIntervalReachedSignal().Connect( &OnScrollPositionIntervalReached );
@@ -1930,7 +1933,7 @@ int UtcDaliToolkitScrollBarScrollPositionIntervalReachedSignalN(void)
 
   // Create a source actor that owns the scroll properties required by the scroll bar
   Actor sourceActor = Actor::New();
-  Stage::GetCurrent().Add( sourceActor );
+  application.GetScene().Add( sourceActor );
 
   // Register the scroll properties
   Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition",  0.0f );