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>
29 using namespace Dali::Toolkit;
31 void utc_dali_toolkit_keyboard_focus_manager_startup(void)
33 test_return_value = TET_UNDEF;
36 void utc_dali_toolkit_keyboard_focus_manager_cleanup(void)
38 test_return_value = TET_PASS;
45 // Functors to test whether PreFocusChange signal is emitted when the keyboard focus is about to change
46 class PreFocusChangeCallback : public Dali::ConnectionTracker
49 PreFocusChangeCallback(bool& signalReceived)
50 : mSignalVerified(signalReceived),
51 mCurrentFocusedActor(),
52 mProposedActorToFocus(),
53 mDirection(Control::Left)
57 Actor Callback(Actor currentFocusedActor, Actor proposedActorToFocus, Control::KeyboardFocusNavigationDirection direction)
59 tet_infoline("Verifying PreFocusChangeCallback()");
61 mSignalVerified = true;
63 mCurrentFocusedActor = currentFocusedActor;
64 mProposedActorToFocus = proposedActorToFocus;
65 mDirection = direction;
67 return mProposedActorToFocus;
72 mSignalVerified = false;
73 mCurrentFocusedActor = Actor();
74 mProposedActorToFocus = Actor();
75 mDirection = Control::Left;
78 bool& mSignalVerified;
79 Actor mCurrentFocusedActor;
80 Actor mProposedActorToFocus;
81 Control::KeyboardFocusNavigationDirection mDirection;
84 // Functors to test whether focus changed signal is emitted when the keyboard focus is changed
85 class FocusChangedCallback : public Dali::ConnectionTracker
88 FocusChangedCallback(bool& signalReceived)
89 : mSignalVerified(signalReceived),
90 mOriginalFocusedActor(),
91 mCurrentFocusedActor()
95 void Callback(Actor originalFocusedActor, Actor currentFocusedActor)
97 tet_infoline("Verifying FocusChangedCallback()");
99 if(originalFocusedActor == mCurrentFocusedActor)
101 mSignalVerified = true;
104 mOriginalFocusedActor = originalFocusedActor;
105 mCurrentFocusedActor = currentFocusedActor;
110 mSignalVerified = false;
113 bool& mSignalVerified;
114 Actor mOriginalFocusedActor;
115 Actor mCurrentFocusedActor;
118 // Functors to test whether focus group changed signal is emitted when the keyboard focus group is changed
119 class FocusGroupChangedCallback : public Dali::ConnectionTracker
122 FocusGroupChangedCallback(bool& signalReceived)
123 : mSignalVerified(signalReceived),
124 mCurrentFocusedActor(),
129 void Callback(Actor currentFocusedActor, bool forward)
131 tet_infoline("Verifying FocusGroupChangedCallback()");
133 mSignalVerified = true;
135 mCurrentFocusedActor = currentFocusedActor;
141 mSignalVerified = false;
144 bool& mSignalVerified;
145 Actor mCurrentFocusedActor;
149 // Functors to test whether focused actor activated signal is emitted when the focused actor is activated
150 class FocusedActorActivatedCallback : public Dali::ConnectionTracker
153 FocusedActorActivatedCallback(bool& signalReceived)
154 : mSignalVerified(signalReceived),
159 void Callback(Actor activatedActor)
161 tet_infoline("Verifying FocusedActorActivatedCallback()");
163 mSignalVerified = true;
165 mActivatedActor = activatedActor;
170 mSignalVerified = false;
173 bool& mSignalVerified;
174 Actor mActivatedActor;
180 int UtcDaliKeyboardFocusManagerGet(void)
182 ToolkitTestApplication application;
184 tet_infoline(" UtcDaliKeyboardKeyboardFocusManagerGet");
188 type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
189 DALI_TEST_CHECK( type );
190 BaseHandle handle = type.CreateInstance();
191 DALI_TEST_CHECK( handle );
193 KeyboardFocusManager manager;
195 manager = KeyboardFocusManager::Get();
196 DALI_TEST_CHECK(manager);
198 KeyboardFocusManager newManager = KeyboardFocusManager::Get();
199 DALI_TEST_CHECK(newManager);
201 // Check that focus manager is a singleton
202 DALI_TEST_CHECK(manager == newManager);
206 int UtcDaliKeyboardFocusManagerSetAndGetCurrentFocusActor(void)
208 ToolkitTestApplication application;
210 tet_infoline(" UtcDaliKeyboardFocusManagerSetAndGetCurrentFocusActor");
212 KeyboardFocusManager manager = KeyboardFocusManager::Get();
213 DALI_TEST_CHECK(manager);
215 // Create the first actor and add it to the stage
216 Actor first = Actor::New();
217 first.SetKeyboardFocusable(true);
218 Stage::GetCurrent().Add(first);
220 // Create the second actor and add it to the stage
221 Actor second = Actor::New();
222 second.SetKeyboardFocusable(true);
223 Stage::GetCurrent().Add(second);
225 // Create the third actor but don't add it to the stage
226 Actor third = Actor::New();
228 // Check that no actor is being focused yet.
229 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
231 // Check that it will fail to set focus on an invalid actor
232 DALI_TEST_CHECK(manager.SetCurrentFocusActor(Actor()) == false);
234 // Check that the focus is set on the first actor
235 DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
236 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
238 // Check that the focus is set on the second actor
239 DALI_TEST_CHECK(manager.SetCurrentFocusActor(second) == true);
240 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
242 // Check that it will fail to set focus on the third actor as it's not in the stage
243 DALI_TEST_CHECK(manager.SetCurrentFocusActor(third) == false);
244 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
246 // Add the third actor to the stage
247 Stage::GetCurrent().Add(third);
249 // Check that it will fail to set focus on the third actor as it's not focusable
250 DALI_TEST_CHECK(manager.SetCurrentFocusActor(third) == false);
251 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
253 // Make the third actor focusable
254 third.SetKeyboardFocusable(true);
256 // Check that the focus is successfully moved to the third actor
257 DALI_TEST_CHECK(manager.SetCurrentFocusActor(third) == true);
258 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == third);
262 int UtcDaliKeyboardFocusManagerMoveFocus(void)
264 ToolkitTestApplication application;
266 tet_infoline(" UtcDaliKeyboardFocusManagerMoveFocus");
270 type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
271 DALI_TEST_CHECK( type );
272 BaseHandle handle = type.CreateInstance();
273 DALI_TEST_CHECK( handle );
275 KeyboardFocusManager manager = KeyboardFocusManager::Get();
276 DALI_TEST_CHECK(manager);
278 bool preFocusChangeSignalVerified = false;
279 PreFocusChangeCallback preFocusChangeCallback(preFocusChangeSignalVerified);
280 manager.PreFocusChangeSignal().Connect( &preFocusChangeCallback, &PreFocusChangeCallback::Callback );
282 bool focusChangedSignalVerified = false;
283 FocusChangedCallback focusChangedCallback(focusChangedSignalVerified);
284 manager.FocusChangedSignal().Connect( &focusChangedCallback, &FocusChangedCallback::Callback );
286 // Create the first actor and add it to the stage
287 Actor first = Actor::New();
288 first.SetKeyboardFocusable(true);
289 Stage::GetCurrent().Add(first);
291 // Create the second actor and add it to the stage
292 Actor second = Actor::New();
293 second.SetKeyboardFocusable(true);
294 Stage::GetCurrent().Add(second);
296 // Move the focus to the right
297 DALI_TEST_CHECK(manager.MoveFocus(Control::Right) == false);
299 // Because no layout control in the stage and no actor is focused, it should emit the PreFocusChange signal
300 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
301 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == Actor());
302 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
303 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::Right);
304 preFocusChangeCallback.Reset();
306 // Check that the focus is set on the first actor
307 DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
308 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
309 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
310 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == Actor());
311 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
312 focusChangedCallback.Reset();
314 // Move the focus towards right
315 DALI_TEST_CHECK(manager.MoveFocus(Control::Right) == false);
317 // Because no layout control in the stage and the first actor is focused, it should emit the PreFocusChange signal
318 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
319 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == first);
320 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
321 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::Right);
322 preFocusChangeCallback.Reset();
324 // Check that the focus is set on the second actor
325 DALI_TEST_CHECK(manager.SetCurrentFocusActor(second) == true);
326 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
327 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
328 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
329 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == second);
330 focusChangedCallback.Reset();
332 // Move the focus towards up
333 DALI_TEST_CHECK(manager.MoveFocus(Control::Up) == false);
335 // Because no layout control in the stage and no actor is focused, it should emit the PreFocusChange signal
336 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
337 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == second);
338 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
339 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::Up);
340 preFocusChangeCallback.Reset();
341 DALI_TEST_CHECK(!focusChangedCallback.mSignalVerified);
343 // Create a 2x2 table view and try to move focus inside it
344 TableView tableView = TableView::New( 2, 2 );
345 Stage::GetCurrent().Add(tableView);
347 // Create the third actor
348 Actor third = Actor::New();
349 third.SetKeyboardFocusable(true);
351 // Create the fourth actor
352 Actor fourth = Actor::New();
353 fourth.SetKeyboardFocusable(true);
355 // Add the four children to table view
356 tableView.AddChild(first, TableView::CellPosition(0, 0));
357 tableView.AddChild(second, TableView::CellPosition(0, 1));
358 tableView.AddChild(third, TableView::CellPosition(1, 0));
359 tableView.AddChild(fourth, TableView::CellPosition(1, 1));
361 // Set the focus to the first actor
362 DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
363 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
364 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
365 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == second);
366 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
367 focusChangedCallback.Reset();
369 // Move the focus towards right
370 DALI_TEST_CHECK(manager.MoveFocus(Control::Right) == true);
371 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
372 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
373 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
374 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == second);
375 focusChangedCallback.Reset();
377 // Move the focus towards down
378 DALI_TEST_CHECK(manager.MoveFocus(Control::Down) == true);
379 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == fourth);
380 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
381 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == second);
382 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == fourth);
383 focusChangedCallback.Reset();
385 // Move the focus towards left
386 DALI_TEST_CHECK(manager.MoveFocus(Control::Left) == true);
387 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == third);
388 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
389 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == fourth);
390 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == third);
391 focusChangedCallback.Reset();
393 // Move the focus towards up
394 DALI_TEST_CHECK(manager.MoveFocus(Control::Up) == true);
395 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
396 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
397 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == third);
398 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
399 focusChangedCallback.Reset();
401 // Move the focus towards left. The focus move will fail as no way to move it upwards
402 DALI_TEST_CHECK(manager.MoveFocus(Control::Left) == false);
403 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
404 DALI_TEST_CHECK(preFocusChangeCallback.mSignalVerified);
405 DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == first);
406 DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
407 DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::Left);
408 preFocusChangeCallback.Reset();
409 DALI_TEST_CHECK(!focusChangedCallback.mSignalVerified);
412 manager.SetFocusGroupLoop(true);
413 DALI_TEST_CHECK(manager.GetFocusGroupLoop() == true);
415 // Move the focus towards left again. The focus should move to the fourth actor.
416 DALI_TEST_CHECK(manager.MoveFocus(Control::Left) == true);
417 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == fourth);
418 DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
419 DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
420 DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == fourth);
421 focusChangedCallback.Reset();
425 int UtcDaliKeyboardFocusManagerClearFocus(void)
427 ToolkitTestApplication application;
429 tet_infoline(" UtcDaliKeyboardFocusManagerClearFocus");
431 KeyboardFocusManager manager = KeyboardFocusManager::Get();
432 DALI_TEST_CHECK(manager);
434 // Create the first actor and add it to the stage
435 Actor first = Actor::New();
436 first.SetKeyboardFocusable(true);
437 Stage::GetCurrent().Add(first);
439 // Create the second actor and add it to the stage
440 Actor second = Actor::New();
441 second.SetKeyboardFocusable(true);
442 Stage::GetCurrent().Add(second);
444 // Check that the focus is set on the first actor
445 DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
446 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
448 // Check that the focus is set on the second actor
449 DALI_TEST_CHECK(manager.SetCurrentFocusActor(second) == true);
450 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
453 manager.ClearFocus();
455 // Check that no actor is being focused now.
456 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
460 int UtcDaliKeyboardFocusManagerSetAndGetFocusGroupLoop(void)
462 ToolkitTestApplication application;
464 tet_infoline(" UtcDaliKeyboardFocusManagerSetAndGetFocusGroupLoop");
466 KeyboardFocusManager manager = KeyboardFocusManager::Get();
467 DALI_TEST_CHECK(manager);
469 // Check that the focus movement is not looped within the same focus group by default
470 DALI_TEST_CHECK(manager.GetFocusGroupLoop() == false);
473 manager.SetFocusGroupLoop(true);
474 DALI_TEST_CHECK(manager.GetFocusGroupLoop() == true);
478 int UtcDaliKeyboardFocusManagerSetAsFocusGroup(void)
480 ToolkitTestApplication application;
482 tet_infoline(" UtcDaliKeyboardFocusManagerSetAsFocusGroup");
484 KeyboardFocusManager manager = KeyboardFocusManager::Get();
485 DALI_TEST_CHECK(manager);
487 // Create an actor and check that it is not a focus group by default
488 Actor actor = Actor::New();
489 DALI_TEST_CHECK(manager.IsFocusGroup(actor) == false);
491 // Set the actor as focus group
492 manager.SetAsFocusGroup(actor, true);
494 // flush the queue and render once
495 application.SendNotification();
496 application.Render();
498 DALI_TEST_CHECK(manager.IsFocusGroup(actor) == true);
500 // Set the actor not as focus group
501 manager.SetAsFocusGroup(actor, false);
503 // flush the queue and render once
504 application.SendNotification();
505 application.Render();
507 DALI_TEST_CHECK(manager.IsFocusGroup(actor) == false);
511 int UtcDaliKeyboardFocusManagerGetFocusGroup(void)
513 ToolkitTestApplication application;
515 tet_infoline(" UtcDaliKeyboardFocusManagerGetFocusGroup");
517 KeyboardFocusManager manager = KeyboardFocusManager::Get();
518 DALI_TEST_CHECK(manager);
520 // Create an actor with two child actors and add it to the stage
521 Actor parent = Actor::New();
522 Actor child = Actor::New();
524 Stage::GetCurrent().Add(parent);
526 // Create three actors and add them as the children of the first child actor
527 Actor grandChild = Actor::New();
528 child.Add(grandChild);
530 // Set the parent and the first child actor as focus groups
531 manager.SetAsFocusGroup(parent, true);
533 // flush the queue and render once
534 application.SendNotification();
535 application.Render();
537 DALI_TEST_CHECK(manager.IsFocusGroup(parent) == true);
539 // The current focus group should be the parent, As it is the immediate parent which is also a focus group.
540 DALI_TEST_CHECK(manager.GetFocusGroup(grandChild) == parent);
542 manager.SetAsFocusGroup(child, true);
544 // flush the queue and render once
545 application.SendNotification();
546 application.Render();
548 DALI_TEST_CHECK(manager.IsFocusGroup(child) == true);
550 // The focus group should be the child, As it is the immediate parent which is also a focus group.
551 DALI_TEST_CHECK(manager.GetFocusGroup(grandChild) == child);
553 manager.SetAsFocusGroup(grandChild, true);
555 // flush the queue and render once
556 application.SendNotification();
557 application.Render();
559 DALI_TEST_CHECK(manager.IsFocusGroup(grandChild) == true);
561 // The current focus group should be itself, As it is also a focus group.
562 DALI_TEST_CHECK(manager.GetFocusGroup(grandChild) == grandChild);
566 int UtcDaliKeyboardFocusManagerSetAndGetFocusIndicator(void)
568 ToolkitTestApplication application;
570 tet_infoline(" UtcDaliKeyboardFocusManagerSetAndGetFocusIndicator");
572 KeyboardFocusManager manager = KeyboardFocusManager::Get();
573 DALI_TEST_CHECK(manager);
575 Actor defaultFocusIndicatorActor = manager.GetFocusIndicatorActor();
576 DALI_TEST_CHECK(defaultFocusIndicatorActor);
578 Actor newFocusIndicatorActor = Actor::New();
579 manager.SetFocusIndicatorActor(newFocusIndicatorActor);
580 DALI_TEST_CHECK(manager.GetFocusIndicatorActor() == newFocusIndicatorActor);
585 int UtcDaliKeyboardFocusManagerSignalFocusedActorActivated(void)
587 ToolkitTestApplication application;
589 tet_infoline(" UtcDaliKeyboardFocusManagerSignalFocusedActorActivated");
591 KeyboardFocusManager manager = KeyboardFocusManager::Get();
592 DALI_TEST_CHECK(manager);
594 bool focusedActorActivatedSignalVerified = false;
595 FocusedActorActivatedCallback focusedActorActivatedCallback(focusedActorActivatedSignalVerified);
596 manager.FocusedActorActivatedSignal().Connect( &focusedActorActivatedCallback, &FocusedActorActivatedCallback::Callback );
598 Integration::KeyEvent returnEvent("Return", "", 0, 0, 0, Integration::KeyEvent::Up);
600 // Create the first button and add it to the stage
601 PushButton firstPushButton = PushButton::New();
602 firstPushButton.SetKeyboardFocusable(true);
603 Stage::GetCurrent().Add(firstPushButton);
605 // Create the second button and add it to the stage
606 PushButton secondPushButton = PushButton::New();
607 secondPushButton.SetKeyboardFocusable(true);
608 Stage::GetCurrent().Add(secondPushButton);
610 // Check that the focus is set on the first button
611 DALI_TEST_CHECK(manager.SetCurrentFocusActor(firstPushButton) == true);
612 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == firstPushButton);
614 // Send the return event to activate the first button
615 application.ProcessEvent(returnEvent);
616 DALI_TEST_CHECK(focusedActorActivatedCallback.mSignalVerified);
617 DALI_TEST_CHECK(focusedActorActivatedCallback.mActivatedActor == firstPushButton);
618 focusedActorActivatedCallback.Reset();
620 // Check that the focus is set on the second button
621 DALI_TEST_CHECK(manager.SetCurrentFocusActor(secondPushButton) == true);
622 DALI_TEST_CHECK(manager.GetCurrentFocusActor() == secondPushButton);
624 // Send the return event again to activate the second button
625 application.ProcessEvent(returnEvent);
626 DALI_TEST_CHECK(focusedActorActivatedCallback.mSignalVerified);
627 DALI_TEST_CHECK(focusedActorActivatedCallback.mActivatedActor == secondPushButton);
628 focusedActorActivatedCallback.Reset();
632 int UtcDaliKeyboardFocusManagerSignalFocusGroupChanged(void)
634 ToolkitTestApplication application;
636 tet_infoline(" UtcDaliKeyboardFocusManagerSignalFocusGroupChanged");
640 type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
641 DALI_TEST_CHECK( type );
642 BaseHandle handle = type.CreateInstance();
643 DALI_TEST_CHECK( handle );
645 KeyboardFocusManager manager = KeyboardFocusManager::Get();
646 DALI_TEST_CHECK(manager);
648 bool focusGroupChangedSignalVerified = false;
649 FocusGroupChangedCallback focusGroupChangedCallback(focusGroupChangedSignalVerified);
650 manager.FocusGroupChangedSignal().Connect( &focusGroupChangedCallback, &FocusGroupChangedCallback::Callback );
652 Integration::KeyEvent tabEvent("Tab", "", 0, 0, 0, Integration::KeyEvent::Down);
653 Integration::KeyEvent shiftTabEvent("Tab", "", 0, 1, 0, Integration::KeyEvent::Down);
655 // Send the tab event to change focus group in the forward direction
656 application.ProcessEvent(tabEvent);
657 DALI_TEST_CHECK(focusGroupChangedCallback.mSignalVerified);
658 DALI_TEST_CHECK(focusGroupChangedCallback.mCurrentFocusedActor == Actor());
659 DALI_TEST_CHECK(focusGroupChangedCallback.mForward == true);
660 focusGroupChangedCallback.Reset();
662 // Send the shift tab event to change focus group in the backward direction
663 application.ProcessEvent(shiftTabEvent);
664 DALI_TEST_CHECK(focusGroupChangedCallback.mSignalVerified);
665 DALI_TEST_CHECK(focusGroupChangedCallback.mCurrentFocusedActor == Actor());
666 DALI_TEST_CHECK(focusGroupChangedCallback.mForward == false);
667 focusGroupChangedCallback.Reset();