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