+// Set up the position of the button for the default test events
+void SetupButtonForTestTouchEvents( ToolkitTestApplication& application, Button& button, bool useDefaultImages )
+{
+ button.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ button.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ button.SetPosition( BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS );
+ if ( useDefaultImages )
+ {
+ const Vector2 TEST_IMAGE_SIZE = Vector2( BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS );
+ TestPlatformAbstraction& platform = application.GetPlatform();
+ platform.SetClosestImageSize( TEST_IMAGE_SIZE );
+ button.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, TEST_IMAGE_ONE );
+ button.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, TEST_IMAGE_ONE );
+ }
+}
+
+static std::string GetButtonText( Button button )
+{
+ Property::Value value = button.GetProperty( Toolkit::Button::Property::LABEL );
+
+ Property::Map *labelProperty = value.GetMap();
+
+ std::string textLabel;
+
+ if ( labelProperty )
+ {
+ Property::Value* value = labelProperty->Find( Toolkit::TextVisual::Property::TEXT );
+ value->Get( textLabel );
+ }
+
+ return textLabel;
+}
+