support string_view in DALI_TEST_EQUALS
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-ScrollBar.cpp
index 1d32e33..c287c5e 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);
@@ -186,20 +189,20 @@ int UtcDaliToolkitScrollBarNewP(void)
   DALI_TEST_CHECK( scrollBar );
   END_TEST;
 
-  ScrollBar vertical = ScrollBar::New(ScrollBar::Vertical);
+  ScrollBar vertical = ScrollBar::New(ScrollBar::VERTICAL);
   DALI_TEST_CHECK( vertical );
-  DALI_TEST_CHECK( vertical.GetScrollDirection() == ScrollBar::Vertical );
+  DALI_TEST_CHECK( vertical.GetScrollDirection() == ScrollBar::VERTICAL );
 
   Property::Value value = vertical.GetProperty(ScrollBar::Property::SCROLL_DIRECTION);
   std::string scrollDirection = value.Get<std::string>();
-  DALI_TEST_EQUALS( scrollDirection, "Vertical", TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollDirection, "VERTICAL", TEST_LOCATION );
 
-  ScrollBar horizontal = ScrollBar::New(ScrollBar::Horizontal);
+  ScrollBar horizontal = ScrollBar::New(ScrollBar::HORIZONTAL);
   DALI_TEST_CHECK( horizontal );
-  DALI_TEST_CHECK( horizontal.GetScrollDirection() == ScrollBar::Horizontal );
+  DALI_TEST_CHECK( horizontal.GetScrollDirection() == ScrollBar::HORIZONTAL );
   value = vertical.GetProperty(ScrollBar::Property::SCROLL_DIRECTION);
   scrollDirection = value.Get<std::string>();
-  DALI_TEST_EQUALS( scrollDirection, "Horizontal", TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollDirection, "HORIZONTAL", TEST_LOCATION );
 
   END_TEST;
 }
@@ -220,17 +223,17 @@ int UtcDaliToolkitScrollBarCreateP(void)
   ScrollBar scrollBar = ScrollBar::DownCast( handle );
   DALI_TEST_CHECK( scrollBar );
 
-  scrollBar.SetProperty(ScrollBar::Property::SCROLL_DIRECTION, "Vertical");
-  scrollBar.SetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY, "Fixed");
+  scrollBar.SetProperty(ScrollBar::Property::SCROLL_DIRECTION, "VERTICAL");
+  scrollBar.SetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY, "FIXED");
 
-  DALI_TEST_EQUALS( scrollBar.GetScrollDirection(), Toolkit::ScrollBar::Vertical, TEST_LOCATION );
-  DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::Fixed, TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollBar.GetScrollDirection(), Toolkit::ScrollBar::VERTICAL, TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::FIXED, TEST_LOCATION );
 
-  scrollBar.SetProperty(ScrollBar::Property::SCROLL_DIRECTION, "Horizontal");
-  scrollBar.SetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY, "Variable");
+  scrollBar.SetProperty(ScrollBar::Property::SCROLL_DIRECTION, "HORIZONTAL");
+  scrollBar.SetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY, "VARIABLE");
 
-  DALI_TEST_EQUALS( scrollBar.GetScrollDirection(), Toolkit::ScrollBar::Horizontal, TEST_LOCATION );
-  DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::Variable, TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollBar.GetScrollDirection(), Toolkit::ScrollBar::HORIZONTAL, TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::VARIABLE, TEST_LOCATION );
 
   END_TEST;
 }
@@ -268,17 +271,17 @@ int UtcDaliToolkitScrollBarSetScrollPropertySourceP(void)
   ToolkitTestApplication application;
 
   // Create a vertical scroll bar
-  ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+  ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
   DALI_TEST_CHECK( scrollBar );
-  DALI_TEST_CHECK( scrollBar.GetScrollDirection() == ScrollBar::Vertical );
+  DALI_TEST_CHECK( scrollBar.GetScrollDirection() == ScrollBar::VERTICAL );
 
   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 );
@@ -513,14 +516,14 @@ int UtcDaliToolkitScrollBarSetScrollPositionIntervalsP(void)
   ToolkitTestApplication application;
 
   // Create a vertical scroll bar
-  ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+  ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
   DALI_TEST_CHECK( scrollBar );
 
   scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   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 );
@@ -633,7 +636,7 @@ int UtcDaliToolkitScrollBarGetScrollPositionIntervalsP(void)
   ToolkitTestApplication application;
 
   // Create a vertical scroll bar
-  ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+  ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
   DALI_TEST_CHECK( scrollBar );
 
   // Set the values to get notified when the scroll positions of the source actor goes above or below these values
@@ -682,13 +685,13 @@ int UtcDaliToolkitScrollBarGetScrollDirectionP(void)
   ToolkitTestApplication application;
 
   // Create a vertical scroll bar
-  ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+  ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
   DALI_TEST_CHECK( scrollBar );
-  DALI_TEST_CHECK( scrollBar.GetScrollDirection() == ScrollBar::Vertical );
+  DALI_TEST_CHECK( scrollBar.GetScrollDirection() == ScrollBar::VERTICAL );
 
   // Change the direction of scroll bar to horizontal
-  scrollBar.SetScrollDirection(ScrollBar::Horizontal);
-  DALI_TEST_CHECK( scrollBar.GetScrollDirection() == ScrollBar::Horizontal );
+  scrollBar.SetScrollDirection(ScrollBar::HORIZONTAL);
+  DALI_TEST_CHECK( scrollBar.GetScrollDirection() == ScrollBar::HORIZONTAL );
 
   END_TEST;
 }
@@ -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 );
@@ -736,11 +739,11 @@ int UtcDaliToolkitScrollBarSetIndicatorHeightPolicyP(void)
   DALI_TEST_EQUALS( indicatorHeight, scrollBarHeight * scrollBarHeight / 500.0f, TEST_LOCATION );
 
   // Set the indicator height to be fixed to 50.0f
-  scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
+  scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::FIXED);
   scrollBar.SetIndicatorFixedHeight(50.0f);
 
   Property::Value value = scrollBar.GetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY);
-  DALI_TEST_EQUALS(value.Get<std::string>(), "Fixed", TEST_LOCATION );
+  DALI_TEST_EQUALS(value.Get<std::string>(), "FIXED", TEST_LOCATION );
 
   // Render and notify
   application.SendNotification();
@@ -751,9 +754,9 @@ int UtcDaliToolkitScrollBarSetIndicatorHeightPolicyP(void)
   DALI_TEST_EQUALS( indicatorHeight, 50.0f, TEST_LOCATION );
 
   // Set the indicator height to be variable
-  scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Variable);
+  scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::VARIABLE);
   value = scrollBar.GetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY);
-  DALI_TEST_EQUALS(value.Get<std::string>(), "Variable", TEST_LOCATION );
+  DALI_TEST_EQUALS(value.Get<std::string>(), "VARIABLE", TEST_LOCATION );
 
   // Render and notify
   application.SendNotification();
@@ -775,12 +778,12 @@ int UtcDaliToolkitScrollBarGetIndicatorHeightPolicyP(void)
   DALI_TEST_CHECK( scrollBar );
 
   // Set the indicator height to be fixed
-  scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
-  DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::Fixed, TEST_LOCATION );
+  scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::FIXED);
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::FIXED, TEST_LOCATION );
 
   // Set the indicator height to be variable
-  scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Variable);
-  DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::Variable, TEST_LOCATION );
+  scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::VARIABLE);
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::VARIABLE, TEST_LOCATION );
 
   END_TEST;
 }
@@ -795,13 +798,13 @@ 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 );
 
   // Set the indicator height to be fixed to 50.0f
-  scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
+  scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::FIXED);
   scrollBar.SetIndicatorFixedHeight(50.0f);
 
   // Render and notify
@@ -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 );
@@ -1671,7 +1674,7 @@ int UtcDaliToolkitScrollBarPanFinishedSignalP(void)
   ToolkitTestApplication application;
 
   // Create a vertical scroll bar
-  ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+  ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
   DALI_TEST_CHECK( scrollBar );
 
   scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
@@ -1679,10 +1682,10 @@ int UtcDaliToolkitScrollBarPanFinishedSignalP(void)
   scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
 
   // Set the indicator height to be fixed to 50.0f
-  scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
+  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 );
@@ -1729,7 +1732,7 @@ int UtcDaliToolkitScrollBarPanFinishedSignalN(void)
   ToolkitTestApplication application;
 
   // Create a vertical scroll bar
-  ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+  ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
   DALI_TEST_CHECK( scrollBar );
 
   scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
@@ -1737,10 +1740,10 @@ int UtcDaliToolkitScrollBarPanFinishedSignalN(void)
   scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
 
   // Set the indicator height to be fixed to 50.0f
-  scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
+  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 );
@@ -1796,14 +1799,14 @@ int UtcDaliToolkitScrollBarScrollPositionIntervalReachedSignalP(void)
   ToolkitTestApplication application;
 
   // Create a vertical scroll bar
-  ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+  ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
   DALI_TEST_CHECK( scrollBar );
 
   scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   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 );
@@ -1912,14 +1915,14 @@ int UtcDaliToolkitScrollBarScrollPositionIntervalReachedSignalN(void)
   ToolkitTestApplication application;
 
   // Create a vertical scroll bar
-  ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+  ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
   DALI_TEST_CHECK( scrollBar );
 
   scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   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 );