X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-DragAndDropDetector.cpp;h=17686c19529eec7df1c6f8c787bea5d39686ee70;hb=c4473b138fec8355d4b4583a48528f816a8cb42a;hp=3fbbfcd0778c9bbfcc9975d252cf391c8a687ba7;hpb=6582d140ba71845801d2dfb76344c46384ae65a6;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/utc-Dali-DragAndDropDetector.cpp b/automated-tests/src/dali-toolkit/utc-Dali-DragAndDropDetector.cpp index 3fbbfcd..17686c1 100755 --- a/automated-tests/src/dali-toolkit/utc-Dali-DragAndDropDetector.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-DragAndDropDetector.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -24,7 +24,6 @@ #include #include -#include using namespace Dali; using namespace Dali::Toolkit; @@ -91,25 +90,6 @@ namespace touchEvent.points.push_back(point); return touchEvent; } - - Integration::PanGestureEvent GeneratePan( - Gesture::State state, - Vector2 previousPosition, - Vector2 currentPosition, - unsigned long timeDelta, - unsigned int numberOfTouches = 1, - unsigned int time = 1u) - { - Integration::PanGestureEvent pan(state); - pan.previousPosition = previousPosition; - pan.currentPosition = currentPosition; - pan.timeDelta = timeDelta; - pan.numberOfTouches = numberOfTouches; - pan.time = time; - - return pan; - } - } int UtcDaliDragAndDropDetectorConstructorN(void) @@ -286,7 +266,7 @@ int UtcDaliDragAndDropDetectorGetAttachedControlP(void) int UtcDaliDragAndDropDetectorStartSignal(void) { - TestApplication application; + ToolkitTestApplication application; Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New(); Control control = Control::New(); @@ -305,12 +285,11 @@ int UtcDaliDragAndDropDetectorStartSignal(void) DragSignalFunctor functor(data); detector.StartedSignal().Connect(&application, functor); - application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 10.0f), Vector2(12.0f, 12.0f), 10)); - application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 10.0f), Vector2(12.0f, 12.0f), 10)); + TestGenerateMiniPan(application); DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION); DALI_TEST_EQUALS(control, data.control, TEST_LOCATION); - DALI_TEST_EQUALS(Vector2(12.0f, 12.0f), data.detector.GetCurrentScreenPosition(), TEST_LOCATION); + DALI_TEST_EQUALS(Vector2(20.0f, 40.0f), data.detector.GetCurrentScreenPosition(), TEST_LOCATION); data.Reset(); END_TEST; @@ -318,7 +297,7 @@ int UtcDaliDragAndDropDetectorStartSignal(void) int UtcDaliDragAndDropDetectorEnteredSignal(void) { - TestApplication application; + ToolkitTestApplication application; Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New(); Control control1 = Control::New(); @@ -345,8 +324,7 @@ int UtcDaliDragAndDropDetectorEnteredSignal(void) DragSignalFunctor functor(data); detector.EnteredSignal().Connect(&application, functor); - application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 10.0f), Vector2(12.0f, 12.0f), 10)); - application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 10.0f), Vector2(12.0f, 12.0f), 10)); + TestGenerateMiniPan(application); Vector2 screenCoordinates(10.0f, 110.0f); application.ProcessEvent(GenerateSingleTouch(TouchPoint::Motion, screenCoordinates)); @@ -362,7 +340,7 @@ int UtcDaliDragAndDropDetectorEnteredSignal(void) int UtcDaliDragAndDropDetectorMovedSignal(void) { - TestApplication application; + ToolkitTestApplication application; Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New(); Control control1 = Control::New(); @@ -389,8 +367,7 @@ int UtcDaliDragAndDropDetectorMovedSignal(void) DragSignalFunctor functor(data); detector.MovedSignal().Connect(&application, functor); - application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 10.0f), Vector2(12.0f, 12.0f), 10)); - application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 10.0f), Vector2(12.0f, 12.0f), 10)); + TestGenerateMiniPan(application); Vector2 screenCoordinates(10.0f, 110.0f); application.ProcessEvent(GenerateSingleTouch(TouchPoint::Motion, screenCoordinates)); @@ -410,7 +387,7 @@ int UtcDaliDragAndDropDetectorMovedSignal(void) int UtcDaliDragAndDropDetectorExitedSignal(void) { - TestApplication application; + ToolkitTestApplication application; Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New(); Control control1 = Control::New(); @@ -440,8 +417,7 @@ int UtcDaliDragAndDropDetectorExitedSignal(void) DragSignalFunctor functor(data); detector.ExitedSignal().Connect(&application, functor); - application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 10.0f), Vector2(12.0f, 12.0f), 10)); - application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 10.0f), Vector2(12.0f, 12.0f), 10)); + TestGenerateMiniPan(application); Vector2 screenCoordinates(10.0f, 110.0f); application.ProcessEvent(GenerateSingleTouch(TouchPoint::Motion, screenCoordinates)); @@ -459,7 +435,7 @@ int UtcDaliDragAndDropDetectorExitedSignal(void) int UtcDaliDragAndDropDetectorDroppedSignal(void) { - TestApplication application; + ToolkitTestApplication application; Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New(); Control control1 = Control::New(); @@ -486,8 +462,7 @@ int UtcDaliDragAndDropDetectorDroppedSignal(void) DragSignalFunctor functor(data); detector.DroppedSignal().Connect(&application, functor); - application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 10.0f), Vector2(12.0f, 12.0f), 10)); - application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 10.0f), Vector2(12.0f, 12.0f), 10)); + TestGenerateMiniPan(application); Vector2 screenCoordinates(10.0f, 110.0f); application.ProcessEvent(GenerateSingleTouch(TouchPoint::Motion, screenCoordinates)); @@ -508,7 +483,7 @@ int UtcDaliDragAndDropDetectorDroppedSignal(void) int UtcDaliDragAndDropDetectorEndedSignal(void) { - TestApplication application; + ToolkitTestApplication application; Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New(); Control control1 = Control::New(); @@ -535,14 +510,10 @@ int UtcDaliDragAndDropDetectorEndedSignal(void) DragSignalFunctor functor(data); detector.EndedSignal().Connect(&application, functor); - application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 10.0f), Vector2(12.0f, 12.0f), 10)); - application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 10.0f), Vector2(12.0f, 12.0f), 10)); + TestGenerateMiniPan(application); application.ProcessEvent(GenerateSingleTouch(TouchPoint::Down, Vector2(10.0f, 10.0f))); - application.ProcessEvent(GeneratePan(Gesture::Continuing, Vector2(10.0f, 10.0f), Vector2(120.0f, 12.0f), 10)); - application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(120.0f, 12.0f), Vector2(120.0f, 20.0f), 10)); - DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION); DALI_TEST_EQUALS(control1, data.control, TEST_LOCATION); data.Reset(); @@ -552,7 +523,7 @@ int UtcDaliDragAndDropDetectorEndedSignal(void) int UtcDaliDragAndDropDetectorGetContent(void) { - TestApplication application; + ToolkitTestApplication application; Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New(); Control control1 = Control::New(); @@ -581,8 +552,7 @@ int UtcDaliDragAndDropDetectorGetContent(void) DragSignalFunctor functor(data); detector.DroppedSignal().Connect(&application, functor); - application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 10.0f), Vector2(12.0f, 12.0f), 10)); - application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 10.0f), Vector2(12.0f, 12.0f), 10)); + TestGenerateMiniPan(application); Vector2 screenCoordinates(10.0f, 110.0f); application.ProcessEvent(GenerateSingleTouch(TouchPoint::Motion, screenCoordinates));