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-KeyboardFocusManager.cpp;h=40947b2c473961fbdc1f2e32971135e998c0d19c;hp=cdecb166b6562ade4b5487f959c483242f1e8ea0;hb=dea624eb348a4926d8761c8a1364f03f9f71acf5;hpb=9b1300733bb67e51e234ce719cef36c484e4091a diff --git a/automated-tests/src/dali-toolkit/utc-Dali-KeyboardFocusManager.cpp b/automated-tests/src/dali-toolkit/utc-Dali-KeyboardFocusManager.cpp old mode 100755 new mode 100644 index cdecb16..40947b2 --- a/automated-tests/src/dali-toolkit/utc-Dali-KeyboardFocusManager.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-KeyboardFocusManager.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. @@ -26,6 +26,7 @@ #include #include #include +#include using namespace Dali; using namespace Dali::Toolkit; @@ -297,12 +298,12 @@ int UtcDaliKeyboardFocusManagerSetAndGetCurrentFocusActor(void) // Create the first actor and add it to the stage Actor first = Actor::New(); first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); - Stage::GetCurrent().Add(first); + application.GetScene().Add(first); // Create the second actor and add it to the stage Actor second = Actor::New(); second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); - Stage::GetCurrent().Add(second); + application.GetScene().Add(second); // Create the third actor but don't add it to the stage Actor third = Actor::New(); @@ -326,7 +327,7 @@ int UtcDaliKeyboardFocusManagerSetAndGetCurrentFocusActor(void) DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second); // Add the third actor to the stage - Stage::GetCurrent().Add(third); + application.GetScene().Add(third); // Check that it will fail to set focus on the third actor as it's not focusable DALI_TEST_CHECK(manager.SetCurrentFocusActor(third) == false); @@ -368,12 +369,12 @@ int UtcDaliKeyboardFocusManagerMoveFocus(void) // Create the first actor and add it to the stage Actor first = Actor::New(); first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); - Stage::GetCurrent().Add(first); + application.GetScene().Add(first); // Create the second actor and add it to the stage Actor second = Actor::New(); second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); - Stage::GetCurrent().Add(second); + application.GetScene().Add(second); // Move the focus to the right DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == false); @@ -424,7 +425,7 @@ int UtcDaliKeyboardFocusManagerMoveFocus(void) // Create a 2x2 table view and try to move focus inside it TableView tableView = TableView::New( 2, 2 ); - Stage::GetCurrent().Add(tableView); + application.GetScene().Add(tableView); // Create the third actor Actor third = Actor::New(); @@ -531,12 +532,12 @@ int UtcDaliKeyboardFocusManagerCustomAlgorithmMoveFocus(void) // Create the first actor and add it to the stage Actor first = Actor::New(); first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); - Stage::GetCurrent().Add(first); + application.GetScene().Add(first); // Create the second actor and add it to the stage Actor second = Actor::New(); second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); - Stage::GetCurrent().Add(second); + application.GetScene().Add(second); // Move the focus to the right DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == false); @@ -625,8 +626,8 @@ int UtcDaliKeyboardFocusManagerFocusablePropertiesMoveFocus(void) PushButton button2 = PushButton::New(); button1.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); button2.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); - Stage::GetCurrent().Add(button1); - Stage::GetCurrent().Add(button2); + application.GetScene().Add(button1); + application.GetScene().Add(button2); // Set the focus to the button1 DALI_TEST_CHECK(manager.SetCurrentFocusActor(button1) == true); @@ -690,7 +691,7 @@ int UtcDaliKeyboardFocusManagerFocusablePropertiesMoveFocus(void) // Create a 1x1 table view and try to move focus inside it TableView tableView = TableView::New( 1, 1 ); - Stage::GetCurrent().Add(tableView); + application.GetScene().Add(tableView); PushButton button = PushButton::New(); button.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); @@ -732,12 +733,12 @@ int UtcDaliKeyboardFocusManagerClearFocus(void) // Create the first actor and add it to the stage Actor first = Actor::New(); first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); - Stage::GetCurrent().Add(first); + application.GetScene().Add(first); // Create the second actor and add it to the stage Actor second = Actor::New(); second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); - Stage::GetCurrent().Add(second); + application.GetScene().Add(second); // Check that the focus is set on the first actor DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true); @@ -819,7 +820,7 @@ int UtcDaliKeyboardFocusManagerGetFocusGroup(void) Actor parent = Actor::New(); Actor child = Actor::New(); parent.Add(child); - Stage::GetCurrent().Add(parent); + application.GetScene().Add(parent); // Create three actors and add them as the children of the first child actor Actor grandChild = Actor::New(); @@ -902,12 +903,12 @@ int UtcDaliKeyboardFocusManagerSignalFocusedActorActivated(void) // Create the first button and add it to the stage PushButton firstPushButton = PushButton::New(); firstPushButton.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); - Stage::GetCurrent().Add(firstPushButton); + application.GetScene().Add(firstPushButton); // Create the second button and add it to the stage PushButton secondPushButton = PushButton::New(); secondPushButton.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); - Stage::GetCurrent().Add(secondPushButton); + application.GetScene().Add(secondPushButton); // Check that the focus is set on the first button DALI_TEST_CHECK(manager.SetCurrentFocusActor(firstPushButton) == true); @@ -1002,22 +1003,22 @@ int UtcDaliKeyboardFocusManagerMoveFocusBackward(void) // Create the first actor and add it to the stage Actor first = Actor::New(); first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); - Stage::GetCurrent().Add(first); + application.GetScene().Add(first); // Create the second actor and add it to the stage Actor second = Actor::New(); second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); - Stage::GetCurrent().Add(second); + application.GetScene().Add(second); // Create the third actor and add it to the stage Actor third = Actor::New(); third.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); - Stage::GetCurrent().Add(third); + application.GetScene().Add(third); // Create the fourth actor and add it to the stage Actor fourth = Actor::New(); fourth.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); - Stage::GetCurrent().Add(fourth); + application.GetScene().Add(fourth); // Check that the focus is set on the second actor DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true); @@ -1059,7 +1060,7 @@ int UtcDaliKeyboardFocusManagerMoveFocusBackward(void) { Actor actor = Actor::New(); actor.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); - Stage::GetCurrent().Add(actor); + application.GetScene().Add(actor); manager.SetCurrentFocusActor(actor); } @@ -1104,7 +1105,7 @@ int UtcDaliKeyboardFocusManagerChangeFocusDirectionByKeyEvents(void) // Create a 2x2 table view and try to move focus inside it TableView tableView = TableView::New( 2, 2 ); - Stage::GetCurrent().Add(tableView); + application.GetScene().Add(tableView); // Create the first actor Actor first = Actor::New(); @@ -1302,12 +1303,12 @@ int UtcDaliKeyboardFocusManagerMoveFocusTestStateChange(void) // Create the first actor and add it to the stage Control first = Control::New(); first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); - Stage::GetCurrent().Add(first); + application.GetScene().Add(first); // Create the second actor and add it to the stage Control second = Control::New(); second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true); - Stage::GetCurrent().Add(second); + application.GetScene().Add(second); // Move the focus to the right DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == false); @@ -1361,7 +1362,7 @@ int UtcDaliKeyboardFocusManagerMoveFocusTestStateChange(void) // Create a 2x2 table view and try to move focus inside it TableView tableView = TableView::New( 2, 2 ); - Stage::GetCurrent().Add(tableView); + application.GetScene().Add(tableView); // Create the third actor Control third = Control::New(); @@ -1501,7 +1502,7 @@ int UtcDaliKeyboardFocusManagerFocusedActorUnstaged(void) DALI_TEST_CHECK( ! manager.GetCurrentFocusActor() ); tet_infoline( "Add actor to stage and attempt to set, our actor should be returned from KeyboardFocusManager" ); - Stage::GetCurrent().Add( actor ); + application.GetScene().Add( actor ); manager.SetCurrentFocusActor( actor ); DALI_TEST_CHECK( manager.GetCurrentFocusActor() == actor ); @@ -1523,7 +1524,7 @@ int UtcDaliKeyboardFocusManagerEnableFocusIndicator(void) Actor actor = Actor::New(); actor.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true ); - Stage::GetCurrent().Add( actor ); + application.GetScene().Add( actor ); manager.SetCurrentFocusActor( actor ); // Press Any key to notice physical keyboard event is comming to KeyboardFocusManager