Dali 3D User Interface Engine
utc-Dali-ControlImpl.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17 
18 #include <iostream>
19 #include <stdlib.h>
20 
21 // Need to override adaptor classes for toolkit test harness, so include
22 // test harness headers before dali headers.
24 #include "toolkit-style-monitor.h"
25 
26 #include <dali.h>
36 
38 
39 #include "dummy-control.h"
40 
41 using namespace Dali;
42 using namespace Dali::Toolkit;
43 
45 {
47 }
48 
50 {
52 }
53 
55 {
56  ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
57 
58  Control control;
59 
61 
63 
65  END_TEST;
66 }
67 
68 
70 {
71  ToolkitTestApplication application;
72 
73  // Enable individually
74  {
76  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
77 
81 
82  DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
85 
86  DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
89 
93  }
94 
95  // Enable All
96  {
98  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
99 
101  DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
102  DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
104 
106 
108  DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
109  DALI_TEST_CHECK( dummyImpl.GetTapGestureDetector() );
111 
112  // Enable when already enabled
113 
115 
117  DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
118  DALI_TEST_CHECK( dummyImpl.GetTapGestureDetector() );
120  }
121  END_TEST;
122 }
123 
125 {
126  ToolkitTestApplication application;
127 
128  // Disable individually
129  {
131  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
132 
134 
138 
139  DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
141  DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
142 
143  DALI_TEST_CHECK( dummyImpl.GetTapGestureDetector() );
145  DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
146 
150  }
151 
152  // Disable All
153  {
155  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
156 
158 
160  DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
161  DALI_TEST_CHECK( dummyImpl.GetTapGestureDetector() );
163 
165 
167  DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
168  DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
170  }
171 
172  // Disable When not enabled
173  {
175  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
176 
178  DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
179  DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
181 
183 
185  DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
186  DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
188  }
189 
190  // Ensure control is detached if gesture detector is not deleted
191  {
193  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
194 
196 
197  PinchGestureDetector pinch = dummyImpl.GetPinchGestureDetector();
198  PanGestureDetector pan = dummyImpl.GetPanGestureDetector();
199  TapGestureDetector tap = dummyImpl.GetTapGestureDetector();
201 
202  DALI_TEST_EQUALS( 0 == pinch.GetAttachedActorCount(), false, TEST_LOCATION );
205  DALI_TEST_EQUALS( 0 == longPress.GetAttachedActorCount(), false, TEST_LOCATION );
206 
208 
212  DALI_TEST_EQUALS( 0 == longPress.GetAttachedActorCount(), true, TEST_LOCATION );
213  }
214  END_TEST;
215 }
216 
218 {
219  ToolkitTestApplication application;
220 
221  // Check gesture actually happens
222  {
223  DummyControl dummy = DummyControl::New(true);
224  dummy.SetSize( Vector2(100.0f, 100.0f ) );
225 
227  Stage::GetCurrent().Add(dummy);
228 
229  // Render and notify a couple of times
230  application.SendNotification();
231  application.Render();
232  application.SendNotification();
233  application.Render();
234 
235  DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
237 
238  DALI_TEST_CHECK( dummyImpl.pinchCalled == false );
239  Integration::PinchGestureEvent pinch(Gesture::Started);
240  pinch.scale = 10.0f;
241  pinch.speed = 50.0f;
242  pinch.centerPoint = Vector2(20.0f, 20.0f);
243  application.ProcessEvent(pinch);
244  DALI_TEST_CHECK( dummyImpl.pinchCalled == true );
245 
246  DALI_TEST_CHECK( dummyImpl.panCalled == false );
247  Integration::PanGestureEvent pan(Gesture::Possible);
248  pan.previousPosition = Vector2(10.0f, 20.0f);
249  pan.currentPosition = Vector2(20.0f, 20.0f);
250  pan.timeDelta = 10;
251  pan.numberOfTouches = 1u;
252  application.ProcessEvent(pan);
253  pan.state = Gesture::Started;
254  application.ProcessEvent(pan);
255  DALI_TEST_CHECK( dummyImpl.panCalled == true );
256 
257  DALI_TEST_CHECK( dummyImpl.tapCalled == false );
258  Integration::TapGestureEvent tap(Gesture::Possible);
259  tap.numberOfTaps = 1u;
260  tap.numberOfTouches = 1u;
261  tap.point = Vector2(50.0f, 50.0f);
262  application.ProcessEvent(tap);
263  tap.state = Gesture::Started;
264  application.ProcessEvent(tap);
265  DALI_TEST_CHECK( dummyImpl.tapCalled == true );
266 
267  DALI_TEST_CHECK( dummyImpl.longPressCalled == false );
268  Integration::LongPressGestureEvent longPress(Gesture::Possible);
269  longPress.numberOfTouches = 1u;
270  longPress.point = Vector2(50.0f, 50.0f);
271  application.ProcessEvent(longPress);
272  longPress.state = Gesture::Started;
273  application.ProcessEvent(longPress);
274  DALI_TEST_CHECK( dummyImpl.longPressCalled == true );
275  longPress.state = Gesture::Finished;
276  application.ProcessEvent(longPress);
277 
278  Stage::GetCurrent().Remove(dummy);
279  }
280 
281  // Ensure full code coverage
282  {
284  dummy.SetSize( Vector2( 100.0f, 100.0f ) );
285 
287  Stage::GetCurrent().Add(dummy);
288 
289  // Render and notify a couple of times
290  application.SendNotification();
291  application.Render();
292  application.SendNotification();
293  application.Render();
294 
295  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
297 
298  DALI_TEST_CHECK( dummy.GetCurrentScale().x != 10.0f );
299  Integration::PinchGestureEvent pinch(Gesture::Started);
300  pinch.scale = 10.0f;
301  pinch.speed = 50.0f;
302  pinch.centerPoint = Vector2(20.0f, 20.0f);
303  application.ProcessEvent(pinch);
304 
305  // Render and notify a couple of times
306  application.SendNotification();
307  application.Render();
308  application.SendNotification();
309  application.Render();
310  DALI_TEST_CHECK( dummy.GetCurrentScale().x == 10.0f );
311 
312  Integration::PanGestureEvent pan(Gesture::Possible);
313  pan.previousPosition = Vector2(10.0f, 20.0f);
314  pan.currentPosition = Vector2(20.0f, 20.0f);
315  pan.timeDelta = 10;
316  pan.numberOfTouches = 1u;
317  application.ProcessEvent(pan);
318  pan.state = Gesture::Started;
319  application.ProcessEvent(pan);
320 
321  Integration::TapGestureEvent tap(Gesture::Possible);
322  tap.numberOfTaps = 1u;
323  tap.numberOfTouches = 1u;
324  tap.point = Vector2(50.0f, 50.0f);
325  application.ProcessEvent(tap);
326  tap.state = Gesture::Started;
327  application.ProcessEvent(tap);
328 
329  Integration::LongPressGestureEvent longPress(Gesture::Possible);
330  longPress.numberOfTouches = 1u;
331  longPress.point = Vector2(50.0f, 50.0f);
332  application.ProcessEvent(longPress);
333  longPress.state = Gesture::Started;
334  application.ProcessEvent(longPress);
335  longPress.state = Gesture::Finished;
336  application.ProcessEvent(longPress);
337 
338  Stage::GetCurrent().Remove(dummy);
339  }
340  END_TEST;
341 }
342 
344 {
345  ToolkitTestApplication application;
346 
347  {
348  DummyControl dummy = DummyControl::New( true );
349  Stage::GetCurrent().Add(dummy);
350  DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
351 
352  application.Render();
353  application.SendNotification();
354 
355  DALI_TEST_EQUALS( dummyImpl.childAddCalled, false, TEST_LOCATION );
357  Actor actor = Actor::New();
358  dummy.Add(actor);
359  DALI_TEST_EQUALS( dummyImpl.childAddCalled, true, TEST_LOCATION );
361 
362  application.Render();
363  application.SendNotification();
364 
365  DALI_TEST_EQUALS( dummyImpl.childRemoveCalled, false, TEST_LOCATION );
366  dummy.Remove( actor );
369 
370  application.Render();
371  application.SendNotification();
372 
373  Stage::GetCurrent().Remove(dummy);
374  }
375 
376  // Ensure full code coverage
377  {
379  Stage::GetCurrent().Add(dummy);
380 
381  application.Render();
382  application.SendNotification();
383 
385  Actor actor = Actor::New();
386  dummy.Add(actor);
388 
389  application.Render();
390  application.SendNotification();
391 
392  dummy.Remove( actor );
394 
395  application.Render();
396  application.SendNotification();
397 
398  Stage::GetCurrent().Remove(dummy);
399  }
400  END_TEST;
401 }
402 
404 {
405  ToolkitTestApplication application;
406 
407  {
408  DummyControl dummy = DummyControl::New( true );
409  DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
410 
412  Stage::GetCurrent().Add(dummy);
413  application.Render();
414  application.SendNotification();
416 
418  Stage::GetCurrent().Remove(dummy);
419  application.Render();
420  application.SendNotification();
422  }
423 
424  // Ensure full code coverage
425  {
426  unsigned int stageChildren = Stage::GetCurrent().GetLayer(0).GetChildCount();
428 
429  DALI_TEST_EQUALS( Stage::GetCurrent().GetLayer(0).GetChildCount(), stageChildren, TEST_LOCATION );
430  Stage::GetCurrent().Add(dummy);
431  application.Render();
432  application.SendNotification();
433  DALI_TEST_EQUALS( Stage::GetCurrent().GetLayer(0).GetChildCount(), stageChildren + 1, TEST_LOCATION );
434 
435  Stage::GetCurrent().Remove(dummy);
436  application.Render();
437  application.SendNotification();
438  DALI_TEST_EQUALS( Stage::GetCurrent().GetLayer(0).GetChildCount(), stageChildren, TEST_LOCATION );
439  }
440  END_TEST;
441 }
442 
444 {
445  ToolkitTestApplication application;
446 
447  {
448  DummyControl dummy = DummyControl::New( true );
449  DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
450 
451  Stage::GetCurrent().Add(dummy);
452  application.Render();
453  application.SendNotification();
454 
455  DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, false, TEST_LOCATION ); // Size not set, no onSizeSet called
456  Vector2 size(100.0f, 200.0f);
457  dummy.SetSize( size );
458 
459  DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, false, TEST_LOCATION ); // Size is going to get negotiated, no onSizeSet called
460 
461  application.SendNotification();
462  application.Render();
463 
465  DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, true, TEST_LOCATION );
466 
467  Stage::GetCurrent().Remove(dummy);
468  }
469 
470  END_TEST;
471 }
472 
474 {
475  ToolkitTestApplication application;
476 
477  {
479  Stage::GetCurrent().Add(dummy);
480 
481  Vector2 size(100.0f, 200.0f);
482  DALI_TEST_CHECK( size != dummy.GetCurrentSize().GetVectorXY() );
483 
484  application.SendNotification();
485  application.Render();
486 
487  dummy.SetSize(size);
488 
489  application.SendNotification();
490  application.Render();
491 
493 
494  Stage::GetCurrent().Remove(dummy);
495  }
496  END_TEST;
497 }
498 
499 
501 {
502  ToolkitTestApplication application;
503 
504  {
505  DummyControl dummy = DummyControl::New( true );
506  DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
507 
508  Stage::GetCurrent().Add(dummy);
509 
511  Animation animation = Animation::New(1.0f);
512  animation.AnimateTo( Property( dummy, Actor::Property::SIZE ), Vector3( 100.0f, 150.0f, 200.0f ) );
513  animation.Play();
514 
515  application.Render();
516  application.SendNotification();
517  application.Render();
518  application.SendNotification();
519 
521 
522  Stage::GetCurrent().Remove(dummy);
523  }
524 
525  // Ensure full code coverage
526  {
528 
529  Stage::GetCurrent().Add(dummy);
530 
531  Animation animation = Animation::New(1.0f);
532  animation.AnimateTo( Property( dummy, Actor::Property::SIZE ), Vector3( 100.0f, 150.0f, 200.0f ) );
533  animation.Play();
534 
535  application.Render();
536  application.SendNotification();
537  application.Render();
538  application.SendNotification();
539 
540  Stage::GetCurrent().Remove(dummy);
541  }
542  END_TEST;
543 }
544 
546 
548 {
549  ToolkitTestApplication application;
550 
551  {
552  DummyControl dummy = DummyControl::New( true );
553  DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
554 
555  dummy.SetSize( Vector2( 100.0f, 100.0f ) );
557  Stage::GetCurrent().Add(dummy);
558 
559  application.Render();
560  application.SendNotification();
561  application.Render();
562  application.SendNotification();
563 
564  DALI_TEST_EQUALS( dummyImpl.touchEventCalled, false, TEST_LOCATION );
565  Integration::TouchEvent touchEvent(1);
566  TouchPoint point(1, TouchPoint::Down, 20.0f, 20.0f);
567  touchEvent.AddPoint(point);
568  application.ProcessEvent(touchEvent);
569  DALI_TEST_EQUALS( dummyImpl.touchEventCalled, true, TEST_LOCATION );
570 
571  Stage::GetCurrent().Remove(dummy);
572  }
573 
574  // Ensure full code coverage
575  {
577 
578  dummy.SetSize( Vector2( 100.0f, 100.0f ) );
580  Stage::GetCurrent().Add(dummy);
581 
582  application.Render();
583  application.SendNotification();
584  application.Render();
585  application.SendNotification();
586 
587  Integration::TouchEvent touchEvent(1);
588  TouchPoint point(1, TouchPoint::Down, 20.0f, 20.0f);
589  touchEvent.AddPoint(point);
590  application.ProcessEvent(touchEvent);
591 
592  Stage::GetCurrent().Remove(dummy);
593  }
594  END_TEST;
595 }
596 
598 {
599  ToolkitTestApplication application;
600 
601  {
602  DummyControl dummy = DummyControl::New( true );
603  DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
604 
605  dummy.SetSize( Vector2( 100.0f, 100.0f ) );
607  Stage::GetCurrent().Add(dummy);
608 
609  application.Render();
610  application.SendNotification();
611  application.Render();
612  application.SendNotification();
613 
614  DALI_TEST_EQUALS( dummyImpl.hoverEventCalled, false, TEST_LOCATION );
615  Integration::HoverEvent event(1);
616  TouchPoint point( 1, TouchPoint::Motion, 20.0f, 20.0f );
617  event.AddPoint( point );
618  application.ProcessEvent( event );
619  DALI_TEST_EQUALS( dummyImpl.hoverEventCalled, true, TEST_LOCATION );
620 
621  Stage::GetCurrent().Remove(dummy);
622  }
623 
624  // Ensure full code coverage
625  {
627 
628  dummy.SetSize( Vector2( 100.0f, 100.0f ) );
630  Stage::GetCurrent().Add(dummy);
631 
632  application.Render();
633  application.SendNotification();
634  application.Render();
635  application.SendNotification();
636 
637  Integration::HoverEvent event(1);
638  TouchPoint point( 1, TouchPoint::Motion, 20.0f, 20.0f );
639  event.AddPoint( point );
640  application.ProcessEvent( event );
641 
642  Stage::GetCurrent().Remove(dummy);
643  }
644  END_TEST;
645 }
646 
648 
649 
651 {
652  ToolkitTestApplication application;
653 
654  {
655  DummyControl dummy = DummyControl::New( true );
656  DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
657 
658  Stage::GetCurrent().Add(dummy);
659  dummy.SetKeyInputFocus();
660 
661  application.Render();
662  application.SendNotification();
663  application.Render();
664  application.SendNotification();
665 
666  DALI_TEST_EQUALS( dummyImpl.keyEventCalled, false, TEST_LOCATION );
667  Integration::KeyEvent keyEvent;
668  application.ProcessEvent(keyEvent);
669  DALI_TEST_EQUALS( dummyImpl.keyEventCalled, true, TEST_LOCATION );
670 
671  Stage::GetCurrent().Remove(dummy);
672  }
673 
674  // Ensure full code coverage
675  {
677 
678  Stage::GetCurrent().Add(dummy);
679  dummy.SetKeyInputFocus();
680 
681  application.Render();
682  application.SendNotification();
683  application.Render();
684  application.SendNotification();
685 
686  Integration::KeyEvent keyEvent;
687  application.ProcessEvent(keyEvent);
688 
689  Stage::GetCurrent().Remove(dummy);
690  }
691  END_TEST;
692 }
693 
695 {
696  ToolkitTestApplication application;
697 
698  {
699  DummyControl dummy = DummyControl::New( true );
700  DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
701 
702  Stage::GetCurrent().Add(dummy);
703 
705 
706  dummy.SetKeyInputFocus();
707 
709 
710  Stage::GetCurrent().Remove(dummy);
711  }
712 
713  // Ensure full code coverage
714  {
716 
717  Stage::GetCurrent().Add(dummy);
718  dummy.SetKeyInputFocus();
719  Stage::GetCurrent().Remove(dummy);
720  }
721  END_TEST;
722 }
723 
725 {
726  ToolkitTestApplication application;
727 
728  {
729  DummyControl dummy = DummyControl::New( true );
730  DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
731 
732  Stage::GetCurrent().Add(dummy);
733 
734  DALI_TEST_EQUALS( dummyImpl.keyInputFocusLost, false, TEST_LOCATION );
735 
736  dummy.SetKeyInputFocus();
737  dummy.ClearKeyInputFocus();
738 
740 
741  Stage::GetCurrent().Remove(dummy);
742  }
743 
744  // Ensure full code coverage
745  {
747 
748  Stage::GetCurrent().Add(dummy);
749  dummy.SetKeyInputFocus();
750  dummy.ClearKeyInputFocus();
751 
752  DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
753 
754  dummyImpl.OnAccessibilityValueChange( true );
755  dummyImpl.IsKeyboardNavigationSupported();
756  dummyImpl.IsKeyboardFocusGroup();
757 
758  Stage::GetCurrent().Remove(dummy);
759  }
760  END_TEST;
761 }
762 
764 {
765  ToolkitTestApplication application;
766 
767  // Register Type
768  TypeInfo type;
769  type = TypeRegistry::Get().GetTypeInfo( "Control" );
770  DALI_TEST_CHECK( type );
771  BaseHandle handle = type.CreateInstance();
772  DALI_TEST_CHECK( handle );
773 
774  // Check if it's a control
776  END_TEST;
777 }
778 
779 
781 namespace
782 {
783 static bool WheelEventCallback(Actor actor, const WheelEvent& event)
784 {
785  return false;
786 }
787 }
788 
790 {
791  ToolkitTestApplication application;
792 
793  {
794  DummyControl dummy = DummyControl::New( true );
795  DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
796 
797  dummy.SetSize( Vector2( 100.0f, 100.0f ) );
799  Stage::GetCurrent().Add(dummy);
800 
801  dummy.WheelEventSignal().Connect(&WheelEventCallback);
802 
803  application.Render();
804  application.SendNotification();
805  application.Render();
806  application.SendNotification();
807 
808  DALI_TEST_EQUALS( dummyImpl.wheelEventCalled, false, TEST_LOCATION );
809 
810  // simulate a wheel event
811  Vector2 screenCoordinates( 10.0f, 10.0f );
812  Integration::WheelEvent event( Integration::WheelEvent::MOUSE_WHEEL, 0, 0u, screenCoordinates, 1, 1000u );
813  application.ProcessEvent( event );
814  DALI_TEST_EQUALS( dummyImpl.wheelEventCalled, true, TEST_LOCATION );
815 
816  Stage::GetCurrent().Remove(dummy);
817  }
818 
819  // Ensure full code coverage
820  {
822 
823  dummy.SetSize( Vector2( 100.0f, 100.0f ) );
825  Stage::GetCurrent().Add(dummy);
826 
827  dummy.WheelEventSignal().Connect(&WheelEventCallback);
828 
829  application.Render();
830  application.SendNotification();
831  application.Render();
832  application.SendNotification();
833 
834  // simulate a wheel event
835  Vector2 screenCoordinates( 20.0f, 20.0f );
836  Integration::WheelEvent event( Integration::WheelEvent::MOUSE_WHEEL, 0, 0u, screenCoordinates, 1, 1000u );
837  application.ProcessEvent( event );
838 
839  Stage::GetCurrent().Remove(dummy);
840  }
841  END_TEST;
842 }
843 
845 {
846  ToolkitTestApplication application;
847 
848  {
849  DummyControl dummy = DummyControl::New( true );
850 
851  dummy.SetSize( Vector2( 100.0f, 100.0f ) );
853  Stage::GetCurrent().Add(dummy);
854 
855  dummy.SetStyleName("TestStyle");
856 
857  DALI_TEST_CHECK( dummy.GetStyleName() == "TestStyle" );
858 
859  Stage::GetCurrent().Remove(dummy);
860  }
861  END_TEST;
862 }
863 
865 {
866  ToolkitTestApplication application;
867  Control dummy = Control::New();
869 
870  // test that style manager is being used, passing an empty handle does nothing but does not crash either
871  Dali::Toolkit::StyleManager styleManager;
872  controlImpl.OnStyleChange( styleManager, StyleChange::THEME_CHANGE );
873  // no crash so test passes
875 
876  END_TEST;
877 }
878 
879 
881 {
882  ToolkitTestApplication application;
883  Control dummy = Control::New();
885 
886  PanGesture pan;
887  DALI_TEST_EQUALS( false, controlImpl.OnAccessibilityPan( pan ), TEST_LOCATION );
888 
889  END_TEST;
890 }
891 
893 {
894  ToolkitTestApplication application;
895  Control dummy = Control::New();
897  TouchEvent touch;
898  DALI_TEST_EQUALS( false, controlImpl.OnAccessibilityTouch( touch ), TEST_LOCATION );
899 
900  END_TEST;
901 }
902 
904 {
905  ToolkitTestApplication application;
906 
907  Control dummy = Control::New();
910 
911  // Invoke the control's activate action
912  TypeInfo type = TypeRegistry::Get().GetTypeInfo( "Control" );
913  DALI_TEST_CHECK( type );
914 
915  BaseHandle handle = type.CreateInstance();
916  DALI_TEST_CHECK( handle );
917 
918  Property::Map attributes;
919  DALI_TEST_EQUALS( false, handle.DoAction("accessibilityActivated", attributes), TEST_LOCATION );
920 
921  END_TEST;
922 }
923 
925 {
926  ToolkitTestApplication application;
927  Control dummy = Control::New();
929 
930  Actor currentFocusedActor;
931  Actor result = controlImpl.GetNextKeyboardFocusableActor( currentFocusedActor, Control::KeyboardFocus::LEFT, false );
932 
933  DALI_TEST_EQUALS( result, currentFocusedActor, TEST_LOCATION );
934 
935  END_TEST;
936 }
937 
938 
939 
940 
Dali Docs Home
Read more about Dali