2 * Copyright (c) 2014 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/controls/table-view/table-view.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 // Functors to test whether PreFocusChange signal is emitted when the keyboard focus is about to change
48 class PreFocusChangeCallback : public Dali::ConnectionTracker
51 PreFocusChangeCallback(bool& signalReceived)
52 : mSignalVerified(signalReceived),
53 mCurrentFocusedActor(),
54 mProposedActorToFocus(),
55 mDirection(Control::Left)
59 Actor Callback(Actor currentFocusedActor, Actor proposedActorToFocus, Control::KeyboardFocusNavigationDirection direction)
61 tet_infoline("Verifying PreFocusChangeCallback()");
63 mSignalVerified = true;
65 mCurrentFocusedActor = currentFocusedActor;
66 mProposedActorToFocus = proposedActorToFocus;
67 mDirection = direction;
69 return mProposedActorToFocus;
74 mSignalVerified = false;
75 mCurrentFocusedActor = Actor();
76 mProposedActorToFocus = Actor();
77 mDirection = Control::Left;
80 bool& mSignalVerified;
81 Actor mCurrentFocusedActor;
82 Actor mProposedActorToFocus;
83 Control::KeyboardFocusNavigationDirection mDirection;
86 // Functors to test whether focus changed signal is emitted when the keyboard focus is changed
87 class FocusChangedCallback : public Dali::ConnectionTracker
90 FocusChangedCallback(bool& signalReceived)
91 : mSignalVerified(signalReceived),
92 mOriginalFocusedActor(),
93 mCurrentFocusedActor()
97 void Callback(Actor originalFocusedActor, Actor currentFocusedActor)
99 tet_infoline("Verifying FocusChangedCallback()");
101 if(originalFocusedActor == mCurrentFocusedActor)
103 mSignalVerified = true;
106 mOriginalFocusedActor = originalFocusedActor;
107 mCurrentFocusedActor = currentFocusedActor;
112 mSignalVerified = false;
115 bool& mSignalVerified;
116 Actor mOriginalFocusedActor;
117 Actor mCurrentFocusedActor;
120 // Functors to test whether focus group changed signal is emitted when the keyboard focus group is changed
121 class FocusGroupChangedCallback : public Dali::ConnectionTracker
124 FocusGroupChangedCallback(bool& signalReceived)
125 : mSignalVerified(signalReceived),
126 mCurrentFocusedActor(),
131 void Callback(Actor currentFocusedActor, bool forward)
133 tet_infoline("Verifying FocusGroupChangedCallback()");
135 mSignalVerified = true;
137 mCurrentFocusedActor = currentFocusedActor;
143 mSignalVerified = false;
146 bool& mSignalVerified;
147 Actor mCurrentFocusedActor;
151 // Functors to test whether focused actor activated signal is emitted when the focused actor is activated
152 class FocusedActorActivatedCallback : public Dali::ConnectionTracker
155 FocusedActorActivatedCallback(bool& signalReceived)
156 : mSignalVerified(signalReceived),
161 void Callback(Actor activatedActor)
163 tet_infoline("Verifying FocusedActorActivatedCallback()");
165 mSignalVerified = true;
167 mActivatedActor = activatedActor;
172 mSignalVerified = false;
175 bool& mSignalVerified;
176 Actor mActivatedActor;
182 int UtcDaliKeyboardFocusManagerGet(void)
184 ToolkitTestApplication application;
186 tet_infoline(" UtcDaliKeyboardKeyboardFocusManagerGet");
190 type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
191 DALI_TEST_CHECK( type );
192 BaseHandle handle = type.CreateInstance();
193 DALI_TEST_CHECK( handle );
195 KeyboardFocusManager manager;
197 manager = KeyboardFocusManager::Get();
198 DALI_TEST_CHECK(manager);
200 KeyboardFocusManager newManager = KeyboardFocusManager::Get();
201 DALI_TEST_CHECK(newManager);
203 // Check that focus manager is a singleton
204 DALI_TEST_CHECK(manager == newManager);
208 int UtcDaliKeyboardFocusManagerSetAndGetCurrentFocusActor(void)
210 ToolkitTestApplication application;
212 tet_infoline(" UtcDaliKeyboardFocusManagerSetAndGetCurrentFocusActor");
214 KeyboardFocusManager manager = KeyboardFocusManager::Get();
215 DALI_TEST_CHECK(manager);
217 // Create the first actor and add it to the stage
218 Actor first = Actor::New();
219 first.SetKeyboardFocusable(true);
220 Stage::GetCurrent().Add(first);
222 // Create the second actor and add it to the stage
223 Actor second = Actor::New();
224 second.SetKeyboardFocusable(true);
225 Stage::GetCurrent().Add(second);
227 // Create the third actor but don't add it to the stage
228 Actor third = Actor::New();
230 // Check that no actor is being focused yet.
231 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
233 // Check that it will fail to set focus on an invalid actor
234 DALI_TEST_CHECK(manager.SetCurrentFocusActor(Actor()) == false);
236 // Check that the focus is set on the first actor
237 DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
238 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
240 // Check that the focus is set on the second actor
241 DALI_TEST_CHECK(manager.SetCurrentFocusActor(second) == true);
242 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
244 // Check that it will fail to set focus on the third actor as it's not in the stage
245 DALI_TEST_CHECK(manager.SetCurrentFocusActor(third) == false);
246 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
248 // Add the third actor to the stage
249 Stage::GetCurrent().Add(third);
251 // Check that it will fail to set focus on the third actor as it's not focusable
252 DALI_TEST_CHECK(manager.SetCurrentFocusActor(third) == false);
253 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
255 // Make the third actor focusable
256 third.SetKeyboardFocusable(true);
258 // Check that the focus is successfully moved to the third actor
259 DALI_TEST_CHECK(manager.SetCurrentFocusActor(third) == true);
260 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == third);
264 int UtcDaliKeyboardFocusManagerMoveFocus(void)
266 ToolkitTestApplication application;
268 tet_infoline(" UtcDaliKeyboardFocusManagerMoveFocus");
272 type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
273 DALI_TEST_CHECK( type );
274 BaseHandle handle = type.CreateInstance();
275 DALI_TEST_CHECK( handle );
277 KeyboardFocusManager manager = KeyboardFocusManager::Get();
278 DALI_TEST_CHECK(manager);
280 bool preFocusChangeSignalVerified = false;
281 PreFocusChangeCallback preFocusChangeCallback(preFocusChangeSignalVerified);
282 manager.PreFocusChangeSignal().Connect( &preFocusChangeCallback, &PreFocusChangeCallback::Callback );
284 bool focusChangedSignalVerified = false;
285 FocusChangedCallback focusChangedCallback(focusChangedSignalVerified);
286 manager.FocusChangedSignal().Connect( &focusChangedCallback, &FocusChangedCallback::Callback );
288 // Create the first actor and add it to the stage
289 Actor first = Actor::New();
290 first.SetKeyboardFocusable(true);
291 Stage::GetCurrent().Add(first);
293 // Create the second actor and add it to the stage
294 Actor second = Actor::New();
295 second.SetKeyboardFocusable(true);
296 Stage::GetCurrent().Add(second);
298 // Move the focus to the right
299 DALI_TEST_CHECK(manager.MoveFocus(Control::Right) == false);
301 // Because no layout control in the stage and no actor is focused, it should emit the PreFocusChange signal
302 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
303 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == Actor());
304 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
305 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::Right);
306 preFocusChangeCallback.Reset();
308 // Check that the focus is set on the first actor
309 DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
310 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
311 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
312 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == Actor());
313 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
314 focusChangedCallback.Reset();
316 // Move the focus towards right
317 DALI_TEST_CHECK(manager.MoveFocus(Control::Right) == false);
319 // Because no layout control in the stage and the first actor is focused, it should emit the PreFocusChange signal
320 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
321 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == first);
322 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
323 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::Right);
324 preFocusChangeCallback.Reset();
326 // Check that the focus is set on the second actor
327 DALI_TEST_CHECK(manager.SetCurrentFocusActor(second) == true);
328 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
329 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
330 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
331 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == second);
332 focusChangedCallback.Reset();
334 // Move the focus towards up
335 DALI_TEST_CHECK(manager.MoveFocus(Control::Up) == false);
337 // Because no layout control in the stage and no actor is focused, it should emit the PreFocusChange signal
338 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
339 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == second);
340 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
341 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::Up);
342 preFocusChangeCallback.Reset();
343 DALI_TEST_CHECK(!focusChangedCallback.mSignalVerified);
345 // Create a 2x2 table view and try to move focus inside it
346 TableView tableView = TableView::New( 2, 2 );
347 Stage::GetCurrent().Add(tableView);
349 // Create the third actor
350 Actor third = Actor::New();
351 third.SetKeyboardFocusable(true);
353 // Create the fourth actor
354 Actor fourth = Actor::New();
355 fourth.SetKeyboardFocusable(true);
357 // Add the four children to table view
358 tableView.AddChild(first, TableView::CellPosition(0, 0));
359 tableView.AddChild(second, TableView::CellPosition(0, 1));
360 tableView.AddChild(third, TableView::CellPosition(1, 0));
361 tableView.AddChild(fourth, TableView::CellPosition(1, 1));
363 // Set the focus to the first actor
364 DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
365 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
366 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
367 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == second);
368 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
369 focusChangedCallback.Reset();
371 // Move the focus towards right
372 DALI_TEST_CHECK(manager.MoveFocus(Control::Right) == true);
373 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
374 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
375 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
376 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == second);
377 focusChangedCallback.Reset();
379 // Move the focus towards down
380 DALI_TEST_CHECK(manager.MoveFocus(Control::Down) == true);
381 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == fourth);
382 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
383 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == second);
384 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == fourth);
385 focusChangedCallback.Reset();
387 // Move the focus towards left
388 DALI_TEST_CHECK(manager.MoveFocus(Control::Left) == true);
389 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == third);
390 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
391 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == fourth);
392 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == third);
393 focusChangedCallback.Reset();
395 // Move the focus towards up
396 DALI_TEST_CHECK(manager.MoveFocus(Control::Up) == true);
397 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
398 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
399 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == third);
400 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
401 focusChangedCallback.Reset();
403 // Move the focus towards left. The focus move will fail as no way to move it upwards
404 DALI_TEST_CHECK(manager.MoveFocus(Control::Left) == false);
405 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
406 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
407 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == first);
408 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
409 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::Left);
410 preFocusChangeCallback.Reset();
411 DALI_TEST_CHECK(!focusChangedCallback.mSignalVerified);
414 manager.SetFocusGroupLoop(true);
415 DALI_TEST_CHECK(manager.GetFocusGroupLoop() == true);
417 // Move the focus towards left again. The focus should move to the fourth actor.
418 DALI_TEST_CHECK(manager.MoveFocus(Control::Left) == true);
419 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == fourth);
420 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
421 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
422 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == fourth);
423 focusChangedCallback.Reset();
427 int UtcDaliKeyboardFocusManagerClearFocus(void)
429 ToolkitTestApplication application;
431 tet_infoline(" UtcDaliKeyboardFocusManagerClearFocus");
433 KeyboardFocusManager manager = KeyboardFocusManager::Get();
434 DALI_TEST_CHECK(manager);
436 // Create the first actor and add it to the stage
437 Actor first = Actor::New();
438 first.SetKeyboardFocusable(true);
439 Stage::GetCurrent().Add(first);
441 // Create the second actor and add it to the stage
442 Actor second = Actor::New();
443 second.SetKeyboardFocusable(true);
444 Stage::GetCurrent().Add(second);
446 // Check that the focus is set on the first actor
447 DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
448 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
450 // Check that the focus is set on the second actor
451 DALI_TEST_CHECK(manager.SetCurrentFocusActor(second) == true);
452 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
455 manager.ClearFocus();
457 // Check that no actor is being focused now.
458 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
462 int UtcDaliKeyboardFocusManagerSetAndGetFocusGroupLoop(void)
464 ToolkitTestApplication application;
466 tet_infoline(" UtcDaliKeyboardFocusManagerSetAndGetFocusGroupLoop");
468 KeyboardFocusManager manager = KeyboardFocusManager::Get();
469 DALI_TEST_CHECK(manager);
471 // Check that the focus movement is not looped within the same focus group by default
472 DALI_TEST_CHECK(manager.GetFocusGroupLoop() == false);
475 manager.SetFocusGroupLoop(true);
476 DALI_TEST_CHECK(manager.GetFocusGroupLoop() == true);
480 int UtcDaliKeyboardFocusManagerSetAsFocusGroup(void)
482 ToolkitTestApplication application;
484 tet_infoline(" UtcDaliKeyboardFocusManagerSetAsFocusGroup");
486 KeyboardFocusManager manager = KeyboardFocusManager::Get();
487 DALI_TEST_CHECK(manager);
489 // Create an actor and check that it is not a focus group by default
490 Actor actor = Actor::New();
491 DALI_TEST_CHECK(manager.IsFocusGroup(actor) == false);
493 // Set the actor as focus group
494 manager.SetAsFocusGroup(actor, true);
496 // flush the queue and render once
497 application.SendNotification();
498 application.Render();
500 DALI_TEST_CHECK(manager.IsFocusGroup(actor) == true);
502 // Set the actor not as focus group
503 manager.SetAsFocusGroup(actor, false);
505 // flush the queue and render once
506 application.SendNotification();
507 application.Render();
509 DALI_TEST_CHECK(manager.IsFocusGroup(actor) == false);
513 int UtcDaliKeyboardFocusManagerGetFocusGroup(void)
515 ToolkitTestApplication application;
517 tet_infoline(" UtcDaliKeyboardFocusManagerGetFocusGroup");
519 KeyboardFocusManager manager = KeyboardFocusManager::Get();
520 DALI_TEST_CHECK(manager);
522 // Create an actor with two child actors and add it to the stage
523 Actor parent = Actor::New();
524 Actor child = Actor::New();
526 Stage::GetCurrent().Add(parent);
528 // Create three actors and add them as the children of the first child actor
529 Actor grandChild = Actor::New();
530 child.Add(grandChild);
532 // Set the parent and the first child actor as focus groups
533 manager.SetAsFocusGroup(parent, true);
535 // flush the queue and render once
536 application.SendNotification();
537 application.Render();
539 DALI_TEST_CHECK(manager.IsFocusGroup(parent) == true);
541 // The current focus group should be the parent, As it is the immediate parent which is also a focus group.
542 DALI_TEST_CHECK(manager.GetFocusGroup(grandChild) == parent);
544 manager.SetAsFocusGroup(child, true);
546 // flush the queue and render once
547 application.SendNotification();
548 application.Render();
550 DALI_TEST_CHECK(manager.IsFocusGroup(child) == true);
552 // The focus group should be the child, As it is the immediate parent which is also a focus group.
553 DALI_TEST_CHECK(manager.GetFocusGroup(grandChild) == child);
555 manager.SetAsFocusGroup(grandChild, true);
557 // flush the queue and render once
558 application.SendNotification();
559 application.Render();
561 DALI_TEST_CHECK(manager.IsFocusGroup(grandChild) == true);
563 // The current focus group should be itself, As it is also a focus group.
564 DALI_TEST_CHECK(manager.GetFocusGroup(grandChild) == grandChild);
568 int UtcDaliKeyboardFocusManagerSetAndGetFocusIndicator(void)
570 ToolkitTestApplication application;
572 tet_infoline(" UtcDaliKeyboardFocusManagerSetAndGetFocusIndicator");
574 KeyboardFocusManager manager = KeyboardFocusManager::Get();
575 DALI_TEST_CHECK(manager);
577 Actor defaultFocusIndicatorActor = manager.GetFocusIndicatorActor();
578 DALI_TEST_CHECK(defaultFocusIndicatorActor);
580 Actor newFocusIndicatorActor = Actor::New();
581 manager.SetFocusIndicatorActor(newFocusIndicatorActor);
582 DALI_TEST_CHECK(manager.GetFocusIndicatorActor() == newFocusIndicatorActor);
587 int UtcDaliKeyboardFocusManagerSignalFocusedActorActivated(void)
589 ToolkitTestApplication application;
591 tet_infoline(" UtcDaliKeyboardFocusManagerSignalFocusedActorActivated");
593 KeyboardFocusManager manager = KeyboardFocusManager::Get();
594 DALI_TEST_CHECK(manager);
596 bool focusedActorActivatedSignalVerified = false;
597 FocusedActorActivatedCallback focusedActorActivatedCallback(focusedActorActivatedSignalVerified);
598 manager.FocusedActorActivatedSignal().Connect( &focusedActorActivatedCallback, &FocusedActorActivatedCallback::Callback );
600 Integration::KeyEvent returnEvent("Return", "", 0, 0, 0, Integration::KeyEvent::Up);
602 // Create the first button and add it to the stage
603 PushButton firstPushButton = PushButton::New();
604 firstPushButton.SetKeyboardFocusable(true);
605 Stage::GetCurrent().Add(firstPushButton);
607 // Create the second button and add it to the stage
608 PushButton secondPushButton = PushButton::New();
609 secondPushButton.SetKeyboardFocusable(true);
610 Stage::GetCurrent().Add(secondPushButton);
612 // Check that the focus is set on the first button
613 DALI_TEST_CHECK(manager.SetCurrentFocusActor(firstPushButton) == true);
614 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == firstPushButton);
616 // Send the return event to activate the first button
617 application.ProcessEvent(returnEvent);
618 DALI_TEST_CHECK(focusedActorActivatedCallback.mSignalVerified);
619 DALI_TEST_CHECK(focusedActorActivatedCallback.mActivatedActor == firstPushButton);
620 focusedActorActivatedCallback.Reset();
622 // Check that the focus is set on the second button
623 DALI_TEST_CHECK(manager.SetCurrentFocusActor(secondPushButton) == true);
624 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == secondPushButton);
626 // Send the return event again to activate the second button
627 application.ProcessEvent(returnEvent);
628 DALI_TEST_CHECK(focusedActorActivatedCallback.mSignalVerified);
629 DALI_TEST_CHECK(focusedActorActivatedCallback.mActivatedActor == secondPushButton);
630 focusedActorActivatedCallback.Reset();
634 int UtcDaliKeyboardFocusManagerSignalFocusGroupChanged(void)
636 ToolkitTestApplication application;
638 tet_infoline(" UtcDaliKeyboardFocusManagerSignalFocusGroupChanged");
642 type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
643 DALI_TEST_CHECK( type );
644 BaseHandle handle = type.CreateInstance();
645 DALI_TEST_CHECK( handle );
647 KeyboardFocusManager manager = KeyboardFocusManager::Get();
648 DALI_TEST_CHECK(manager);
650 bool focusGroupChangedSignalVerified = false;
651 FocusGroupChangedCallback focusGroupChangedCallback(focusGroupChangedSignalVerified);
652 manager.FocusGroupChangedSignal().Connect( &focusGroupChangedCallback, &FocusGroupChangedCallback::Callback );
654 Integration::KeyEvent tabEvent("Tab", "", 0, 0, 0, Integration::KeyEvent::Down);
655 Integration::KeyEvent shiftTabEvent("Tab", "", 0, 1, 0, Integration::KeyEvent::Down);
657 // Send the tab event to change focus group in the forward direction
658 application.ProcessEvent(tabEvent);
659 DALI_TEST_CHECK(focusGroupChangedCallback.mSignalVerified);
660 DALI_TEST_CHECK(focusGroupChangedCallback.mCurrentFocusedActor == Actor());
661 DALI_TEST_CHECK(focusGroupChangedCallback.mForward == true);
662 focusGroupChangedCallback.Reset();
664 // Send the shift tab event to change focus group in the backward direction
665 application.ProcessEvent(shiftTabEvent);
666 DALI_TEST_CHECK(focusGroupChangedCallback.mSignalVerified);
667 DALI_TEST_CHECK(focusGroupChangedCallback.mCurrentFocusedActor == Actor());
668 DALI_TEST_CHECK(focusGroupChangedCallback.mForward == false);
669 focusGroupChangedCallback.Reset();