X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-Tooltip.cpp;h=b83a7b16bdc7d296a8764956ed794b2a9ad12711;hb=dea624eb348a4926d8761c8a1364f03f9f71acf5;hp=573ffaceb52ab9258286e6972b46ad5ca131b897;hpb=c01f2590ed7bb00d9b3600511d08dc420261ed46;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Tooltip.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Tooltip.cpp index 573ffac..b83a7b1 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Tooltip.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Tooltip.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 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. @@ -510,9 +510,9 @@ int UtcDaliTooltipDisplay(void) control.SetProperty( DevelControl::Property::TOOLTIP, "Test" ); control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - control.SetSize( 100.0f, 100.0f ); + control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); @@ -520,7 +520,7 @@ int UtcDaliTooltipDisplay(void) int rootChildCount = rootActor.GetChildCount(); - Vector2 centerPoint = Stage::GetCurrent().GetSize() * 0.5f; + Vector2 centerPoint = application.GetScene().GetSize() * 0.5f; application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) ); Dali::Timer timer = Timer::New( 1u ); @@ -545,7 +545,7 @@ int UtcDaliTooltipDisplayWithTail(void) Control control = Control::New(); control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - control.SetSize( 100.0f, 100.0f ); + control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) ); control.SetProperty( DevelControl::Property::TOOLTIP, Property::Map().Add( Tooltip::Property::CONTENT, "Test" ) .Add( Tooltip::Property::TAIL, @@ -554,7 +554,7 @@ int UtcDaliTooltipDisplayWithTail(void) .Add( Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png" )) ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); @@ -562,7 +562,7 @@ int UtcDaliTooltipDisplayWithTail(void) int rootChildCount = rootActor.GetChildCount(); - Vector2 centerPoint = Stage::GetCurrent().GetSize() * 0.5f; + Vector2 centerPoint = application.GetScene().GetSize() * 0.5f; application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) ); Dali::Timer timer = Timer::New( 1u ); @@ -585,7 +585,7 @@ int UtcDaliTooltipDisplayWithContentArray(void) Control control = Control::New(); control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - control.SetSize( 100.0f, 100.0f ); + control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) ); control.SetProperty( DevelControl::Property::TOOLTIP, Property::Map().Add( Tooltip::Property::CONTENT, Property::Array().Add( Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::IMAGE ) @@ -598,7 +598,7 @@ int UtcDaliTooltipDisplayWithContentArray(void) .Add( Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png" )) ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); @@ -606,7 +606,7 @@ int UtcDaliTooltipDisplayWithContentArray(void) int rootChildCount = rootActor.GetChildCount(); - Vector2 centerPoint = Stage::GetCurrent().GetSize() * 0.5f; + Vector2 centerPoint = application.GetScene().GetSize() * 0.5f; application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) ); Dali::Timer timer = Timer::New( 1u ); @@ -629,19 +629,19 @@ int UtcDaliTooltipDisplayBelow(void) Control control = Control::New(); control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - control.SetSize( 100.0f, 100.0f ); + control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) ); control.SetProperty( DevelControl::Property::TOOLTIP, Property::Map().Add( Tooltip::Property::CONTENT, "Test" ) .Add( Tooltip::Property::POSITION, Tooltip::Position::BELOW ) ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); application.Render(); - Vector2 centerPoint = Stage::GetCurrent().GetSize() * 0.5f; + Vector2 centerPoint = application.GetScene().GetSize() * 0.5f; application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) ); Dali::Timer timer = Timer::New( 1u ); @@ -665,19 +665,19 @@ int UtcDaliTooltipDisplayAbove(void) Control control = Control::New(); control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - control.SetSize( 100.0f, 100.0f ); + control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) ); control.SetProperty( DevelControl::Property::TOOLTIP, Property::Map().Add( Tooltip::Property::CONTENT, "Test" ) .Add( Tooltip::Property::POSITION, Tooltip::Position::ABOVE ) ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); application.Render(); - Vector2 centerPoint = Stage::GetCurrent().GetSize() * 0.5f; + Vector2 centerPoint = application.GetScene().GetSize() * 0.5f; application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) ); Dali::Timer timer = Timer::New( 1u ); @@ -701,19 +701,19 @@ int UtcDaliTooltipDisplayAtHoverPoint(void) Control control = Control::New(); control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - control.SetSize( 100.0f, 100.0f ); + control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) ); control.SetProperty( DevelControl::Property::TOOLTIP, Property::Map().Add( Tooltip::Property::CONTENT, "Test" ) .Add( Tooltip::Property::POSITION, Tooltip::Position::HOVER_POINT ) ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); application.Render(); - const Vector2 stageSize = Stage::GetCurrent().GetSize(); + const Vector2 stageSize = application.GetScene().GetSize(); Vector2 hoverPoint = stageSize * 0.5f; hoverPoint.x -= 10.0f; hoverPoint.y -= 10.0f; @@ -741,13 +741,13 @@ int UtcDaliTooltipExceedThreshold(void) Control control = Control::New(); control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - control.SetSize( 100.0f, 100.0f ); + control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) ); control.SetProperty( DevelControl::Property::TOOLTIP, Property::Map().Add( Tooltip::Property::CONTENT, "Test" ) .Add( Tooltip::Property::MOVEMENT_THRESHOLD, 5 ) ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); @@ -756,7 +756,7 @@ int UtcDaliTooltipExceedThreshold(void) int rootChildCount = rootActor.GetChildCount(); tet_infoline( "Start hover" ); - Vector2 hoverPoint = Stage::GetCurrent().GetSize() * 0.5f; + Vector2 hoverPoint = application.GetScene().GetSize() * 0.5f; application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, hoverPoint ) ); application.SendNotification(); @@ -790,10 +790,10 @@ int UtcDaliTooltipGoOutOfBounds(void) Control control = Control::New(); control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - control.SetSize( 100.0f, 100.0f ); + control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) ); control.SetProperty( DevelControl::Property::TOOLTIP, "Test" ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); @@ -802,7 +802,7 @@ int UtcDaliTooltipGoOutOfBounds(void) int rootChildCount = rootActor.GetChildCount(); tet_infoline( "Start hover" ); - Vector2 hoverPoint = Stage::GetCurrent().GetSize() * 0.5f; + Vector2 hoverPoint = application.GetScene().GetSize() * 0.5f; application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, hoverPoint ) ); application.SendNotification(); @@ -836,9 +836,9 @@ int UtcDaliTooltipHideTooltipWhenOutOfBounds(void) control.SetProperty( DevelControl::Property::TOOLTIP, "Test" ); control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - control.SetSize( 100.0f, 100.0f ); + control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); @@ -846,7 +846,7 @@ int UtcDaliTooltipHideTooltipWhenOutOfBounds(void) int rootChildCount = rootActor.GetChildCount(); - Vector2 hoverPoint = Stage::GetCurrent().GetSize() * 0.5f; + Vector2 hoverPoint = application.GetScene().GetSize() * 0.5f; application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, hoverPoint ) ); Dali::Timer timer = Timer::New( 1u ); @@ -879,14 +879,14 @@ int UtcDaliTooltipHideTooltipWhenSetToDisapperOnMovement(void) Control control = Control::New(); control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - control.SetSize( 100.0f, 100.0f ); + control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) ); control.SetProperty( DevelControl::Property::TOOLTIP, Property::Map().Add( Tooltip::Property::CONTENT, "Test" ) .Add( Tooltip::Property::DISAPPEAR_ON_MOVEMENT, true ) .Add( Tooltip::Property::MOVEMENT_THRESHOLD, 5 ) ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); @@ -894,7 +894,7 @@ int UtcDaliTooltipHideTooltipWhenSetToDisapperOnMovement(void) int rootChildCount = rootActor.GetChildCount(); - Vector2 hoverPoint = Stage::GetCurrent().GetSize() * 0.5f; + Vector2 hoverPoint = application.GetScene().GetSize() * 0.5f; application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, hoverPoint ) ); Dali::Timer timer = Timer::New( 1u ); @@ -928,9 +928,9 @@ int UtcDaliTooltipChangeContent(void) control.SetProperty( DevelControl::Property::TOOLTIP, "Test" ); control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - control.SetSize( 100.0f, 100.0f ); + control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); @@ -938,7 +938,7 @@ int UtcDaliTooltipChangeContent(void) int rootChildCount = rootActor.GetChildCount(); - Vector2 centerPoint = Stage::GetCurrent().GetSize() * 0.5f; + Vector2 centerPoint = application.GetScene().GetSize() * 0.5f; application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) ); tet_infoline( "Change content while timer is running and ensure it matches the new value" ); @@ -1009,13 +1009,13 @@ int UtcDaliTooltipEnsureRemainsOnStage1(void) { ToolkitTestApplication application; // Exceptions require ToolkitTestApplication - Vector2 stageSize = Stage::GetCurrent().GetSize(); + Vector2 stageSize = application.GetScene().GetSize(); tet_infoline( "Create a control and place it at the bottom of the screen, setting the tooltip to appear below" ); Control control = Control::New(); control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); - control.SetSize( stageSize ); + control.SetProperty( Actor::Property::SIZE, stageSize ); control.SetProperty( DevelControl::Property::TOOLTIP, Property::Map().Add( Tooltip::Property::CONTENT, "Test" ) .Add( Tooltip::Property::TAIL, @@ -1025,7 +1025,7 @@ int UtcDaliTooltipEnsureRemainsOnStage1(void) .Add( Tooltip::Property::POSITION, Tooltip::Position::BELOW ) ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); @@ -1051,13 +1051,13 @@ int UtcDaliTooltipEnsureRemainsOnStage2(void) { ToolkitTestApplication application; // Exceptions require ToolkitTestApplication - Vector2 stageSize = Stage::GetCurrent().GetSize(); + Vector2 stageSize = application.GetScene().GetSize(); tet_infoline( "Create a control and place it at the top of the screen, setting the tooltip to appear above" ); Control control = Control::New(); control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER ); control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER ); - control.SetSize( stageSize ); + control.SetProperty( Actor::Property::SIZE, stageSize ); control.SetProperty( DevelControl::Property::TOOLTIP, Property::Map().Add( Tooltip::Property::CONTENT, "Test" ) .Add( Tooltip::Property::TAIL, @@ -1067,7 +1067,7 @@ int UtcDaliTooltipEnsureRemainsOnStage2(void) .Add( Tooltip::Property::POSITION, Tooltip::Position::ABOVE ) ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); @@ -1093,14 +1093,14 @@ int UtcDaliTooltipEnsureRemainsOnStage3(void) { ToolkitTestApplication application; // Exceptions require ToolkitTestApplication - Vector2 stageSize = Stage::GetCurrent().GetSize(); + Vector2 stageSize = application.GetScene().GetSize(); Vector2 centerPoint = stageSize * 0.5f; tet_infoline( "Create a control and adjust it's position so that the tooltip will attempt to appear to the left of the screen" ); Control control = Control::New(); control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); - control.SetSize( stageSize ); + control.SetProperty( Actor::Property::SIZE, stageSize ); control.SetProperty( DevelControl::Property::TOOLTIP, Property::Map().Add( Tooltip::Property::CONTENT, "Test" ) .Add( Tooltip::Property::TAIL, @@ -1109,9 +1109,9 @@ int UtcDaliTooltipEnsureRemainsOnStage3(void) .Add( Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png" ) ) .Add( Tooltip::Property::POSITION, Tooltip::Position::BELOW ) ); - control.SetX( -centerPoint.x ); + control.SetProperty( Actor::Property::POSITION_X, -centerPoint.x ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification(); @@ -1138,14 +1138,14 @@ int UtcDaliTooltipEnsureRemainsOnStage4(void) { ToolkitTestApplication application; // Exceptions require ToolkitTestApplication - Vector2 stageSize = Stage::GetCurrent().GetSize(); + Vector2 stageSize = application.GetScene().GetSize(); Vector2 centerPoint = stageSize * 0.5f; tet_infoline( "Create a control and adjust it's position so that the tooltip will attempt to appear to the right of the screen" ); Control control = Control::New(); control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); - control.SetSize( stageSize ); + control.SetProperty( Actor::Property::SIZE, stageSize ); control.SetProperty( DevelControl::Property::TOOLTIP, Property::Map().Add( Tooltip::Property::CONTENT, "Test" ) .Add( Tooltip::Property::TAIL, @@ -1154,9 +1154,9 @@ int UtcDaliTooltipEnsureRemainsOnStage4(void) .Add( Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png" ) ) .Add( Tooltip::Property::POSITION, Tooltip::Position::BELOW ) ); - control.SetX( centerPoint.x ); + control.SetProperty( Actor::Property::POSITION_X, centerPoint.x ); - Actor rootActor = Stage::GetCurrent().GetRootLayer(); + Actor rootActor = application.GetScene().GetRootLayer(); rootActor.Add( control ); application.SendNotification();