2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 // Need to override adaptor classes for toolkit test harness, so include
22 // test harness headers before dali headers.
23 #include <dali-toolkit-test-suite-utils.h>
25 #include <dali-toolkit/dali-toolkit.h>
26 #include <dali/integration-api/events/key-event-integ.h>
27 #include <dali-toolkit/devel-api/focus-manager/keyboard-focus-manager-devel.h>
28 #include <dali-toolkit/devel-api/controls/control-devel.h>
31 using namespace Dali::Toolkit;
33 void utc_dali_toolkit_keyboard_focus_manager_startup(void)
35 test_return_value = TET_UNDEF;
38 void utc_dali_toolkit_keyboard_focus_manager_cleanup(void)
40 test_return_value = TET_PASS;
47 const std::string DEFAULT_DEVICE_NAME("hwKeyboard");
49 // Functors to test whether GetNextFocusableActor() method of CustomAlgorithmInterface is called when the keyboard focus is about to change
50 class CustomAlgorithm : public Dali::Toolkit::DevelKeyboardFocusManager::CustomAlgorithmInterface
53 CustomAlgorithm(bool& interfaceVerified)
54 : mInterfaceVerified(interfaceVerified),
55 mCurrentFocusedActor(),
56 mProposedActorToFocus(),
57 mDirection(Control::KeyboardFocus::LEFT)
61 Actor GetNextFocusableActor(Actor currentFocusedActor, Actor proposedActorToFocus, Control::KeyboardFocus::Direction direction)
63 tet_infoline("Verifying CustomAlgorithm()");
65 mInterfaceVerified = true;
67 mCurrentFocusedActor = currentFocusedActor;
68 mProposedActorToFocus = proposedActorToFocus;
69 mDirection = direction;
71 return mProposedActorToFocus;
76 mInterfaceVerified = false;
77 mCurrentFocusedActor = Actor();
78 mProposedActorToFocus = Actor();
79 mDirection = Control::KeyboardFocus::LEFT;
82 bool& mInterfaceVerified;
83 Actor mCurrentFocusedActor;
84 Actor mProposedActorToFocus;
85 Control::KeyboardFocus::Direction mDirection;
88 // Functors to test whether PreFocusChange signal is emitted when the keyboard focus is about to change
89 class PreFocusChangeCallback : public Dali::ConnectionTracker
92 PreFocusChangeCallback(bool& signalReceived)
93 : mSignalVerified(signalReceived),
94 mCurrentFocusedActor(),
95 mProposedActorToFocus(),
96 mDirection(Control::KeyboardFocus::LEFT)
100 Actor Callback(Actor currentFocusedActor, Actor proposedActorToFocus, Control::KeyboardFocus::Direction direction)
102 tet_infoline("Verifying PreFocusChangeCallback()");
104 mSignalVerified = true;
106 mCurrentFocusedActor = currentFocusedActor;
107 mProposedActorToFocus = proposedActorToFocus;
108 mDirection = direction;
110 return mProposedActorToFocus;
115 mSignalVerified = false;
116 mCurrentFocusedActor = Actor();
117 mProposedActorToFocus = Actor();
118 mDirection = Control::KeyboardFocus::LEFT;
121 bool& mSignalVerified;
122 Actor mCurrentFocusedActor;
123 Actor mProposedActorToFocus;
124 Control::KeyboardFocus::Direction mDirection;
127 // Functors to test whether focus changed signal is emitted when the keyboard focus is changed
128 class FocusChangedCallback : public Dali::ConnectionTracker
131 FocusChangedCallback(bool& signalReceived)
132 : mSignalVerified(signalReceived),
133 mOriginalFocusedActor(),
134 mCurrentFocusedActor()
138 void Callback(Actor originalFocusedActor, Actor currentFocusedActor)
140 tet_infoline("Verifying FocusChangedCallback()");
142 if(originalFocusedActor == mCurrentFocusedActor)
144 mSignalVerified = true;
147 mOriginalFocusedActor = originalFocusedActor;
148 mCurrentFocusedActor = currentFocusedActor;
153 mSignalVerified = false;
156 bool& mSignalVerified;
157 Actor mOriginalFocusedActor;
158 Actor mCurrentFocusedActor;
161 // Functors to test whether focus group changed signal is emitted when the keyboard focus group is changed
162 class FocusGroupChangedCallback : public Dali::ConnectionTracker
165 FocusGroupChangedCallback(bool& signalReceived)
166 : mSignalVerified(signalReceived),
167 mCurrentFocusedActor(),
172 void Callback(Actor currentFocusedActor, bool forward)
174 tet_infoline("Verifying FocusGroupChangedCallback()");
176 mSignalVerified = true;
178 mCurrentFocusedActor = currentFocusedActor;
184 mSignalVerified = false;
187 bool& mSignalVerified;
188 Actor mCurrentFocusedActor;
192 // Functors to test whether focused actor activated signal is emitted when the focused actor is activated
193 class FocusedActorActivatedCallback : public Dali::ConnectionTracker
196 FocusedActorActivatedCallback(bool& signalReceived)
197 : mSignalVerified(signalReceived),
202 void Callback(Actor activatedActor)
204 tet_infoline("Verifying FocusedActorActivatedCallback()");
206 mSignalVerified = true;
208 mActivatedActor = activatedActor;
213 mSignalVerified = false;
216 bool& mSignalVerified;
217 Actor mActivatedActor;
220 // Used to connect to signals via the ConnectSignal Handle method
221 struct CallbackFunctor
234 int UtcDaliKeyboardFocusManagerGet(void)
236 ToolkitTestApplication application;
238 tet_infoline(" UtcDaliKeyboardKeyboardFocusManagerGet");
242 type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
243 DALI_TEST_CHECK( type );
244 BaseHandle handle = type.CreateInstance();
245 DALI_TEST_CHECK( handle );
247 KeyboardFocusManager manager;
249 manager = KeyboardFocusManager::Get();
250 DALI_TEST_CHECK(manager);
252 KeyboardFocusManager newManager = KeyboardFocusManager::Get();
253 DALI_TEST_CHECK(newManager);
255 // Check that focus manager is a singleton
256 DALI_TEST_CHECK(manager == newManager);
260 int UtcDaliKeyboardFocusManagerSetAndGetCurrentFocusActor(void)
262 ToolkitTestApplication application;
264 tet_infoline(" UtcDaliKeyboardFocusManagerSetAndGetCurrentFocusActor");
266 KeyboardFocusManager manager = KeyboardFocusManager::Get();
267 DALI_TEST_CHECK(manager);
269 // Create the first actor and add it to the stage
270 Actor first = Actor::New();
271 first.SetKeyboardFocusable(true);
272 Stage::GetCurrent().Add(first);
274 // Create the second actor and add it to the stage
275 Actor second = Actor::New();
276 second.SetKeyboardFocusable(true);
277 Stage::GetCurrent().Add(second);
279 // Create the third actor but don't add it to the stage
280 Actor third = Actor::New();
282 // Check that no actor is being focused yet.
283 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
285 // Check that it will fail to set focus on an invalid actor
286 DALI_TEST_CHECK(manager.SetCurrentFocusActor(Actor()) == false);
288 // Check that the focus is set on the first actor
289 DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
290 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
292 // Check that the focus is set on the second actor
293 DALI_TEST_CHECK(manager.SetCurrentFocusActor(second) == true);
294 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
296 // Check that it will fail to set focus on the third actor as it's not in the stage
297 DALI_TEST_CHECK(manager.SetCurrentFocusActor(third) == false);
298 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
300 // Add the third actor to the stage
301 Stage::GetCurrent().Add(third);
303 // Check that it will fail to set focus on the third actor as it's not focusable
304 DALI_TEST_CHECK(manager.SetCurrentFocusActor(third) == false);
305 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
307 // Make the third actor focusable
308 third.SetKeyboardFocusable(true);
310 // Check that the focus is successfully moved to the third actor
311 DALI_TEST_CHECK(manager.SetCurrentFocusActor(third) == true);
312 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == third);
316 int UtcDaliKeyboardFocusManagerMoveFocus(void)
318 ToolkitTestApplication application;
320 tet_infoline(" UtcDaliKeyboardFocusManagerMoveFocus");
324 type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
325 DALI_TEST_CHECK( type );
326 BaseHandle handle = type.CreateInstance();
327 DALI_TEST_CHECK( handle );
329 KeyboardFocusManager manager = KeyboardFocusManager::Get();
330 DALI_TEST_CHECK(manager);
332 bool preFocusChangeSignalVerified = false;
333 PreFocusChangeCallback preFocusChangeCallback(preFocusChangeSignalVerified);
334 manager.PreFocusChangeSignal().Connect( &preFocusChangeCallback, &PreFocusChangeCallback::Callback );
336 bool focusChangedSignalVerified = false;
337 FocusChangedCallback focusChangedCallback(focusChangedSignalVerified);
338 manager.FocusChangedSignal().Connect( &focusChangedCallback, &FocusChangedCallback::Callback );
340 // Create the first actor and add it to the stage
341 Actor first = Actor::New();
342 first.SetKeyboardFocusable(true);
343 Stage::GetCurrent().Add(first);
345 // Create the second actor and add it to the stage
346 Actor second = Actor::New();
347 second.SetKeyboardFocusable(true);
348 Stage::GetCurrent().Add(second);
350 // Move the focus to the right
351 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == false);
353 // Because no layout control in the stage and no actor is focused, it should emit the PreFocusChange signal
354 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
355 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == Actor());
356 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
357 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::RIGHT);
358 preFocusChangeCallback.Reset();
360 // Check that the focus is set on the first actor
361 DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
362 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
363 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
364 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == Actor());
365 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
366 focusChangedCallback.Reset();
368 // Move the focus towards right
369 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == false);
371 // Because no layout control in the stage and the first actor is focused, it should emit the PreFocusChange signal
372 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
373 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == first);
374 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
375 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::RIGHT);
376 preFocusChangeCallback.Reset();
378 // Check that the focus is set on the second actor
379 DALI_TEST_CHECK(manager.SetCurrentFocusActor(second) == true);
380 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
381 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
382 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
383 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == second);
384 focusChangedCallback.Reset();
386 // Move the focus towards up
387 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::UP) == false);
389 // Because no layout control in the stage and no actor is focused, it should emit the PreFocusChange signal
390 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
391 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == second);
392 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
393 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::UP);
394 preFocusChangeCallback.Reset();
395 DALI_TEST_CHECK(!focusChangedCallback.mSignalVerified);
397 // Create a 2x2 table view and try to move focus inside it
398 TableView tableView = TableView::New( 2, 2 );
399 Stage::GetCurrent().Add(tableView);
401 // Create the third actor
402 Actor third = Actor::New();
403 third.SetKeyboardFocusable(true);
405 // Create the fourth actor
406 Actor fourth = Actor::New();
407 fourth.SetKeyboardFocusable(true);
409 // Add the four children to table view
410 tableView.AddChild(first, TableView::CellPosition(0, 0));
411 tableView.AddChild(second, TableView::CellPosition(0, 1));
412 tableView.AddChild(third, TableView::CellPosition(1, 0));
413 tableView.AddChild(fourth, TableView::CellPosition(1, 1));
415 // Set the focus to the first actor
416 DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
417 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
418 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
419 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == second);
420 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
421 focusChangedCallback.Reset();
423 // Move the focus towards right
424 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == true);
425 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
426 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
427 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
428 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == second);
429 focusChangedCallback.Reset();
431 // Move the focus towards down
432 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::DOWN) == true);
433 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == fourth);
434 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
435 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == second);
436 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == fourth);
437 focusChangedCallback.Reset();
439 // Move the focus towards left
440 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::LEFT) == true);
441 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == third);
442 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
443 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == fourth);
444 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == third);
445 focusChangedCallback.Reset();
447 // Move the focus towards up
448 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::UP) == true);
449 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
450 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
451 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == third);
452 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
453 focusChangedCallback.Reset();
455 // Move the focus towards left. The focus move will fail as no way to move it upwards
456 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::LEFT) == false);
457 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
458 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
459 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == first);
460 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
461 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::LEFT);
462 preFocusChangeCallback.Reset();
463 DALI_TEST_CHECK(!focusChangedCallback.mSignalVerified);
466 manager.SetFocusGroupLoop(true);
467 DALI_TEST_CHECK(manager.GetFocusGroupLoop() == true);
469 // Move the focus towards left again. The focus should move to the fourth actor.
470 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::LEFT) == true);
471 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == fourth);
472 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
473 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
474 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == fourth);
475 focusChangedCallback.Reset();
479 int UtcDaliKeyboardFocusManagerCustomAlgorithmMoveFocus(void)
481 ToolkitTestApplication application;
483 tet_infoline(" UtcDaliKeyboardFocusManagerCustomAlgorithmMoveFocus");
487 type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
488 DALI_TEST_CHECK( type );
489 BaseHandle handle = type.CreateInstance();
490 DALI_TEST_CHECK( handle );
492 KeyboardFocusManager manager = KeyboardFocusManager::Get();
493 DALI_TEST_CHECK(manager);
495 bool preFocusChangeSignalVerified = false;
496 PreFocusChangeCallback preFocusChangeCallback(preFocusChangeSignalVerified);
497 manager.PreFocusChangeSignal().Connect( &preFocusChangeCallback, &PreFocusChangeCallback::Callback );
499 bool focusChangedSignalVerified = false;
500 FocusChangedCallback focusChangedCallback(focusChangedSignalVerified);
501 manager.FocusChangedSignal().Connect( &focusChangedCallback, &FocusChangedCallback::Callback );
503 // Create the first actor and add it to the stage
504 Actor first = Actor::New();
505 first.SetKeyboardFocusable(true);
506 Stage::GetCurrent().Add(first);
508 // Create the second actor and add it to the stage
509 Actor second = Actor::New();
510 second.SetKeyboardFocusable(true);
511 Stage::GetCurrent().Add(second);
513 // Move the focus to the right
514 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == false);
516 // Because no layout control in the stage and no actor is focused, it should emit the PreFocusChange signal
517 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
518 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == Actor());
519 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
520 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::RIGHT);
521 preFocusChangeCallback.Reset();
523 bool customAlgorithmInterfaceVerified = false;
524 CustomAlgorithm customAlgorithm(customAlgorithmInterfaceVerified);
525 Toolkit::DevelKeyboardFocusManager::SetCustomAlgorithm(manager, customAlgorithm);
527 // Move the focus towards right
528 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == false);
530 // Because no layout control in the stage and the first actor is focused, it should invoke CustomAlgorithm
531 DALI_TEST_CHECK(customAlgorithm.mInterfaceVerified);
532 DALI_TEST_CHECK(customAlgorithm.mCurrentFocusedActor == Actor());
533 DALI_TEST_CHECK(customAlgorithm.mProposedActorToFocus == Actor());
534 DALI_TEST_CHECK(customAlgorithm.mDirection == Control::KeyboardFocus::RIGHT);
535 customAlgorithm.Reset();
537 // Check that the focus is set on the first actor
538 DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
539 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
540 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
541 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == Actor());
542 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
543 focusChangedCallback.Reset();
545 // Move the focus towards right
546 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == false);
548 // Because no layout control in the stage and the first actor is focused, it should invoke CustomAlgorithm
549 DALI_TEST_CHECK(customAlgorithm.mInterfaceVerified);
550 DALI_TEST_CHECK(customAlgorithm.mCurrentFocusedActor == first);
551 DALI_TEST_CHECK(customAlgorithm.mProposedActorToFocus == Actor());
552 DALI_TEST_CHECK(customAlgorithm.mDirection == Control::KeyboardFocus::RIGHT);
553 customAlgorithm.Reset();
555 // Check that the focus is set on the second actor
556 DALI_TEST_CHECK(manager.SetCurrentFocusActor(second) == true);
557 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
558 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
559 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
560 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == second);
561 focusChangedCallback.Reset();
563 // Move the focus towards up
564 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::UP) == false);
566 // Because no layout control in the stage and no actor is focused, it should invoke CustomAlgorithm
567 DALI_TEST_CHECK(customAlgorithm.mInterfaceVerified);
568 DALI_TEST_CHECK(customAlgorithm.mCurrentFocusedActor == second);
569 DALI_TEST_CHECK(customAlgorithm.mProposedActorToFocus == Actor());
570 DALI_TEST_CHECK(customAlgorithm.mDirection == Control::KeyboardFocus::UP);
571 customAlgorithm.Reset();
572 DALI_TEST_CHECK(!focusChangedCallback.mSignalVerified);
576 int UtcDaliKeyboardFocusManagerFocusablePropertiesMoveFocus(void)
578 ToolkitTestApplication application;
580 tet_infoline(" UtcDaliKeyboardFocusManagerCustomAlgorithmMoveFocus");
584 type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
585 DALI_TEST_CHECK( type );
586 BaseHandle handle = type.CreateInstance();
587 DALI_TEST_CHECK( handle );
589 KeyboardFocusManager manager = KeyboardFocusManager::Get();
590 DALI_TEST_CHECK(manager);
592 bool focusChangedSignalVerified = false;
593 FocusChangedCallback focusChangedCallback(focusChangedSignalVerified);
594 manager.FocusChangedSignal().Connect( &focusChangedCallback, &FocusChangedCallback::Callback );
596 PushButton button1 = PushButton::New();
597 PushButton button2 = PushButton::New();
598 button1.SetKeyboardFocusable(true);
599 button2.SetKeyboardFocusable(true);
600 Stage::GetCurrent().Add(button1);
601 Stage::GetCurrent().Add(button2);
603 // Set the focus to the button1
604 DALI_TEST_CHECK(manager.SetCurrentFocusActor(button1) == true);
605 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == button1);
606 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
607 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == Actor());
608 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == button1);
609 focusChangedCallback.Reset();
611 // set the navigation properties of button1
612 button1.SetProperty(Toolkit::DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID, Property::Value((int)button2.GetId()));
613 button1.SetProperty(Toolkit::DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID, Property::Value((int)button2.GetId()));
614 button1.SetProperty(Toolkit::DevelControl::Property::UP_FOCUSABLE_ACTOR_ID, Property::Value((int)button2.GetId()));
615 button1.SetProperty(Toolkit::DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID, Property::Value((int)button2.GetId()));
617 // set the navigation properties of button2
618 button2.SetProperty(Toolkit::DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID, Property::Value((int)button1.GetId()));
619 button2.SetProperty(Toolkit::DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID, Property::Value((int)button1.GetId()));
620 button2.SetProperty(Toolkit::DevelControl::Property::UP_FOCUSABLE_ACTOR_ID, Property::Value((int)button1.GetId()));
621 button2.SetProperty(Toolkit::DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID, Property::Value((int)button1.GetId()));
623 // Move the focus towards left
624 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::LEFT) == true);
626 // Confirm whether focus is moved to button2
627 DALI_TEST_EQUALS(button2.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
628 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
629 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == button1);
630 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == button2);
631 focusChangedCallback.Reset();
633 // Move the focus towards right
634 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == true);
636 // Confirm whether focus is moved to button1
637 DALI_TEST_EQUALS(button1.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
638 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
639 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == button2);
640 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == button1);
641 focusChangedCallback.Reset();
643 // Move the focus towards up
644 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::UP) == true);
646 // Confirm whether focus is moved to button2
647 DALI_TEST_EQUALS(button2.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
648 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
649 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == button1);
650 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == button2);
651 focusChangedCallback.Reset();
653 // Move the focus towards down
654 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::DOWN) == true);
656 // Confirm whether focus is moved to button1
657 DALI_TEST_EQUALS(button1.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
658 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
659 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == button2);
660 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == button1);
661 focusChangedCallback.Reset();
663 // Create a 1x1 table view and try to move focus inside it
664 TableView tableView = TableView::New( 1, 1 );
665 Stage::GetCurrent().Add(tableView);
667 PushButton button = PushButton::New();
668 button.SetKeyboardFocusable(true);
669 tableView.AddChild(button, TableView::CellPosition(0, 0));
671 // set the navigation properties of button3
672 button.SetProperty(Toolkit::DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID, Property::Value((int)button1.GetId()));
674 // Set the focus to the button
675 DALI_TEST_CHECK(manager.SetCurrentFocusActor(button) == true);
676 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == button);
677 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
678 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == button1);
679 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == button);
680 focusChangedCallback.Reset();
682 // Move the focus towards left
683 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::LEFT) == true);
685 // Confirm whether focus is moved to button1
686 DALI_TEST_EQUALS(button1.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
687 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
688 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == button);
689 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == button1);
690 focusChangedCallback.Reset();
695 int UtcDaliKeyboardFocusManagerClearFocus(void)
697 ToolkitTestApplication application;
699 tet_infoline(" UtcDaliKeyboardFocusManagerClearFocus");
701 KeyboardFocusManager manager = KeyboardFocusManager::Get();
702 DALI_TEST_CHECK(manager);
704 // Create the first actor and add it to the stage
705 Actor first = Actor::New();
706 first.SetKeyboardFocusable(true);
707 Stage::GetCurrent().Add(first);
709 // Create the second actor and add it to the stage
710 Actor second = Actor::New();
711 second.SetKeyboardFocusable(true);
712 Stage::GetCurrent().Add(second);
714 // Check that the focus is set on the first actor
715 DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
716 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
718 // Check that the focus is set on the second actor
719 DALI_TEST_CHECK(manager.SetCurrentFocusActor(second) == true);
720 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
723 manager.ClearFocus();
725 // Check that no actor is being focused now.
726 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
730 int UtcDaliKeyboardFocusManagerSetAndGetFocusGroupLoop(void)
732 ToolkitTestApplication application;
734 tet_infoline(" UtcDaliKeyboardFocusManagerSetAndGetFocusGroupLoop");
736 KeyboardFocusManager manager = KeyboardFocusManager::Get();
737 DALI_TEST_CHECK(manager);
739 // Check that the focus movement is not looped within the same focus group by default
740 DALI_TEST_CHECK(manager.GetFocusGroupLoop() == false);
743 manager.SetFocusGroupLoop(true);
744 DALI_TEST_CHECK(manager.GetFocusGroupLoop() == true);
748 int UtcDaliKeyboardFocusManagerSetAsFocusGroup(void)
750 ToolkitTestApplication application;
752 tet_infoline(" UtcDaliKeyboardFocusManagerSetAsFocusGroup");
754 KeyboardFocusManager manager = KeyboardFocusManager::Get();
755 DALI_TEST_CHECK(manager);
757 // Create an actor and check that it is not a focus group by default
758 Actor actor = Actor::New();
759 DALI_TEST_CHECK(manager.IsFocusGroup(actor) == false);
761 // Set the actor as focus group
762 manager.SetAsFocusGroup(actor, true);
764 // flush the queue and render once
765 application.SendNotification();
766 application.Render();
768 DALI_TEST_CHECK(manager.IsFocusGroup(actor) == true);
770 // Set the actor not as focus group
771 manager.SetAsFocusGroup(actor, false);
773 // flush the queue and render once
774 application.SendNotification();
775 application.Render();
777 DALI_TEST_CHECK(manager.IsFocusGroup(actor) == false);
781 int UtcDaliKeyboardFocusManagerGetFocusGroup(void)
783 ToolkitTestApplication application;
785 tet_infoline(" UtcDaliKeyboardFocusManagerGetFocusGroup");
787 KeyboardFocusManager manager = KeyboardFocusManager::Get();
788 DALI_TEST_CHECK(manager);
790 // Create an actor with two child actors and add it to the stage
791 Actor parent = Actor::New();
792 Actor child = Actor::New();
794 Stage::GetCurrent().Add(parent);
796 // Create three actors and add them as the children of the first child actor
797 Actor grandChild = Actor::New();
798 child.Add(grandChild);
800 // Set the parent and the first child actor as focus groups
801 manager.SetAsFocusGroup(parent, true);
803 // flush the queue and render once
804 application.SendNotification();
805 application.Render();
807 DALI_TEST_CHECK(manager.IsFocusGroup(parent) == true);
809 // The current focus group should be the parent, As it is the immediate parent which is also a focus group.
810 DALI_TEST_CHECK(manager.GetFocusGroup(grandChild) == parent);
812 manager.SetAsFocusGroup(child, true);
814 // flush the queue and render once
815 application.SendNotification();
816 application.Render();
818 DALI_TEST_CHECK(manager.IsFocusGroup(child) == true);
820 // The focus group should be the child, As it is the immediate parent which is also a focus group.
821 DALI_TEST_CHECK(manager.GetFocusGroup(grandChild) == child);
823 manager.SetAsFocusGroup(grandChild, true);
825 // flush the queue and render once
826 application.SendNotification();
827 application.Render();
829 DALI_TEST_CHECK(manager.IsFocusGroup(grandChild) == true);
831 // The current focus group should be itself, As it is also a focus group.
832 DALI_TEST_CHECK(manager.GetFocusGroup(grandChild) == grandChild);
836 int UtcDaliKeyboardFocusManagerSetAndGetFocusIndicator(void)
838 ToolkitTestApplication application;
840 tet_infoline(" UtcDaliKeyboardFocusManagerSetAndGetFocusIndicator");
842 KeyboardFocusManager manager = KeyboardFocusManager::Get();
843 DALI_TEST_CHECK(manager);
845 Actor defaultFocusIndicatorActor = manager.GetFocusIndicatorActor();
846 DALI_TEST_CHECK(defaultFocusIndicatorActor);
848 Actor newFocusIndicatorActor = Actor::New();
849 manager.SetFocusIndicatorActor(newFocusIndicatorActor);
850 DALI_TEST_CHECK(manager.GetFocusIndicatorActor() == newFocusIndicatorActor);
855 int UtcDaliKeyboardFocusManagerSignalFocusedActorActivated(void)
857 ToolkitTestApplication application;
859 tet_infoline(" UtcDaliKeyboardFocusManagerSignalFocusedActorActivated");
861 KeyboardFocusManager manager = KeyboardFocusManager::Get();
862 DALI_TEST_CHECK(manager);
864 bool focusedActorActivatedSignalVerified = false;
865 FocusedActorActivatedCallback focusedActorActivatedCallback(focusedActorActivatedSignalVerified);
866 manager.FocusedActorEnterKeySignal().Connect( &focusedActorActivatedCallback, &FocusedActorActivatedCallback::Callback );
868 Integration::KeyEvent returnEvent( "Return", "", 0, 0, 0, Integration::KeyEvent::Up, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
870 // Press Any key to notice physical keyboard event is comming to KeyboardFocusManager
871 // It makes mIsFocusIndicatorEnabled true
872 application.ProcessEvent(returnEvent);
874 // Create the first button and add it to the stage
875 PushButton firstPushButton = PushButton::New();
876 firstPushButton.SetKeyboardFocusable(true);
877 Stage::GetCurrent().Add(firstPushButton);
879 // Create the second button and add it to the stage
880 PushButton secondPushButton = PushButton::New();
881 secondPushButton.SetKeyboardFocusable(true);
882 Stage::GetCurrent().Add(secondPushButton);
884 // Check that the focus is set on the first button
885 DALI_TEST_CHECK(manager.SetCurrentFocusActor(firstPushButton) == true);
886 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == firstPushButton);
888 // Send the return event to activate the first button
889 application.ProcessEvent(returnEvent);
890 DALI_TEST_CHECK(focusedActorActivatedCallback.mSignalVerified);
891 DALI_TEST_CHECK(focusedActorActivatedCallback.mActivatedActor == firstPushButton);
892 focusedActorActivatedCallback.Reset();
894 // Check that the focus is set on the second button
895 DALI_TEST_CHECK(manager.SetCurrentFocusActor(secondPushButton) == true);
896 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == secondPushButton);
898 // Send the return event again to activate the second button
899 application.ProcessEvent(returnEvent);
900 DALI_TEST_CHECK(focusedActorActivatedCallback.mSignalVerified);
901 DALI_TEST_CHECK(focusedActorActivatedCallback.mActivatedActor == secondPushButton);
902 focusedActorActivatedCallback.Reset();
906 int UtcDaliKeyboardFocusManagerSignalFocusGroupChanged(void)
908 ToolkitTestApplication application;
910 tet_infoline(" UtcDaliKeyboardFocusManagerSignalFocusGroupChanged");
914 type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
915 DALI_TEST_CHECK( type );
916 BaseHandle handle = type.CreateInstance();
917 DALI_TEST_CHECK( handle );
919 KeyboardFocusManager manager = KeyboardFocusManager::Get();
920 DALI_TEST_CHECK(manager);
922 bool focusGroupChangedSignalVerified = false;
923 FocusGroupChangedCallback focusGroupChangedCallback(focusGroupChangedSignalVerified);
924 manager.FocusGroupChangedSignal().Connect( &focusGroupChangedCallback, &FocusGroupChangedCallback::Callback );
926 Integration::KeyEvent tabEvent( "Tab", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
927 Integration::KeyEvent shiftTabEvent( "Tab", "", 0, 1, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
929 // Press Any key to notice physical keyboard event is comming to KeyboardFocusManager
930 // It makes mIsFocusIndicatorEnabled true
931 application.ProcessEvent(tabEvent);
933 // Send the tab event to change focus group in the forward direction
934 application.ProcessEvent(tabEvent);
935 DALI_TEST_CHECK(focusGroupChangedCallback.mSignalVerified);
936 DALI_TEST_CHECK(focusGroupChangedCallback.mCurrentFocusedActor == Actor());
937 DALI_TEST_CHECK(focusGroupChangedCallback.mForward == true);
938 focusGroupChangedCallback.Reset();
940 // Send the shift tab event to change focus group in the backward direction
941 application.ProcessEvent(shiftTabEvent);
942 DALI_TEST_CHECK(focusGroupChangedCallback.mSignalVerified);
943 DALI_TEST_CHECK(focusGroupChangedCallback.mCurrentFocusedActor == Actor());
944 DALI_TEST_CHECK(focusGroupChangedCallback.mForward == false);
945 focusGroupChangedCallback.Reset();
949 int UtcDaliKeyboardFocusManagerSignals(void)
951 ToolkitTestApplication application;
953 KeyboardFocusManager manager = KeyboardFocusManager::Get();
954 DALI_TEST_CHECK( manager );
956 ConnectionTracker* testTracker = new ConnectionTracker();
957 DALI_TEST_EQUALS( true, manager.ConnectSignal( testTracker, "keyboardPreFocusChange", CallbackFunctor() ), TEST_LOCATION );
958 DALI_TEST_EQUALS( true, manager.ConnectSignal( testTracker, "keyboardFocusChanged", CallbackFunctor() ), TEST_LOCATION );
959 DALI_TEST_EQUALS( true, manager.ConnectSignal( testTracker, "keyboardFocusGroupChanged", CallbackFunctor() ), TEST_LOCATION );
960 DALI_TEST_EQUALS( true, manager.ConnectSignal( testTracker, "keyboardFocusedActorEnterKey", CallbackFunctor() ), TEST_LOCATION );
965 int UtcDaliKeyboardFocusManagerMoveFocusBackward(void)
967 ToolkitTestApplication application;
969 tet_infoline(" UtcDaliKeyboardFocusManagerMoveFocusBackward");
971 KeyboardFocusManager manager = KeyboardFocusManager::Get();
972 DALI_TEST_CHECK(manager);
974 // Create the first actor and add it to the stage
975 Actor first = Actor::New();
976 first.SetKeyboardFocusable(true);
977 Stage::GetCurrent().Add(first);
979 // Create the second actor and add it to the stage
980 Actor second = Actor::New();
981 second.SetKeyboardFocusable(true);
982 Stage::GetCurrent().Add(second);
984 // Create the third actor and add it to the stage
985 Actor third = Actor::New();
986 third.SetKeyboardFocusable(true);
987 Stage::GetCurrent().Add(third);
989 // Create the fourth actor and add it to the stage
990 Actor fourth = Actor::New();
991 fourth.SetKeyboardFocusable(true);
992 Stage::GetCurrent().Add(fourth);
994 // Check that the focus is set on the second actor
995 DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
996 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
998 // Check that the focus is set on the second actor
999 DALI_TEST_CHECK(manager.SetCurrentFocusActor(second) == true);
1000 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
1002 // Check that the focus is set on the third actor
1003 DALI_TEST_CHECK(manager.SetCurrentFocusActor(third) == true);
1004 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == third);
1006 // Check that the focus is set on the third actor
1007 DALI_TEST_CHECK(manager.SetCurrentFocusActor(fourth) == true);
1008 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == fourth);
1010 // Move the focus backward
1011 manager.MoveFocusBackward();
1013 // Check that it current focused actor is third actor
1014 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == third);
1016 // Remove the second actor on stage
1019 // Reset the first actor
1023 // Move the focus backward
1024 manager.MoveFocusBackward();
1026 // Check that it current focused actor is third actor
1027 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == third);
1029 // Make history stack full
1030 for(int i = 0 ; i < 31 ; i ++)
1032 Actor actor = Actor::New();
1033 actor.SetKeyboardFocusable(true);
1034 Stage::GetCurrent().Add(actor);
1035 manager.SetCurrentFocusActor(actor);
1038 for(int i = 0 ; i < 31 ; i ++)
1040 manager.MoveFocusBackward();
1043 // Check that it current focused actor is not second actor
1044 DALI_TEST_CHECK(manager.GetCurrentFocusActor() != second);
1049 int UtcDaliKeyboardFocusManagerChangeFocusDirectionByKeyEvents(void)
1051 ToolkitTestApplication application;
1053 tet_infoline(" UtcDaliKeyboardFocusManagerChangeFocusDirectionByKeyEvents");
1055 KeyboardFocusManager manager = KeyboardFocusManager::Get();
1056 DALI_TEST_CHECK(manager);
1058 bool preFocusChangeSignalVerified = false;
1059 PreFocusChangeCallback preFocusChangeCallback(preFocusChangeSignalVerified);
1060 manager.PreFocusChangeSignal().Connect( &preFocusChangeCallback, &PreFocusChangeCallback::Callback );
1062 bool focusChangedSignalVerified = false;
1063 FocusChangedCallback focusChangedCallback(focusChangedSignalVerified);
1064 manager.FocusChangedSignal().Connect( &focusChangedCallback, &FocusChangedCallback::Callback );
1066 Integration::KeyEvent leftEvent( "Left", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
1067 Integration::KeyEvent rightEvent( "Right", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
1068 Integration::KeyEvent upEvent( "Up", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
1069 Integration::KeyEvent downEvent( "Down", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
1070 Integration::KeyEvent pageUpEvent( "Prior", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
1071 Integration::KeyEvent pageDownEvent( "Next", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
1073 // Press Any key to notice physical keyboard event is comming to KeyboardFocusManager
1074 // It makes mIsFocusIndicatorEnabled true
1075 application.ProcessEvent(leftEvent);
1077 // Create a 2x2 table view and try to move focus inside it
1078 TableView tableView = TableView::New( 2, 2 );
1079 Stage::GetCurrent().Add(tableView);
1081 // Create the first actor
1082 Actor first = Actor::New();
1083 first.SetKeyboardFocusable(true);
1085 // Create the second actor
1086 Actor second = Actor::New();
1087 second.SetKeyboardFocusable(true);
1089 // Create the third actor
1090 Actor third = Actor::New();
1091 third.SetKeyboardFocusable(true);
1093 // Create the fourth actor
1094 Actor fourth = Actor::New();
1095 fourth.SetKeyboardFocusable(true);
1097 // Add the four children to table view
1098 tableView.AddChild(first, TableView::CellPosition(0, 0));
1099 tableView.AddChild(second, TableView::CellPosition(0, 1));
1100 tableView.AddChild(third, TableView::CellPosition(1, 0));
1101 tableView.AddChild(fourth, TableView::CellPosition(1, 1));
1103 // Set the focus to the first actor
1104 DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
1105 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
1106 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
1107 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == Actor());
1108 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
1109 focusChangedCallback.Reset();
1111 // Send the right key event to move the focus towards right
1112 application.ProcessEvent(rightEvent);
1113 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
1114 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
1115 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
1116 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == second);
1117 focusChangedCallback.Reset();
1119 // Send the down key event to move the focus towards down
1120 application.ProcessEvent(downEvent);
1121 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == fourth);
1122 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
1123 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == second);
1124 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == fourth);
1125 focusChangedCallback.Reset();
1127 // Send the down event to move the focus towards left
1128 application.ProcessEvent(leftEvent);
1129 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == third);
1130 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
1131 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == fourth);
1132 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == third);
1133 focusChangedCallback.Reset();
1135 // Send the up event to move the focus towards up
1136 application.ProcessEvent(upEvent);
1137 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
1138 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
1139 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == third);
1140 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
1141 focusChangedCallback.Reset();
1143 // Send the pape up event, but focus should not be moved because page up is not supported by table view
1144 application.ProcessEvent(pageUpEvent);
1145 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
1146 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
1147 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == first);
1148 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == first);
1149 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::PAGE_UP);
1150 preFocusChangeCallback.Reset();
1152 // Send the pape down event, but focus should not be moved because page down is not supported by table view
1153 application.ProcessEvent(pageDownEvent);
1154 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
1155 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
1156 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == first);
1157 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == first);
1158 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::PAGE_DOWN);
1159 preFocusChangeCallback.Reset();
1162 manager.ClearFocus();
1164 // Send the pape up event, but nothing was focued so focus manager will try the initial focus
1165 preFocusChangeCallback.Reset();
1166 application.ProcessEvent(pageUpEvent);
1167 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
1168 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
1169 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == Actor());
1170 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
1171 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::RIGHT);
1173 // Clear the focus again
1174 manager.ClearFocus();
1176 // Send the pape down event, but nothing was focued so focus manager will try the initial focus
1177 preFocusChangeCallback.Reset();
1178 application.ProcessEvent(pageDownEvent);
1179 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
1180 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
1181 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == Actor());
1182 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
1183 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::RIGHT);
1185 // Clear the focus again
1186 manager.ClearFocus();
1188 // Send the up event for line coverage, but nothing was focued so focus manager will try the initial focus
1189 preFocusChangeCallback.Reset();
1190 application.ProcessEvent(upEvent);
1191 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
1192 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
1193 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == Actor());
1194 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
1196 // Clear the focus again
1197 manager.ClearFocus();
1199 // Send the down event for line coverage, but nothing was focued so focus manager will try the initial focus
1200 preFocusChangeCallback.Reset();
1201 application.ProcessEvent(downEvent);
1202 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
1203 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
1204 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == Actor());
1205 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
1210 int UtcDaliKeyboardFocusManagerSignalChangedBySpaceKeyEvent(void)
1212 ToolkitTestApplication application;
1214 tet_infoline(" UtcDaliKeyboardFocusManagerSignalChangedBySpaceKeyEvent");
1216 KeyboardFocusManager manager = KeyboardFocusManager::Get();
1217 DALI_TEST_CHECK(manager);
1219 bool preFocusChangeSignalVerified = false;
1220 PreFocusChangeCallback preFocusChangeCallback(preFocusChangeSignalVerified);
1221 manager.PreFocusChangeSignal().Connect( &preFocusChangeCallback, &PreFocusChangeCallback::Callback );
1223 Integration::KeyEvent spaceEvent( "space", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
1225 // Press Any key to notice physical keyboard event is comming to KeyboardFocusManager
1226 // It makes mIsFocusIndicatorEnabled true
1227 application.ProcessEvent(spaceEvent);
1229 // Send the space event
1230 application.ProcessEvent(spaceEvent);
1231 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
1232 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == Actor());
1234 // Clear the focus again
1235 manager.ClearFocus();
1237 // Send the space event again for line coverage
1238 preFocusChangeCallback.Reset();
1239 application.ProcessEvent(spaceEvent);
1240 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
1241 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
1242 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == Actor());
1243 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
1250 int UtcDaliKeyboardFocusManagerMoveFocusTestStateChange(void)
1252 ToolkitTestApplication application;
1254 tet_infoline(" UtcDaliKeyboardFocusManagerMoveFocusTestStateChange");
1258 type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
1259 DALI_TEST_CHECK( type );
1260 BaseHandle handle = type.CreateInstance();
1261 DALI_TEST_CHECK( handle );
1263 KeyboardFocusManager manager = KeyboardFocusManager::Get();
1264 DALI_TEST_CHECK(manager);
1266 bool preFocusChangeSignalVerified = false;
1267 PreFocusChangeCallback preFocusChangeCallback(preFocusChangeSignalVerified);
1268 manager.PreFocusChangeSignal().Connect( &preFocusChangeCallback, &PreFocusChangeCallback::Callback );
1270 bool focusChangedSignalVerified = false;
1271 FocusChangedCallback focusChangedCallback(focusChangedSignalVerified);
1272 manager.FocusChangedSignal().Connect( &focusChangedCallback, &FocusChangedCallback::Callback );
1274 // Create the first actor and add it to the stage
1275 Control first = Control::New();
1276 first.SetKeyboardFocusable(true);
1277 Stage::GetCurrent().Add(first);
1279 // Create the second actor and add it to the stage
1280 Control second = Control::New();
1281 second.SetKeyboardFocusable(true);
1282 Stage::GetCurrent().Add(second);
1284 // Move the focus to the right
1285 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == false);
1287 // Because no layout control in the stage and no actor is focused, it should emit the PreFocusChange signal
1288 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
1289 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == Actor());
1290 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
1291 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::RIGHT);
1292 preFocusChangeCallback.Reset();
1294 // Check that the focus is set on the first actor
1295 DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
1296 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
1297 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
1298 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == Actor());
1299 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
1300 DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
1301 focusChangedCallback.Reset();
1303 // Move the focus towards right
1304 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == false);
1306 // Because no layout control in the stage and the first actor is focused, it should emit the PreFocusChange signal
1307 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
1308 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == first);
1309 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
1310 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::RIGHT);
1311 preFocusChangeCallback.Reset();
1313 // Check that the focus is set on the second actor
1314 DALI_TEST_CHECK(manager.SetCurrentFocusActor(second) == true);
1315 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
1316 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
1317 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
1318 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == second);
1319 DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1320 DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
1321 focusChangedCallback.Reset();
1323 // Move the focus towards up
1324 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::UP) == false);
1326 // Because no layout control in the stage and no actor is focused, it should emit the PreFocusChange signal
1327 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
1328 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == second);
1329 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
1330 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::UP);
1331 preFocusChangeCallback.Reset();
1332 DALI_TEST_CHECK(!focusChangedCallback.mSignalVerified);
1334 // Create a 2x2 table view and try to move focus inside it
1335 TableView tableView = TableView::New( 2, 2 );
1336 Stage::GetCurrent().Add(tableView);
1338 // Create the third actor
1339 Control third = Control::New();
1340 third.SetKeyboardFocusable(true);
1342 // Create the fourth actor
1343 Control fourth = Control::New();
1344 fourth.SetKeyboardFocusable(true);
1346 // Add the four children to table view
1347 tableView.AddChild(first, TableView::CellPosition(0, 0));
1348 tableView.AddChild(second, TableView::CellPosition(0, 1));
1349 tableView.AddChild(third, TableView::CellPosition(1, 0));
1350 tableView.AddChild(fourth, TableView::CellPosition(1, 1));
1352 // Set the focus to the first actor
1353 DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
1354 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
1355 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
1356 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == second);
1357 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
1359 DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
1360 DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1362 focusChangedCallback.Reset();
1364 // Move the focus towards right
1365 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == true);
1366 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
1367 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
1368 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
1369 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == second);
1370 DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1371 DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
1373 focusChangedCallback.Reset();
1375 // Move the focus towards down
1376 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::DOWN) == true);
1377 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == fourth);
1378 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
1379 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == second);
1380 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == fourth);
1382 DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1383 DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1384 DALI_TEST_EQUALS(third.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1385 DALI_TEST_EQUALS(fourth.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
1387 focusChangedCallback.Reset();
1389 // Move the focus towards left
1390 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::LEFT) == true);
1391 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == third);
1392 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
1393 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == fourth);
1394 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == third);
1396 DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1397 DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1398 DALI_TEST_EQUALS(third.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
1399 DALI_TEST_EQUALS(fourth.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1401 focusChangedCallback.Reset();
1403 // Move the focus towards up
1404 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::UP) == true);
1405 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
1406 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
1407 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == third);
1408 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
1409 DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
1410 DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1411 DALI_TEST_EQUALS(third.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1412 DALI_TEST_EQUALS(fourth.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1413 focusChangedCallback.Reset();
1415 // Move the focus towards left. The focus move will fail as no way to move it upwards
1416 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::LEFT) == false);
1417 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
1418 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
1419 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == first);
1420 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
1421 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::LEFT);
1422 DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
1423 DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1424 DALI_TEST_EQUALS(third.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1425 DALI_TEST_EQUALS(fourth.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1427 preFocusChangeCallback.Reset();
1428 DALI_TEST_CHECK(!focusChangedCallback.mSignalVerified);
1431 manager.SetFocusGroupLoop(true);
1432 DALI_TEST_CHECK(manager.GetFocusGroupLoop() == true);
1434 // Move the focus towards left again. The focus should move to the fourth actor.
1435 DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::LEFT) == true);
1436 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == fourth);
1437 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
1438 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
1439 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == fourth);
1441 DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1442 DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1443 DALI_TEST_EQUALS(third.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1444 DALI_TEST_EQUALS(fourth.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
1446 focusChangedCallback.Reset();
1449 manager.ClearFocus();
1450 DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1451 DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1452 DALI_TEST_EQUALS(third.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1453 DALI_TEST_EQUALS(fourth.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
1459 int UtcDaliKeyboardFocusManagerFocusedActorUnstaged(void)
1461 ToolkitTestApplication application;
1463 tet_infoline( "Ensure we cannot set an actor to be focused if it is not staged and that we do not retrieve an actor if it has been unstaged" );
1465 KeyboardFocusManager manager = KeyboardFocusManager::Get();
1466 DALI_TEST_CHECK( ! manager.GetCurrentFocusActor() );
1468 Actor actor = Actor::New();
1469 actor.SetKeyboardFocusable( true );
1471 tet_infoline( "Attempt to set unstaged actor, no actor should be returned from KeyboardFocusManager" );
1472 manager.SetCurrentFocusActor( actor );
1473 DALI_TEST_CHECK( ! manager.GetCurrentFocusActor() );
1475 tet_infoline( "Add actor to stage and attempt to set, our actor should be returned from KeyboardFocusManager" );
1476 Stage::GetCurrent().Add( actor );
1477 manager.SetCurrentFocusActor( actor );
1478 DALI_TEST_CHECK( manager.GetCurrentFocusActor() == actor );
1480 tet_infoline( "Remove actor from stage and attempt to retrieve, no actor should be returned from KeyboardFocusManager" );
1482 DALI_TEST_CHECK( ! manager.GetCurrentFocusActor() );
1487 int UtcDaliKeyboardFocusManagerEnableFocusIndicator(void)
1489 ToolkitTestApplication application;
1491 tet_infoline( "Ensure we cannot set an actor to be focused if it is not staged and that we do not retrieve an actor if it has been unstaged" );
1493 KeyboardFocusManager manager = KeyboardFocusManager::Get();
1494 DALI_TEST_CHECK( ! manager.GetCurrentFocusActor() );
1496 Actor actor = Actor::New();
1497 actor.SetKeyboardFocusable( true );
1498 Stage::GetCurrent().Add( actor );
1499 manager.SetCurrentFocusActor( actor );
1501 // Press Any key to notice physical keyboard event is comming to KeyboardFocusManager
1502 // It makes mIsFocusIndicatorEnabled true and add focus indicator to focused actor.
1503 Integration::KeyEvent rightEvent( "Right", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
1504 application.ProcessEvent(rightEvent);
1506 Actor indicatorActor = manager.GetFocusIndicatorActor();
1508 tet_infoline( "Indicator is added to focused actor" );
1509 DALI_TEST_CHECK( actor == indicatorActor.GetParent() );
1511 Dali::Toolkit::DevelKeyboardFocusManager::EnableFocusIndicator(manager, false);
1512 DALI_TEST_CHECK( !Dali::Toolkit::DevelKeyboardFocusManager::IsFocusIndicatorEnabled(manager) );
1514 tet_infoline( "Indicator is removed from focused actor because mUseFocusIndicator is false" );
1515 DALI_TEST_CHECK( !indicatorActor.GetParent() );