Migrating to new test framework
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-TapGestureDetector.cpp
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 #include <iostream>
18
19 #include <stdlib.h>
20 #include <dali/dali.h>
21 #include <dali/integration-api/events/touch-event-integ.h>
22 #include <dali/integration-api/events/tap-gesture-event.h>
23 #include <dali/integration-api/system-overlay.h>
24 #include <dali-test-suite-utils.h>
25
26 using namespace Dali;
27
28 void utc_dali_tap_gesture_detector_startup(void)
29 {
30   test_return_value = TET_UNDEF;
31 }
32
33 void utc_dali_tap_gesture_detector_cleanup(void)
34 {
35   test_return_value = TET_PASS;
36 }
37
38 ///////////////////////////////////////////////////////////////////////////////
39 namespace
40 {
41
42 // Stores data that is populated in the callback and will be read by the TET cases
43 struct SignalData
44 {
45   SignalData()
46   : functorCalled(false),
47     voidFunctorCalled(false)
48   {}
49
50   void Reset()
51   {
52     functorCalled = false;
53     voidFunctorCalled = false;
54
55     receivedGesture.numberOfTaps = 0u;
56     receivedGesture.numberOfTouches = 0u;
57     receivedGesture.screenPoint = Vector2(0.0f, 0.0f);
58     receivedGesture.localPoint = Vector2(0.0f, 0.0f);
59
60     tappedActor = NULL;
61   }
62
63   bool functorCalled;
64   bool voidFunctorCalled;
65   TapGesture receivedGesture;
66   Actor tappedActor;
67 };
68
69 // Functor that sets the data when called
70 struct GestureReceivedFunctor
71 {
72   GestureReceivedFunctor(SignalData& data) : signalData(data) { }
73
74   void operator()(Actor actor, TapGesture tap)
75   {
76     signalData.functorCalled = true;
77     signalData.receivedGesture = tap;
78     signalData.tappedActor = actor;
79   }
80
81   void operator()()
82   {
83     signalData.voidFunctorCalled = true;
84   }
85
86   SignalData& signalData;
87 };
88
89 // Functor that removes the gestured actor from stage
90 struct UnstageActorFunctor : public GestureReceivedFunctor
91 {
92   UnstageActorFunctor( SignalData& data ) : GestureReceivedFunctor( data ) { }
93
94   void operator()(Actor actor, TapGesture tap)
95   {
96     GestureReceivedFunctor::operator()( actor, tap );
97     Stage::GetCurrent().Remove( actor );
98   }
99 };
100
101 // Functor for receiving a touch event
102 struct TouchEventFunctor
103 {
104   bool operator()(Actor actor, const TouchEvent& touch)
105   {
106     //For line coverage
107     unsigned int points = touch.GetPointCount();
108     if( points > 0)
109     {
110       const TouchPoint& touchPoint = touch.GetPoint(0);
111       tet_printf("Touch Point state = %d\n", touchPoint.state);
112     }
113     return false;
114   }
115 };
116
117 // Generate a TapGestureEvent to send to Core
118 Integration::TapGestureEvent GenerateTap(
119     Gesture::State state,
120     unsigned int numberOfTaps,
121     unsigned int numberOfTouches,
122     Vector2 point)
123 {
124   Integration::TapGestureEvent tap( state );
125
126   tap.numberOfTaps = numberOfTaps;
127   tap.numberOfTouches = numberOfTouches;
128   tap.point = point;
129
130   return tap;
131 }
132
133 } // anon namespace
134
135 ///////////////////////////////////////////////////////////////////////////////
136
137
138 // Positive test case for a method
139 int UtcDaliTapGestureDetectorConstructor(void)
140 {
141   TestApplication application;
142
143   TapGestureDetector detector;
144   DALI_TEST_CHECK(!detector);
145   END_TEST;
146 }
147
148
149 int UtcDaliTapGestureDetectorNew(void)
150 {
151   TestApplication application;
152
153   TapGestureDetector detector = TapGestureDetector::New();
154   DALI_TEST_CHECK(detector);
155   DALI_TEST_EQUALS(1u, detector.GetTapsRequired(), TEST_LOCATION);
156   DALI_TEST_EQUALS(1u, detector.GetTouchesRequired(), TEST_LOCATION);
157
158   TapGestureDetector detector2 = TapGestureDetector::New(5u, 5u);
159   DALI_TEST_CHECK(detector2);
160   DALI_TEST_EQUALS(5u, detector2.GetTapsRequired(), TEST_LOCATION);
161   DALI_TEST_EQUALS(5u, detector2.GetTouchesRequired(), TEST_LOCATION);
162
163   //Scoped test to test destructor
164   {
165     TapGestureDetector detector3 = TapGestureDetector::New();
166     DALI_TEST_CHECK(detector3);
167   }
168
169   // Attach an actor and emit a touch event on the actor to ensure complete line coverage
170   Actor actor = Actor::New();
171   actor.SetSize(100.0f, 100.0f);
172   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
173   Stage::GetCurrent().Add(actor);
174
175   // Render and notify
176   application.SendNotification();
177   application.Render();
178
179   detector.Attach(actor);
180
181   TouchEventFunctor touchFunctor;
182   actor.TouchedSignal().Connect( &application, touchFunctor );
183
184   Integration::TouchEvent touchEvent(1);
185   TouchPoint point(1, TouchPoint::Down, 20.0f, 20.0f);
186   touchEvent.AddPoint(point);
187   application.ProcessEvent(touchEvent);
188
189   // Render and notify
190   application.SendNotification();
191   application.Render();
192
193   // For line coverage, Initialise default constructor
194   TouchEvent touchEvent2;
195   END_TEST;
196 }
197
198 int UtcDaliTapGestureDetectorDownCast(void)
199 {
200   TestApplication application;
201   tet_infoline("Testing Dali::TapGestureDetector::DownCast()");
202
203   TapGestureDetector detector = TapGestureDetector::New();
204
205   BaseHandle object(detector);
206
207   TapGestureDetector detector2 = TapGestureDetector::DownCast(object);
208   DALI_TEST_CHECK(detector2);
209
210   TapGestureDetector detector3 = DownCast< TapGestureDetector >(object);
211   DALI_TEST_CHECK(detector3);
212
213   BaseHandle unInitializedObject;
214   TapGestureDetector detector4 = TapGestureDetector::DownCast(unInitializedObject);
215   DALI_TEST_CHECK(!detector4);
216
217   TapGestureDetector detector5 = DownCast< TapGestureDetector >(unInitializedObject);
218   DALI_TEST_CHECK(!detector5);
219
220   GestureDetector detector6 = TapGestureDetector::New();
221   TapGestureDetector detector7 = TapGestureDetector::DownCast(detector6);
222   DALI_TEST_CHECK(detector7);
223   END_TEST;
224 }
225
226 int UtcDaliTapGestureSetTapsRequired(void)
227 {
228   TestApplication application;
229
230   TapGestureDetector detector = TapGestureDetector::New();
231
232   unsigned int taps = 3;
233
234   DALI_TEST_CHECK(taps != detector.GetTapsRequired());
235
236   detector.SetTapsRequired(taps);
237
238   DALI_TEST_EQUALS(taps, detector.GetTapsRequired(), TEST_LOCATION);
239
240   // Attach an actor and change the required touches
241
242   Actor actor = Actor::New();
243   actor.SetSize(100.0f, 100.0f);
244   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
245   Stage::GetCurrent().Add(actor);
246
247   // Render and notify
248   application.SendNotification();
249   application.Render();
250
251   SignalData data;
252   GestureReceivedFunctor functor(data);
253
254   detector.Attach(actor);
255   detector.DetectedSignal().Connect( &application, functor );
256
257   TestGestureManager& gestureManager = application.GetGestureManager();
258   gestureManager.Initialize();
259
260   detector.SetTapsRequired(4);
261
262   // Gesture detection should have been updated only
263   DALI_TEST_EQUALS(true, gestureManager.WasCalled(TestGestureManager::UpdateType), TEST_LOCATION);
264   DALI_TEST_EQUALS(false, gestureManager.WasCalled(TestGestureManager::RegisterType), TEST_LOCATION);
265   DALI_TEST_EQUALS(false, gestureManager.WasCalled(TestGestureManager::UnregisterType), TEST_LOCATION);
266
267   // Reset values
268   gestureManager.Initialize();
269
270   // Create a second gesture detector that requires even less maximum touches
271   TapGestureDetector secondDetector = TapGestureDetector::New();
272   secondDetector.Attach(actor);
273
274   // Gesture detection should have been updated
275   DALI_TEST_EQUALS(true, gestureManager.WasCalled(TestGestureManager::UpdateType), TEST_LOCATION);
276   DALI_TEST_EQUALS(false, gestureManager.WasCalled(TestGestureManager::RegisterType), TEST_LOCATION);
277   DALI_TEST_EQUALS(false, gestureManager.WasCalled(TestGestureManager::UnregisterType), TEST_LOCATION);
278   END_TEST;
279 }
280
281 int UtcDaliTapGestureGetTapsRequired(void)
282 {
283   TestApplication application;
284
285   TapGestureDetector detector = TapGestureDetector::New();
286   DALI_TEST_EQUALS(1u, detector.GetTapsRequired(), TEST_LOCATION);
287   END_TEST;
288 }
289
290 int UtcDaliTapGestureSetTouchesRequired(void)
291 {
292   TestApplication application;
293
294   TapGestureDetector detector = TapGestureDetector::New();
295
296   unsigned int max = 3;
297
298   DALI_TEST_CHECK(max != detector.GetTouchesRequired());
299
300   detector.SetTouchesRequired(max);
301
302   DALI_TEST_EQUALS(max, detector.GetTouchesRequired(), TEST_LOCATION);
303
304   // Attach an actor and change the maximum touches
305
306   Actor actor = Actor::New();
307   actor.SetSize(100.0f, 100.0f);
308   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
309   Stage::GetCurrent().Add(actor);
310
311   // Render and notify
312   application.SendNotification();
313   application.Render();
314
315   SignalData data;
316   GestureReceivedFunctor functor(data);
317
318   detector.Attach(actor);
319   detector.DetectedSignal().Connect( &application, functor );
320
321   TestGestureManager& gestureManager = application.GetGestureManager();
322   gestureManager.Initialize();
323
324   detector.SetTouchesRequired(4);
325
326   // Gesture detection should have been updated only
327   DALI_TEST_EQUALS(true, gestureManager.WasCalled(TestGestureManager::UpdateType), TEST_LOCATION);
328   DALI_TEST_EQUALS(false, gestureManager.WasCalled(TestGestureManager::RegisterType), TEST_LOCATION);
329   DALI_TEST_EQUALS(false, gestureManager.WasCalled(TestGestureManager::UnregisterType), TEST_LOCATION);
330
331   // Reset values
332   gestureManager.Initialize();
333
334   // Create a second gesture detector that requires even less maximum touches
335   TapGestureDetector secondDetector = TapGestureDetector::New();
336   secondDetector.Attach(actor);
337
338   // Gesture detection should have been updated
339   DALI_TEST_EQUALS(true, gestureManager.WasCalled(TestGestureManager::UpdateType), TEST_LOCATION);
340   DALI_TEST_EQUALS(false, gestureManager.WasCalled(TestGestureManager::RegisterType), TEST_LOCATION);
341   DALI_TEST_EQUALS(false, gestureManager.WasCalled(TestGestureManager::UnregisterType), TEST_LOCATION);
342   END_TEST;
343 }
344
345 int UtcDaliTapGestureGetTouchesRequired(void)
346 {
347   TestApplication application;
348
349   TapGestureDetector detector = TapGestureDetector::New();
350   DALI_TEST_EQUALS(1u, detector.GetTouchesRequired(), TEST_LOCATION);
351   END_TEST;
352 }
353
354 int UtcDaliTapGestureSignalReceptionNegative(void)
355 {
356   TestApplication application;
357
358   Actor actor = Actor::New();
359   actor.SetSize(100.0f, 100.0f);
360   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
361   Stage::GetCurrent().Add(actor);
362
363   // Render and notify
364   application.SendNotification();
365   application.Render();
366
367   SignalData data;
368   GestureReceivedFunctor functor(data);
369
370   TapGestureDetector detector = TapGestureDetector::New();
371   detector.Attach(actor);
372   detector.DetectedSignal().Connect( &application, functor );
373
374   // Do a tap outside actor's area
375   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(112.0f, 112.0f)));
376   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(112.0f, 112.0f)));
377   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
378   END_TEST;
379 }
380
381 int UtcDaliTapGestureSignalReceptionPositive(void)
382 {
383   TestApplication application;
384
385   Actor actor = Actor::New();
386   actor.SetSize(100.0f, 100.0f);
387   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
388   Stage::GetCurrent().Add(actor);
389
390   // Render and notify
391   application.SendNotification();
392   application.Render();
393
394   SignalData data;
395   GestureReceivedFunctor functor(data);
396
397   TapGestureDetector detector = TapGestureDetector::New();
398   detector.Attach(actor);
399   detector.DetectedSignal().Connect( &application, functor );
400
401   // Do a tap inside actor's area
402   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 50.0f)));
403   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 50.0f)));
404   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
405   DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTaps, TEST_LOCATION);
406   DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
407   DALI_TEST_EQUALS( Vector2(50.0f, 50.0f), data.receivedGesture.localPoint, 0.1, TEST_LOCATION);
408   END_TEST;
409 }
410
411 int UtcDaliTapGestureSignalReceptionDetach(void)
412 {
413   TestApplication application;
414
415   Actor actor = Actor::New();
416   actor.SetSize(100.0f, 100.0f);
417   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
418   Stage::GetCurrent().Add(actor);
419
420   // Render and notify
421   application.SendNotification();
422   application.Render();
423
424   SignalData data;
425   GestureReceivedFunctor functor(data);
426
427   TapGestureDetector detector = TapGestureDetector::New();
428   detector.Attach(actor);
429   detector.DetectedSignal().Connect(&application, functor);
430
431   // Start tap within the actor's area
432   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(20.0f, 20.0f)));
433   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(20.0f, 20.0f)));
434   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
435   DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTaps, TEST_LOCATION);
436   DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
437   DALI_TEST_EQUALS( Vector2(20.0f, 20.0f), data.receivedGesture.localPoint, 0.1, TEST_LOCATION);
438
439   // repeat the tap within the actor's area - we should still receive the signal
440   data.Reset();
441   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 50.0f)));
442   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 50.0f)));
443   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
444   DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTaps, TEST_LOCATION);
445   DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
446   DALI_TEST_EQUALS( Vector2(50.0f, 50.0f), data.receivedGesture.localPoint, 0.1, TEST_LOCATION);
447
448   // Detach actor
449   detector.DetachAll();
450
451   // Ensure we are no longer signalled
452   data.Reset();
453   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(20.0f, 20.0f)));
454   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(20.0f, 20.0f)));
455   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
456   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 50.0f)));
457   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 50.0f)));
458   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
459   END_TEST;
460 }
461
462 int UtcDaliTapGestureSignalReceptionActorDestroyedWhileTapping(void)
463 {
464   TestApplication application;
465
466   SignalData data;
467   GestureReceivedFunctor functor(data);
468
469   TapGestureDetector detector = TapGestureDetector::New();
470   detector.DetectedSignal().Connect(&application, functor);
471
472   // Actor lifetime is scoped
473   {
474     Actor actor = Actor::New();
475     actor.SetSize(100.0f, 100.0f);
476     actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
477     Stage::GetCurrent().Add(actor);
478
479     // Render and notify
480     application.SendNotification();
481     application.Render();
482
483     detector.Attach(actor);
484
485     // Start tap within the actor's area
486     application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(20.0f, 20.0f)));
487     application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(20.0f, 20.0f)));
488     DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
489
490     // Remove the actor from stage and reset the data
491     Stage::GetCurrent().Remove(actor);
492
493     // Render and notify
494     application.SendNotification();
495     application.Render();
496   }
497
498   // Actor should now have been destroyed
499
500   data.Reset();
501   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(20.0f, 20.0f)));
502   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(20.0f, 20.0f)));
503   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
504   END_TEST;
505 }
506
507 int UtcDaliTapGestureSignalReceptionRotatedActor(void)
508 {
509   TestApplication application;
510
511   Actor actor = Actor::New();
512   actor.SetSize(100.0f, 100.0f);
513   actor.SetRotation(Dali::Degree(90.0f), Vector3::ZAXIS);
514   Stage::GetCurrent().Add(actor);
515
516   // Render and notify
517   application.SendNotification();
518   application.Render();
519
520   SignalData data;
521   GestureReceivedFunctor functor(data);
522
523   TapGestureDetector detector = TapGestureDetector::New();
524   detector.Attach(actor);
525   detector.DetectedSignal().Connect(&application, functor);
526
527   // Do tap, only check finished value
528   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(5.0f, 5.0f)));
529   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(5.0f, 5.0f)));
530   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
531   DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTaps, TEST_LOCATION);
532   DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
533   DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION);
534
535   // Rotate actor again and render
536   actor.SetRotation(Dali::Degree(180.0f), Vector3::ZAXIS);
537   application.SendNotification();
538   application.Render();
539
540   // Do tap, should still receive event
541   data.Reset();
542   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(5.0f, 5.0f)));
543   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(5.0f, 5.0f)));
544   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
545   DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTaps, TEST_LOCATION);
546   DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
547   DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION);
548
549   // Rotate actor again and render
550   actor.SetRotation(Dali::Degree(90.0f), Vector3::YAXIS);
551   application.SendNotification();
552   application.Render();
553
554   // Do tap, inside the actor's area (area if it is not rotated), Should not receive the event
555   data.Reset();
556   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(70.0f, 70.0f)));
557   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(70.0f, 70.0f)));
558   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
559   END_TEST;
560 }
561
562 int UtcDaliTapGestureSignalReceptionChildHit(void)
563 {
564   TestApplication application;
565
566   Actor parent = Actor::New();
567   parent.SetSize(100.0f, 100.0f);
568   parent.SetAnchorPoint(AnchorPoint::TOP_LEFT);
569   Stage::GetCurrent().Add(parent);
570
571   // Set child to completely cover parent.
572   // Change rotation of child to be different from parent so that we can check if our local coordinate
573   // conversion of the parent actor is correct.
574   Actor child = Actor::New();
575   child.SetSize(100.0f, 100.0f);
576   child.SetAnchorPoint(AnchorPoint::CENTER);
577   child.SetParentOrigin(ParentOrigin::CENTER);
578   child.SetRotation(Dali::Degree(90.0f), Vector3::ZAXIS);
579   parent.Add(child);
580
581   TouchEventFunctor touchFunctor;
582   child.TouchedSignal().Connect(&application, touchFunctor);
583
584   // Render and notify
585   application.SendNotification();
586   application.Render();
587
588   SignalData data;
589   GestureReceivedFunctor functor(data);
590
591   TapGestureDetector detector = TapGestureDetector::New();
592   detector.Attach(parent);
593   detector.DetectedSignal().Connect(&application, functor);
594
595   // Do tap - hits child area but parent should still receive it
596   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 50.0f)));
597   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 50.0f)));
598   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
599   DALI_TEST_EQUALS(true, parent == data.tappedActor, TEST_LOCATION);
600   DALI_TEST_EQUALS(Vector2(50.0f, 50.0f), data.receivedGesture.screenPoint, 0.01f, TEST_LOCATION);
601
602   // Attach child and generate same touch points
603   // (Also proves that you can detach and then re-attach another actor)
604   detector.Attach(child);
605   detector.Detach(parent);
606
607   // Do an entire tap, only check finished value
608   data.Reset();
609   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(51.0f, 51.0f)));
610   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(51.0f, 51.0f)));
611   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
612   DALI_TEST_EQUALS(true, child == data.tappedActor, TEST_LOCATION);
613   DALI_TEST_EQUALS(Vector2(51.0f, 51.0f), data.receivedGesture.screenPoint, 0.01f, TEST_LOCATION);
614   END_TEST;
615 }
616
617 int UtcDaliTapGestureSignalReceptionAttachDetachMany(void)
618 {
619   TestApplication application;
620
621   Actor first = Actor::New();
622   first.SetSize(100.0f, 100.0f);
623   first.SetAnchorPoint(AnchorPoint::TOP_LEFT);
624   Stage::GetCurrent().Add(first);
625
626   Actor second = Actor::New();
627   second.SetSize(100.0f, 100.0f);
628   second.SetX(100.0f);
629   second.SetAnchorPoint(AnchorPoint::TOP_LEFT);
630   Stage::GetCurrent().Add(second);
631
632   // Render and notify
633   application.SendNotification();
634   application.Render();
635
636   SignalData data;
637   GestureReceivedFunctor functor(data);
638
639   TapGestureDetector detector = TapGestureDetector::New();
640   detector.Attach(first);
641   detector.Attach(second);
642   detector.DetectedSignal().Connect(&application, functor);
643
644   // Tap within second actor's area
645   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(120.0f, 10.0f)));
646   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(120.0f, 10.0f)));
647   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
648   DALI_TEST_EQUALS(true, second == data.tappedActor, TEST_LOCATION);
649
650   // Tap within first actor's area
651   data.Reset();
652   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(20.0f, 10.0f)));
653   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(20.0f, 10.0f)));
654   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
655   DALI_TEST_EQUALS(true, first == data.tappedActor, TEST_LOCATION);
656
657   // Detach the second actor
658   detector.Detach(second);
659
660   // second actor shouldn't receive event
661   data.Reset();
662   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(120.0f, 10.0f)));
663   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(120.0f, 10.0f)));
664   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
665
666   // first actor should continue receiving event
667   data.Reset();
668   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(20.0f, 10.0f)));
669   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(20.0f, 10.0f)));
670   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
671   END_TEST;
672 }
673
674 int UtcDaliTapGestureSignalReceptionActorBecomesUntouchable(void)
675 {
676   TestApplication application;
677
678   Actor actor = Actor::New();
679   actor.SetSize(100.0f, 100.0f);
680   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
681   Stage::GetCurrent().Add(actor);
682
683   // Render and notify
684   application.SendNotification();
685   application.Render();
686
687   SignalData data;
688   GestureReceivedFunctor functor(data);
689
690   TapGestureDetector detector = TapGestureDetector::New();
691   detector.Attach(actor);
692   detector.DetectedSignal().Connect(&application, functor);
693
694   // Tap in actor's area
695   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
696   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
697   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
698
699   // Actor become invisible - actor should not receive the next pan
700   actor.SetVisible(false);
701
702   // Render and notify
703   application.SendNotification();
704   application.Render();
705
706   // Tap in the same area, shouldn't receive event
707   data.Reset();
708   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
709   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
710   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
711   END_TEST;
712 }
713
714 int UtcDaliTapGestureSignalReceptionMultipleGestureDetectors(void)
715 {
716   TestApplication application;
717   Dali::TestGestureManager& gestureManager = application.GetGestureManager();
718
719   Actor first = Actor::New();
720   first.SetSize(100.0f, 100.0f);
721   first.SetAnchorPoint(AnchorPoint::TOP_LEFT);
722   Stage::GetCurrent().Add(first);
723
724   Actor second = Actor::New();
725   second.SetSize(100.0f, 100.0f);
726   second.SetAnchorPoint(AnchorPoint::TOP_LEFT);
727   second.SetX(100.0f);
728   first.Add(second);
729
730   // Render and notify
731   application.SendNotification();
732   application.Render();
733
734   SignalData data;
735   GestureReceivedFunctor functor(data);
736
737   TapGestureDetector firstDetector = TapGestureDetector::New();
738   firstDetector.Attach(first);
739   firstDetector.DetectedSignal().Connect(&application, functor);
740
741   // secondDetector is scoped
742   {
743     // Reset gestureManager statistics
744     gestureManager.Initialize();
745
746     TapGestureDetector secondDetector = TapGestureDetector::New();
747     secondDetector.SetTapsRequired(2);
748     secondDetector.SetTouchesRequired(2);
749     secondDetector.Attach(second);
750     secondDetector.DetectedSignal().Connect(&application, functor);
751
752     DALI_TEST_EQUALS(true, gestureManager.WasCalled(TestGestureManager::UpdateType), TEST_LOCATION);
753     DALI_TEST_EQUALS(false, gestureManager.WasCalled(TestGestureManager::RegisterType), TEST_LOCATION);
754     DALI_TEST_EQUALS(false, gestureManager.WasCalled(TestGestureManager::UnregisterType), TEST_LOCATION);
755
756     // Tap within second actor's area
757     application.ProcessEvent(GenerateTap(Gesture::Possible, 2u, 2u, Vector2(150.0f, 10.0f)));
758     application.ProcessEvent(GenerateTap(Gesture::Started, 2u, 2u, Vector2(150.0f, 10.0f)));
759     DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
760     DALI_TEST_EQUALS(true, second == data.tappedActor, TEST_LOCATION);
761
762     // Tap continues as single touch gesture - we should not receive any gesture
763     data.Reset();
764     application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(150.0f, 10.0f)));
765     application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(150.0f, 10.0f)));
766     DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
767
768     // Single touch tap starts - first actor should be panned
769     data.Reset();
770     application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
771     application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
772     DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
773     DALI_TEST_EQUALS(true, first == data.tappedActor, TEST_LOCATION);
774
775     // Pan changes to double-touch - we shouldn't receive event
776     data.Reset();
777     application.ProcessEvent(GenerateTap(Gesture::Possible, 2u, 2u, Vector2(50.0f, 10.0f)));
778     application.ProcessEvent(GenerateTap(Gesture::Started, 2u, 2u, Vector2(50.0f, 10.0f)));
779     DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
780
781     // Reset gesture manager statistics
782     gestureManager.Initialize();
783   }
784
785   // secondDetector has now been deleted.  Gesture detection should have been updated only
786   DALI_TEST_EQUALS(true, gestureManager.WasCalled(TestGestureManager::UpdateType), TEST_LOCATION);
787   DALI_TEST_EQUALS(false, gestureManager.WasCalled(TestGestureManager::RegisterType), TEST_LOCATION);
788   DALI_TEST_EQUALS(false, gestureManager.WasCalled(TestGestureManager::UnregisterType), TEST_LOCATION);
789   END_TEST;
790 }
791
792 int UtcDaliTapGestureSignalReceptionMultipleDetectorsOnActor(void)
793 {
794   TestApplication application;
795
796   Actor actor = Actor::New();
797   actor.SetSize(100.0f, 100.0f);
798   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
799   Stage::GetCurrent().Add(actor);
800
801   // Render and notify
802   application.SendNotification();
803   application.Render();
804
805   // Attach actor to one detector
806   SignalData firstData;
807   GestureReceivedFunctor firstFunctor(firstData);
808   TapGestureDetector firstDetector = TapGestureDetector::New();
809   firstDetector.Attach(actor);
810   firstDetector.DetectedSignal().Connect(&application, firstFunctor);
811
812   // Attach actor to another detector
813   SignalData secondData;
814   GestureReceivedFunctor secondFunctor(secondData);
815   TapGestureDetector secondDetector = TapGestureDetector::New();
816   secondDetector.Attach(actor);
817   secondDetector.DetectedSignal().Connect(&application, secondFunctor);
818
819   // Tap in actor's area - both detector's functors should be called
820   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
821   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
822   DALI_TEST_EQUALS(true, firstData.functorCalled, TEST_LOCATION);
823   DALI_TEST_EQUALS(true, secondData.functorCalled, TEST_LOCATION);
824   END_TEST;
825 }
826
827 int UtcDaliTapGestureSignalReceptionDifferentPossible(void)
828 {
829   TestApplication application;
830
831   Actor actor = Actor::New();
832   actor.SetSize(100.0f, 100.0f);
833   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
834   Stage::GetCurrent().Add(actor);
835
836   // Render and notify
837   application.SendNotification();
838   application.Render();
839
840   // Attach actor to detector
841   SignalData data;
842   GestureReceivedFunctor functor( data );
843   TapGestureDetector detector = TapGestureDetector::New();
844   detector.Attach(actor);
845   detector.DetectedSignal().Connect( &application, functor );
846
847   // Gesture possible in actor's area.
848   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
849   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
850
851   // Move actor somewhere else
852   actor.SetPosition( 100.0f, 100.0f );
853
854   // Render and notify
855   application.SendNotification();
856   application.Render();
857
858   // Emit Started event, we should not receive the long press.
859   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
860   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
861
862   // LongPress possible in empty area.
863   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
864   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
865
866   // Move actor in to the long press position.
867   actor.SetPosition( 0.0f, 0.0f );
868
869   // Render and notify
870   application.SendNotification();
871   application.Render();
872
873   // Emit Started event, we should not receive the long press.
874   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
875   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
876
877   // Normal long press in actor's area for completeness.
878   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
879   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
880   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
881   END_TEST;
882 }
883
884 int UtcDaliTapGestureEmitIncorrectStateClear(void)
885 {
886   TestApplication application;
887
888   Actor actor = Actor::New();
889   actor.SetSize(100.0f, 100.0f);
890   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
891   Stage::GetCurrent().Add(actor);
892
893   // Render and notify
894   application.SendNotification();
895   application.Render();
896
897   // Attach actor to detector
898   SignalData data;
899   GestureReceivedFunctor functor( data );
900   TapGestureDetector detector = TapGestureDetector::New();
901   detector.Attach(actor);
902   detector.DetectedSignal().Connect( &application, functor );
903
904   // Try a Clear state
905   try
906   {
907     application.ProcessEvent(GenerateTap(Gesture::Clear, 1u, 1u, Vector2(50.0f, 10.0f)));
908     tet_result(TET_FAIL);
909   }
910   catch ( Dali::DaliException& e )
911   {
912     DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
913   }
914   END_TEST;
915 }
916
917 int UtcDaliTapGestureEmitIncorrectStateContinuing(void)
918 {
919   TestApplication application;
920
921   Actor actor = Actor::New();
922   actor.SetSize(100.0f, 100.0f);
923   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
924   Stage::GetCurrent().Add(actor);
925
926   // Render and notify
927   application.SendNotification();
928   application.Render();
929
930   // Attach actor to detector
931   SignalData data;
932   GestureReceivedFunctor functor( data );
933   TapGestureDetector detector = TapGestureDetector::New();
934   detector.Attach(actor);
935   detector.DetectedSignal().Connect( &application, functor );
936
937   // Try a Continuing state
938   try
939   {
940     application.ProcessEvent(GenerateTap(Gesture::Continuing, 1u, 1u, Vector2(50.0f, 10.0f)));
941     tet_result(TET_FAIL);
942   }
943   catch ( Dali::DaliException& e )
944   {
945     DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
946   }
947   END_TEST;
948 }
949
950 int UtcDaliTapGestureEmitIncorrectStateFinished(void)
951 {
952   TestApplication application;
953
954   Actor actor = Actor::New();
955   actor.SetSize(100.0f, 100.0f);
956   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
957   Stage::GetCurrent().Add(actor);
958
959   // Render and notify
960   application.SendNotification();
961   application.Render();
962
963   // Attach actor to detector
964   SignalData data;
965   GestureReceivedFunctor functor( data );
966   TapGestureDetector detector = TapGestureDetector::New();
967   detector.Attach(actor);
968   detector.DetectedSignal().Connect( &application, functor );
969
970   // Try a Finished state
971   try
972   {
973     application.ProcessEvent(GenerateTap(Gesture::Finished, 1u, 1u, Vector2(50.0f, 10.0f)));
974     tet_result(TET_FAIL);
975   }
976   catch ( Dali::DaliException& e )
977   {
978     DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
979   }
980   END_TEST;
981 }
982
983 int UtcDaliTapGestureActorUnstaged(void)
984 {
985   TestApplication application;
986
987   Actor actor = Actor::New();
988   actor.SetSize(100.0f, 100.0f);
989   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
990   Stage::GetCurrent().Add(actor);
991
992   // Render and notify
993   application.SendNotification();
994   application.Render();
995
996   // Attach actor to detector
997   SignalData data;
998   UnstageActorFunctor functor( data );
999   TapGestureDetector detector = TapGestureDetector::New();
1000   detector.Attach(actor);
1001   detector.DetectedSignal().Connect( &application, functor );
1002
1003   // Tap in Actor's area, actor removed in signal handler, should be handled gracefully.
1004   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
1005   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
1006   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
1007   tet_result( TET_PASS ); // If we get here, then the actor removal on signal handler was handled gracefully.
1008   END_TEST;
1009 }
1010
1011 int UtcDaliTapGestureRepeatedState(void)
1012 {
1013   TestApplication application;
1014
1015   Actor actor = Actor::New();
1016   actor.SetSize(100.0f, 100.0f);
1017   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
1018   Stage::GetCurrent().Add(actor);
1019
1020   // Render and notify
1021   application.SendNotification();
1022   application.Render();
1023
1024   // Attach actor to detector
1025   SignalData data;
1026   GestureReceivedFunctor functor( data );
1027   TapGestureDetector detector = TapGestureDetector::New();
1028   detector.Attach(actor);
1029   detector.DetectedSignal().Connect( &application, functor );
1030
1031   // Emit two possibles
1032   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
1033   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
1034   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
1035
1036   // Send a couple of Started states, only first one should be received.
1037   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
1038   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
1039   data.Reset();
1040   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
1041   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
1042
1043   // Send a couple of cancelled states, no reception
1044   application.ProcessEvent(GenerateTap(Gesture::Cancelled, 1u, 1u, Vector2(50.0f, 10.0f)));
1045   application.ProcessEvent(GenerateTap(Gesture::Cancelled, 1u, 1u, Vector2(50.0f, 10.0f)));
1046   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
1047   END_TEST;
1048 }
1049
1050 int UtcDaliTapGesturePossibleCancelled(void)
1051 {
1052   TestApplication application;
1053
1054   Actor actor = Actor::New();
1055   actor.SetSize(100.0f, 100.0f);
1056   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
1057   Stage::GetCurrent().Add(actor);
1058
1059   // Render and notify
1060   application.SendNotification();
1061   application.Render();
1062
1063   // Attach actor to detector
1064   SignalData data;
1065   GestureReceivedFunctor functor( data );
1066   TapGestureDetector detector = TapGestureDetector::New();
1067   detector.Attach(actor);
1068   detector.DetectedSignal().Connect( &application, functor );
1069
1070   // Emit a possible and then a cancelled, no reception
1071   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
1072   application.ProcessEvent(GenerateTap(Gesture::Cancelled, 1u, 1u, Vector2(50.0f, 10.0f)));
1073   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
1074   END_TEST;
1075 }
1076
1077 int UtcDaliTapGestureDetectorRemovedWhilePossible(void)
1078 {
1079   TestApplication application;
1080
1081   Actor actor = Actor::New();
1082   actor.SetSize(100.0f, 100.0f);
1083   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
1084   Stage::GetCurrent().Add(actor);
1085
1086   // Render and notify
1087   application.SendNotification();
1088   application.Render();
1089
1090   // Attach actor to detector
1091   SignalData data;
1092   GestureReceivedFunctor functor( data );
1093   TapGestureDetector detector = TapGestureDetector::New();
1094   detector.Attach(actor);
1095   detector.DetectedSignal().Connect( &application, functor );
1096
1097   // Emit a possible
1098   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
1099
1100   // Detach actor and send a Started state, no signal.
1101   detector.DetachAll();
1102   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
1103   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
1104   END_TEST;
1105 }
1106
1107 int UtcDaliTapGestureActorRemovedWhilePossible(void)
1108 {
1109   TestApplication application;
1110
1111   Actor actor = Actor::New();
1112   actor.SetSize(100.0f, 100.0f);
1113   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
1114   Stage::GetCurrent().Add(actor);
1115
1116   // Render and notify
1117   application.SendNotification();
1118   application.Render();
1119
1120   // Attach actor to detector
1121   SignalData data;
1122   GestureReceivedFunctor functor( data );
1123   TapGestureDetector detector = TapGestureDetector::New();
1124   detector.Attach(actor);
1125   detector.DetectedSignal().Connect( &application, functor );
1126
1127   // Emit a possible
1128   application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
1129
1130   // Remove, render and delete actor
1131   Stage::GetCurrent().Remove(actor);
1132   application.SendNotification();
1133   application.Render();
1134   actor = NULL;
1135
1136   // Send a Started state, no signal.
1137   application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
1138   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
1139   END_TEST;
1140 }
1141
1142 int UtcDaliTapGestureSystemOverlay(void)
1143 {
1144   TestApplication application;
1145   Dali::Integration::Core& core = application.GetCore();
1146   Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
1147   systemOverlay.GetOverlayRenderTasks().CreateTask();
1148
1149   Actor actor = Actor::New();
1150   actor.SetSize(100.0f, 100.0f);
1151   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
1152   systemOverlay.Add(actor);
1153
1154   // Render and notify
1155   application.SendNotification();
1156   application.Render();
1157
1158   SignalData data;
1159   GestureReceivedFunctor functor(data);
1160
1161   TapGestureDetector detector = TapGestureDetector::New();
1162   detector.Attach(actor);
1163   detector.DetectedSignal().Connect(&application, functor);
1164
1165   Vector2 screenCoords( 50.0f, 50.0f );
1166
1167   // Do a tap inside actor's area
1168   application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, screenCoords ) );
1169   application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, screenCoords ) );
1170   DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
1171   END_TEST;
1172 }