X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-AccessibilityManager.cpp;h=f0dcd1f638f035c2951084e1436aec755c1b9a58;hp=5a8b3dc2100809c6c0c5f5fb3c8eddda94dde8cd;hb=04807c7be2d762bb23e3865fd2642ace1b3f1855;hpb=43ca048f4200d2f1d6e59c2163af59cd99a45b2e diff --git a/automated-tests/src/dali-toolkit/utc-Dali-AccessibilityManager.cpp b/automated-tests/src/dali-toolkit/utc-Dali-AccessibilityManager.cpp index 5a8b3dc..f0dcd1f 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-AccessibilityManager.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-AccessibilityManager.cpp @@ -283,9 +283,9 @@ int UtcDaliAccessibilityManagerGetActorByFocusOrder(void) DALI_TEST_CHECK(manager.GetActorByFocusOrder(3) == Actor()); // Add the actors to the stage - Stage::GetCurrent().Add(first); - Stage::GetCurrent().Add(second); - Stage::GetCurrent().Add(third); + application.GetScene().Add(first); + application.GetScene().Add(second); + application.GetScene().Add(third); // Check that we get an empty handle because focus order 0 means undefined. DALI_TEST_CHECK(manager.GetActorByFocusOrder(0) == Actor()); @@ -328,12 +328,12 @@ int UtcDaliAccessibilityManagerSetAndGetCurrentFocusActor(void) // Create the first actor and add it to the stage Actor first = Actor::New(); manager.SetFocusOrder(first, 1); - Stage::GetCurrent().Add(first); + application.GetScene().Add(first); // Create the second actor and add it to the stage Actor second = Actor::New(); manager.SetFocusOrder(second, 2); - Stage::GetCurrent().Add(second); + application.GetScene().Add(second); // Create the third actor but don't add it to the stage Actor third = Actor::New(); @@ -357,7 +357,7 @@ int UtcDaliAccessibilityManagerSetAndGetCurrentFocusActor(void) DALI_TEST_CHECK(manager.SetCurrentFocusActor(third) == false); // Add the third actor to the stage - Stage::GetCurrent().Add(third); + application.GetScene().Add(third); // make the third actor invisible third.SetProperty( Actor::Property::VISIBLE,false); @@ -426,7 +426,7 @@ int UtcDaliAccessibilityManagerGetCurrentFocusGroup(void) Actor secondChild = Actor::New(); parent.Add(firstChild); parent.Add(secondChild); - Stage::GetCurrent().Add(parent); + application.GetScene().Add(parent); // Create three actors and add them as the children of the first child actor Actor firstGrandChild = Actor::New(); @@ -492,13 +492,13 @@ int UtcDaliAccessibilityManagerGetCurrentFocusOrder(void) accAdaptor.HandleActionEnableEvent(); Actor first = Actor::New(); - Stage::GetCurrent().Add(first); + application.GetScene().Add(first); Actor second = Actor::New(); - Stage::GetCurrent().Add(second); + application.GetScene().Add(second); Actor third = Actor::New(); - Stage::GetCurrent().Add(third); + application.GetScene().Add(third); // Set the focus order and description for the first actor manager.SetFocusOrder(first, 1); @@ -554,13 +554,13 @@ int UtcDaliAccessibilityManagerMoveFocusForward(void) accAdaptor.HandleActionNextEvent(true); Actor first = Actor::New(); - Stage::GetCurrent().Add(first); + application.GetScene().Add(first); Actor second = Actor::New(); - Stage::GetCurrent().Add(second); + application.GetScene().Add(second); Actor third = Actor::New(); - Stage::GetCurrent().Add(third); + application.GetScene().Add(third); // Set the focus order and description for the first actor manager.SetFocusOrder(first, 1); @@ -671,13 +671,13 @@ int UtcDaliAccessibilityManagerMoveFocusBackward(void) accAdaptor.HandleActionEnableEvent(); Actor first = Actor::New(); - Stage::GetCurrent().Add(first); + application.GetScene().Add(first); Actor second = Actor::New(); - Stage::GetCurrent().Add(second); + application.GetScene().Add(second); Actor third = Actor::New(); - Stage::GetCurrent().Add(third); + application.GetScene().Add(third); // Set the focus order and description for the first actor manager.SetFocusOrder(first, 1); @@ -790,12 +790,12 @@ int UtcDaliAccessibilityManagerClearFocus(void) // Create the first actor and add it to the stage Actor first = Actor::New(); manager.SetFocusOrder(first, 1); - Stage::GetCurrent().Add(first); + application.GetScene().Add(first); // Create the second actor and add it to the stage Actor second = Actor::New(); manager.SetFocusOrder(second, 2); - Stage::GetCurrent().Add(second); + application.GetScene().Add(second); // Check that no actor is being focused yet. DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor()); @@ -828,12 +828,12 @@ int UtcDaliAccessibilityManagerReset(void) // Create the first actor and add it to the stage Actor first = Actor::New(); manager.SetFocusOrder(first, 1); - Stage::GetCurrent().Add(first); + application.GetScene().Add(first); // Create the second actor and add it to the stage Actor second = Actor::New(); manager.SetFocusOrder(second, 2); - Stage::GetCurrent().Add(second); + application.GetScene().Add(second); // Check that no actor is being focused yet. DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor()); @@ -875,7 +875,7 @@ int UtcDaliAccessibilityManagerFocusGroup(void) Actor secondChild = Actor::New(); parent.Add(firstChild); parent.Add(secondChild); - Stage::GetCurrent().Add(parent); + application.GetScene().Add(parent); // Create three actors and add them as the children of the first child actor Actor firstGrandChild = Actor::New(); @@ -992,7 +992,7 @@ int UtcDaliAccessibilityManagerSetAndGetFocusIndicatorWithFocusedActor(void) DALI_TEST_CHECK(defaultFocusIndicatorActor); Actor focusedActor = Actor::New(); - Stage::GetCurrent().Add( focusedActor ); + application.GetScene().Add( focusedActor ); application.SendNotification(); application.Render(); @@ -1036,12 +1036,12 @@ int UtcDaliAccessibilityManagerSignalFocusChanged(void) // Create the first actor and add it to the stage Actor first = Actor::New(); manager.SetFocusOrder(first, 1); - Stage::GetCurrent().Add(first); + application.GetScene().Add(first); // Create the second actor and add it to the stage Actor second = Actor::New(); manager.SetFocusOrder(second, 2); - Stage::GetCurrent().Add(second); + application.GetScene().Add(second); // Check that no actor is being focused yet. DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor()); @@ -1087,12 +1087,12 @@ int UtcDaliAccessibilityManagerSignalFocusOvershot(void) // Create the first actor and add it to the stage Actor first = Actor::New(); manager.SetFocusOrder(first, 1); - Stage::GetCurrent().Add(first); + application.GetScene().Add(first); // Create the second actor and add it to the stage Actor second = Actor::New(); manager.SetFocusOrder(second, 2); - Stage::GetCurrent().Add(second); + application.GetScene().Add(second); // Check that the wrap mode is disabled DALI_TEST_CHECK(manager.GetWrapMode() == false); @@ -1317,7 +1317,7 @@ int UtcDaliAccessibilityManagerActionActivateSignalP(void) Dali::Toolkit::PushButton button = Dali::Toolkit::PushButton::New(); button.SetProperty( Actor::Property::SIZE, Vector2(480, 800) ); - Stage::GetCurrent().Add(button); + application.GetScene().Add(button); manager.SetFocusOrder( button, 1 ); manager.SetCurrentFocusActor( button ); @@ -1527,7 +1527,7 @@ int UtcDaliAccessibilityManagerActionUpSignalP(void) DummyControl dummyControl = DummyControl::New(true); dummyControl.SetProperty( Actor::Property::SIZE, Vector2(480, 800) ); manager.SetFocusOrder( dummyControl, 1 ); - Stage::GetCurrent().Add( dummyControl ); + application.GetScene().Add( dummyControl ); manager.SetCurrentFocusActor( dummyControl ); accessibilityAdaptor.HandleActionUpEvent(); @@ -1571,7 +1571,7 @@ int UtcDaliAccessibilityManagerActionDownSignalP(void) Dali::Toolkit::PushButton button = Dali::Toolkit::PushButton::New(); button.SetProperty( Actor::Property::SIZE, Vector2(480, 800) ); - Stage::GetCurrent().Add(button); + application.GetScene().Add(button); manager.SetFocusOrder( button, 1 ); manager.SetCurrentFocusActor( button ); @@ -2099,7 +2099,7 @@ int UtcDaliAccessibilityManagerActionZoomSignalP(void) Dali::Toolkit::PushButton button = Dali::Toolkit::PushButton::New(); button.SetProperty( Actor::Property::SIZE, Vector2(480, 800) ); - Stage::GetCurrent().Add(button); + application.GetScene().Add(button); manager.SetFocusOrder( button, 1 ); manager.SetCurrentFocusActor( button ); @@ -2221,7 +2221,8 @@ public: bool Callback( AccessibilityManager& accessibilityManager, const Dali::TouchEvent& touchEvent ) { mCalls++; - mTouchEvent = touchEvent; + Dali::TouchEvent handle(touchEvent); // Ensure it's ref-counted + mTouchEvent = handle; tet_infoline( "Signal called" ); return true; } @@ -2238,7 +2239,7 @@ public: private: unsigned int mCalls; ///< Keeps track of how many times the signal has been called. - Dali::TouchEvent mTouchEvent; ///< Stores the last touch event received. + Dali::TouchEvent mTouchEvent ; ///< Stores the last touch event received. }; int UtcDaliAccessibilityManagerActionScrollSignalP(void) @@ -2255,7 +2256,7 @@ int UtcDaliAccessibilityManagerActionScrollSignalP(void) Dali::AccessibilityAdaptor accessibilityAdaptor = Dali::AccessibilityAdaptor::Get(); - TouchPoint point( 0, TouchPoint::Started, 100.0f, 200.0f ); + TouchPoint point( 0, PointState::STARTED, 100.0f, 200.0f ); accessibilityAdaptor.HandleActionScrollEvent( point, 0u ); DALI_TEST_EQUALS( callback.GetCalls(), 1u, TEST_LOCATION ); @@ -2263,11 +2264,10 @@ int UtcDaliAccessibilityManagerActionScrollSignalP(void) const TouchEvent& signalTouchEvent = callback.GetTouchEvent(); DALI_TEST_EQUALS( signalTouchEvent.GetPointCount(), 1u, TEST_LOCATION ); - const TouchPoint& signalTouchPoint = signalTouchEvent.GetPoint( 0u ); - DALI_TEST_EQUALS( signalTouchPoint.state, TouchPoint::Started, TEST_LOCATION ); - DALI_TEST_EQUALS( signalTouchPoint.screen.x, 100.0f, TEST_LOCATION ); - DALI_TEST_EQUALS( signalTouchPoint.screen.y, 200.0f, TEST_LOCATION ); + DALI_TEST_EQUALS( signalTouchEvent.GetState(0), PointState::STARTED, TEST_LOCATION ); + DALI_TEST_EQUALS( signalTouchEvent.GetScreenPosition(0).x, 100.0f, TEST_LOCATION ); + DALI_TEST_EQUALS( signalTouchEvent.GetScreenPosition(0).y, 200.0f, TEST_LOCATION ); END_TEST; } @@ -2289,32 +2289,6 @@ int UtcDaliAccessibilityManagerActionScrollSignalN(void) END_TEST; } -int UtcDaliAccessibilityManagerActionTouch(void) -{ - ToolkitTestApplication application; - tet_infoline( " UtcDaliAccessibilityManagerActionTouch" ); - - AccessibilityManager manager = AccessibilityManager::Get(); - DALI_TEST_CHECK( manager ); - - Dali::AccessibilityAdaptor accessibilityAdaptor = Dali::AccessibilityAdaptor::Get(); - - DummyControl dummyControl = DummyControl::New(true); - Impl::DummyControl& dummyImpl = static_cast(dummyControl.GetImplementation()); - dummyControl.SetProperty( Actor::Property::SIZE, Vector2(480, 800) ); - manager.SetFocusOrder( dummyControl, 1 ); - Stage::GetCurrent().Add( dummyControl ); - manager.SetCurrentFocusActor( dummyControl ); - - TouchPoint point( 0, TouchPoint::Started, 100.0f, 200.0f ); - accessibilityAdaptor.HandleActionTouchEvent( point, 0u ); - - DALI_TEST_CHECK( dummyImpl.onAccTouchedCalled ); - - END_TEST; -} - - int UtcDaliAccessibilityManagerHandlePanGesture(void) { // Pan gesture sent from adaptor to manager via AccessibilityGestureHandler @@ -2328,9 +2302,9 @@ int UtcDaliAccessibilityManagerHandlePanGesture(void) Dali::AccessibilityAdaptor accessibilityAdaptor = Dali::AccessibilityAdaptor::Get(); DummyControl dummyControl = DummyControl::New(true); dummyControl.SetProperty( Actor::Property::SIZE, Vector2(480, 800) ); - Stage::GetCurrent().Add( dummyControl ); + application.GetScene().Add( dummyControl ); - AccessibilityGestureEvent panGestureEvent(AccessibilityGestureEvent::Started); + AccessibilityGestureEvent panGestureEvent(AccessibilityGestureEvent::STARTED); panGestureEvent.previousPosition = Vector2(0.f, 0.f); panGestureEvent.currentPosition = Vector2(100.f, 0.f); panGestureEvent.timeDelta = 16; @@ -2338,12 +2312,12 @@ int UtcDaliAccessibilityManagerHandlePanGesture(void) Test::AccessibilityAdaptor::SendPanGesture( accessibilityAdaptor, panGestureEvent ); - panGestureEvent.state = AccessibilityGestureEvent::Continuing; + panGestureEvent.state = AccessibilityGestureEvent::CONTINUING; panGestureEvent.previousPosition = Vector2(100.f, 0.f); panGestureEvent.currentPosition = Vector2(200.f, 0.f); Test::AccessibilityAdaptor::SendPanGesture( accessibilityAdaptor, panGestureEvent ); - panGestureEvent.state = AccessibilityGestureEvent::Finished; + panGestureEvent.state = AccessibilityGestureEvent::FINISHED; panGestureEvent.previousPosition = Vector2(200.f, 0.f); panGestureEvent.currentPosition = Vector2(300.f, 0.f); Test::AccessibilityAdaptor::SendPanGesture( accessibilityAdaptor, panGestureEvent );