Gesture event refactor
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-PanGestureRecognizer.cpp
1 /*
2  * Copyright (c) 2019 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/public-api/dali-core.h>
22 #include <dali/integration-api/input-options.h>
23 #include <dali/integration-api/events/touch-event-integ.h>
24 #include <dali/integration-api/render-task-list-integ.h>
25 #include <dali/internal/event/events/pan-gesture-event.h>
26 #include <dali-test-suite-utils.h>
27 #include <test-touch-utils.h>
28
29 using namespace Dali;
30
31 ///////////////////////////////////////////////////////////////////////////////
32 namespace
33 {
34
35 struct SignalData
36 {
37   SignalData()
38   : functorCalled(false),
39     voidFunctorCalled(false),
40     receivedGesture()
41   {}
42
43   void Reset()
44   {
45     functorCalled = false;
46     voidFunctorCalled = false;
47
48     receivedGesture.state = Gesture::Started;
49
50     pannedActor.Reset();
51   }
52
53   bool functorCalled;
54   bool voidFunctorCalled;
55   PanGesture receivedGesture;
56   Actor pannedActor;
57 };
58
59 // Functor that sets the data when called
60 struct GestureReceivedFunctor
61 {
62   GestureReceivedFunctor(SignalData& data) : signalData(data) { }
63
64   void operator()(Actor actor, const PanGesture& pan)
65   {
66     signalData.functorCalled = true;
67     signalData.receivedGesture = pan;
68     signalData.pannedActor = actor;
69   }
70
71   void operator()()
72   {
73     signalData.voidFunctorCalled = true;
74   }
75
76   SignalData& signalData;
77 };
78
79
80 Integration::TouchEvent GenerateSingleTouch( PointState::Type state, const Vector2& screenPosition, uint32_t time )
81 {
82   Integration::TouchEvent touchEvent;
83   Integration::Point point;
84   point.SetState( state );
85   point.SetScreenPosition( screenPosition );
86   point.SetDeviceClass( Device::Class::TOUCH );
87   point.SetDeviceSubclass( Device::Subclass::NONE );
88   touchEvent.points.push_back( point );
89   touchEvent.time = time;
90   return touchEvent;
91 }
92
93 Integration::TouchEvent GenerateDoubleTouch( PointState::Type stateA, const Vector2& screenPositionA, PointState::Type stateB, const Vector2& screenPositionB, uint32_t time )
94 {
95   Integration::TouchEvent touchEvent;
96   Integration::Point point;
97   point.SetState( stateA );
98   point.SetScreenPosition( screenPositionA );
99   point.SetDeviceClass( Device::Class::TOUCH );
100   point.SetDeviceSubclass( Device::Subclass::NONE );
101   touchEvent.points.push_back( point );
102   point.SetScreenPosition( screenPositionB );
103   point.SetState( stateB);
104   touchEvent.points.push_back( point );
105   touchEvent.time = time;
106   return touchEvent;
107 }
108
109
110 } // anon namespace
111
112 ///////////////////////////////////////////////////////////////////////////////
113
114
115 int UtcDaliPanGestureRecognizerBasicNoAction(void)
116 {
117   TestApplication application;
118
119   PanGestureDetector detector = PanGestureDetector::New();
120
121   Actor actor = Actor::New();
122   actor.SetSize(100.0f, 100.0f);
123   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
124   Stage::GetCurrent().Add(actor);
125
126   // Render and notify
127   application.SendNotification();
128   application.Render();
129
130   detector.Attach(actor);
131
132   SignalData data;
133   GestureReceivedFunctor functor(data);
134   detector.DetectedSignal().Connect(&application, functor);
135
136   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), 150 ) );
137
138   application.ProcessEvent( GenerateSingleTouch( PointState::UP, Vector2( 20.0f, 20.0f ), 200 ) );
139
140   application.SendNotification();
141
142   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
143
144   END_TEST;
145 }
146
147 int UtcDaliPanGestureRecognizerBasic(void)
148 {
149   TestApplication application;
150
151   PanGestureDetector detector = PanGestureDetector::New();
152
153   Actor actor = Actor::New();
154   actor.SetSize(100.0f, 100.0f);
155   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
156   Stage::GetCurrent().Add(actor);
157
158   // Render and notify
159   application.SendNotification();
160   application.Render();
161
162   detector.Attach(actor);
163
164   SignalData data;
165   GestureReceivedFunctor functor(data);
166   detector.DetectedSignal().Connect(&application, functor);
167
168   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), 150 ) );
169   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 40.0f ), 151 ) );
170   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 60.0f ), 152 ) );
171
172   application.SendNotification();
173
174   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
175
176   END_TEST;
177 }
178
179 int UtcDaliPanGestureRecognizerBasicInterrupted(void)
180 {
181   TestApplication application;
182
183   PanGestureDetector detector = PanGestureDetector::New();
184
185   Actor actor = Actor::New();
186   actor.SetSize(100.0f, 100.0f);
187   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
188   Stage::GetCurrent().Add(actor);
189
190   // Render and notify
191   application.SendNotification();
192   application.Render();
193
194   detector.Attach(actor);
195
196   SignalData data;
197   GestureReceivedFunctor functor(data);
198   detector.DetectedSignal().Connect(&application, functor);
199
200   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), 150 ) );
201   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 25.0f ), 151 ) );
202   application.ProcessEvent( GenerateSingleTouch( PointState::INTERRUPTED, Vector2( 20.0f, 30.0f ), 152 ) );
203
204   application.SendNotification();
205
206   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
207
208   END_TEST;
209 }
210
211 int UtcDaliPanGestureRecognizerBasicShortest(void)
212 {
213   TestApplication application;
214
215   PanGestureDetector detector = PanGestureDetector::New();
216
217   Actor actor = Actor::New();
218   actor.SetSize(100.0f, 100.0f);
219   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
220   Stage::GetCurrent().Add(actor);
221
222   // Render and notify
223   application.SendNotification();
224   application.Render();
225
226   detector.Attach(actor);
227
228   SignalData data;
229   GestureReceivedFunctor functor(data);
230   detector.DetectedSignal().Connect(&application, functor);
231
232   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), 150 ) );
233   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 40.0f ), 151 ) );
234   application.ProcessEvent( GenerateSingleTouch( PointState::UP, Vector2( 20.0f, 40.0f ), 155 ) );
235
236   application.SendNotification();
237
238   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
239
240   END_TEST;
241 }
242
243 int UtcDaliPanGestureRecognizerBasicFailToStart(void)
244 {
245   TestApplication application;
246
247   PanGestureDetector detector = PanGestureDetector::New();
248
249   Actor actor = Actor::New();
250   actor.SetSize(100.0f, 100.0f);
251   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
252   Stage::GetCurrent().Add(actor);
253
254   // Render and notify
255   application.SendNotification();
256   application.Render();
257
258   detector.Attach(actor);
259
260   SignalData data;
261   GestureReceivedFunctor functor(data);
262   detector.DetectedSignal().Connect(&application, functor);
263
264   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), 150 ) );
265   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 40.0f ), 151 ) );
266   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 50.0f ), PointState::DOWN, Vector2( 40.0f, 40.0f ), 153 ) );
267
268   application.SendNotification();
269
270   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
271
272   END_TEST;
273 }
274
275 int UtcDaliPanGestureRecognizerBasicStationary(void)
276 {
277   TestApplication application;
278
279   PanGestureDetector detector = PanGestureDetector::New();
280
281   Actor actor = Actor::New();
282   actor.SetSize(100.0f, 100.0f);
283   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
284   Stage::GetCurrent().Add(actor);
285
286   // Render and notify
287   application.SendNotification();
288   application.Render();
289
290   detector.Attach(actor);
291
292   SignalData data;
293   GestureReceivedFunctor functor(data);
294   detector.DetectedSignal().Connect(&application, functor);
295
296   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), 150 ) );
297   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 40.0f ), 151 ) );
298   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 50.0f ), 152 ) );
299   application.ProcessEvent( GenerateSingleTouch( PointState::STATIONARY, Vector2( 20.0f, 50.0f ), 153 ) );
300   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 55.0f ), 154 ) );
301
302   application.SendNotification();
303
304   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
305
306   END_TEST;
307 }
308
309 int UtcDaliPanGestureRecognizerNewParametersFail(void)
310 {
311   TestApplication application;
312
313   PanGestureDetector detector = PanGestureDetector::New();
314
315   detector.SetMaximumTouchesRequired(2);
316   detector.SetMinimumTouchesRequired(2);
317
318   Actor actor = Actor::New();
319   actor.SetSize(100.0f, 100.0f);
320   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
321   Stage::GetCurrent().Add(actor);
322
323   // Render and notify
324   application.SendNotification();
325   application.Render();
326
327   detector.Attach(actor);
328
329   SignalData data;
330   GestureReceivedFunctor functor(data);
331   detector.DetectedSignal().Connect(&application, functor);
332
333   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), 150 ) );
334   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 40.0f ), 151 ) );
335   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 60.0f ), 152 ) );
336
337   application.SendNotification();
338
339   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
340
341   END_TEST;
342 }
343
344 int UtcDaliPanGestureRecognizerNewParametersSuccess(void)
345 {
346   TestApplication application;
347
348   PanGestureDetector detector = PanGestureDetector::New();
349
350   detector.SetMaximumTouchesRequired(2);
351   detector.SetMinimumTouchesRequired(2);
352
353   Actor actor = Actor::New();
354   actor.SetSize(100.0f, 100.0f);
355   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
356   Stage::GetCurrent().Add(actor);
357
358   // Render and notify
359   application.SendNotification();
360   application.Render();
361
362   detector.Attach(actor);
363
364   SignalData data;
365   GestureReceivedFunctor functor(data);
366   detector.DetectedSignal().Connect(&application, functor);
367
368   application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, Vector2( 20.0f, 50.0f ), PointState::DOWN, Vector2( 20.0f, 40.0f ), 150 ) );
369   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 40.0f, 50.0f ), PointState::MOTION, Vector2( 40.0f, 40.0f ), 151 ) );
370   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 50.0f, 50.0f ), PointState::MOTION, Vector2( 50.0f, 40.0f ), 152 ) );
371
372   application.SendNotification();
373
374   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
375
376   END_TEST;
377 }
378
379 int UtcDaliPanGestureRecognizerNewParametersEndFewerTouches01(void)
380 {
381   TestApplication application;
382
383   PanGestureDetector detector = PanGestureDetector::New();
384
385   detector.SetMaximumTouchesRequired(2);
386   detector.SetMinimumTouchesRequired(2);
387
388   Actor actor = Actor::New();
389   actor.SetSize(100.0f, 100.0f);
390   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
391   Stage::GetCurrent().Add(actor);
392
393   // Render and notify
394   application.SendNotification();
395   application.Render();
396
397   detector.Attach(actor);
398
399   SignalData data;
400   GestureReceivedFunctor functor(data);
401   detector.DetectedSignal().Connect(&application, functor);
402
403   application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, Vector2( 20.0f, 50.0f ), PointState::DOWN, Vector2( 20.0f, 40.0f ), 150 ) );
404   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 40.0f, 50.0f ), PointState::MOTION, Vector2( 40.0f, 40.0f ), 151 ) );
405   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 50.0f, 50.0f ), PointState::MOTION, Vector2( 50.0f, 40.0f ), 152 ) );
406   application.ProcessEvent( GenerateSingleTouch( PointState::STATIONARY, Vector2( 50.0f, 50.0f ), 153 ) );
407
408   application.SendNotification();
409
410   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
411
412   END_TEST;
413 }
414
415 int UtcDaliPanGestureRecognizerNewParametersEndFewerTouches02(void)
416 {
417   TestApplication application;
418
419   PanGestureDetector detector = PanGestureDetector::New();
420
421   detector.SetMaximumTouchesRequired(2);
422   detector.SetMinimumTouchesRequired(2);
423
424   Actor actor = Actor::New();
425   actor.SetSize(100.0f, 100.0f);
426   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
427   Stage::GetCurrent().Add(actor);
428
429   // Render and notify
430   application.SendNotification();
431   application.Render();
432
433   detector.Attach(actor);
434
435   SignalData data;
436   GestureReceivedFunctor functor(data);
437   detector.DetectedSignal().Connect(&application, functor);
438
439   application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, Vector2( 20.0f, 50.0f ), PointState::DOWN, Vector2( 20.0f, 40.0f ), 150 ) );
440   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 40.0f, 50.0f ), PointState::MOTION, Vector2( 40.0f, 40.0f ), 151 ) );
441   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 50.0f, 50.0f ), PointState::MOTION, Vector2( 50.0f, 40.0f ), 152 ) );
442   application.ProcessEvent( GenerateDoubleTouch( PointState::STATIONARY, Vector2( 50.0f, 50.0f ), PointState::UP, Vector2( 50.0f, 40.0f ), 153 ) );
443
444   application.SendNotification();
445
446   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
447
448   END_TEST;
449 }
450
451 int UtcDaliPanGestureRecognizerNewParametersNoStart(void)
452 {
453   TestApplication application;
454
455   PanGestureDetector detector = PanGestureDetector::New();
456
457   detector.SetMaximumTouchesRequired(2);
458   detector.SetMinimumTouchesRequired(2);
459
460   Actor actor = Actor::New();
461   actor.SetSize(100.0f, 100.0f);
462   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
463   Stage::GetCurrent().Add(actor);
464
465   // Render and notify
466   application.SendNotification();
467   application.Render();
468
469   detector.Attach(actor);
470
471   SignalData data;
472   GestureReceivedFunctor functor(data);
473   detector.DetectedSignal().Connect(&application, functor);
474
475   application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, Vector2( 20.0f, 50.0f ), PointState::DOWN, Vector2( 20.0f, 40.0f ), 150 ) );
476   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 40.0f, 50.0f ), PointState::MOTION, Vector2( 40.0f, 40.0f ), 151 ) );
477   application.ProcessEvent( GenerateSingleTouch( PointState::UP, Vector2( 50.0f, 50.0f ), 153 ) );
478
479   application.SendNotification();
480
481   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
482
483   END_TEST;
484 }
485
486 int UtcDaliPanGestureRecognizerNewParametersSlowRelease(void)
487 {
488   TestApplication application;
489
490   PanGestureDetector detector = PanGestureDetector::New();
491
492   detector.SetMaximumTouchesRequired(2);
493   detector.SetMinimumTouchesRequired(2);
494
495   Actor actor = Actor::New();
496   actor.SetSize(100.0f, 100.0f);
497   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
498   Stage::GetCurrent().Add(actor);
499
500   // Render and notify
501   application.SendNotification();
502   application.Render();
503
504   detector.Attach(actor);
505
506   SignalData data;
507   GestureReceivedFunctor functor(data);
508   detector.DetectedSignal().Connect(&application, functor);
509
510   application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, Vector2( 20.0f, 50.0f ), PointState::DOWN, Vector2( 20.0f, 40.0f ), 150 ) );
511   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 40.0f, 50.0f ), PointState::MOTION, Vector2( 40.0f, 40.0f ), 151 ) );
512   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 50.0f, 50.0f ), PointState::MOTION, Vector2( 50.0f, 40.0f ), 152 ) );
513   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 60.0f, 50.0f ), PointState::MOTION, Vector2( 60.0f, 40.0f ), 153 ) );
514   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 70.0f, 50.0f ), PointState::MOTION, Vector2( 70.0f, 40.0f ), 154 ) );
515   application.ProcessEvent( GenerateSingleTouch( PointState::UP, Vector2( 70.0f, 50.0f ), 155 ) );
516
517   application.SendNotification();
518
519   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
520
521   END_TEST;
522 }
523
524 int UtcDaliPanGestureRecognizerOtherEvent(void)
525 {
526   TestApplication application;
527
528   PanGestureDetector detector = PanGestureDetector::New();
529
530   Actor actor = Actor::New();
531   actor.SetSize(100.0f, 100.0f);
532   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
533   Stage::GetCurrent().Add(actor);
534
535   // Render and notify
536   application.SendNotification();
537   application.Render();
538
539   detector.Attach(actor);
540
541   SignalData data;
542   GestureReceivedFunctor functor(data);
543   detector.DetectedSignal().Connect(&application, functor);
544
545   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), 150 ) );
546   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 40.0f ), 151 ) );
547   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 60.0f ), 152 ) );
548   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 60.0f ), 153 ) );      // Exercise default case in Started case. Not sure if realistic
549   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 65.0f ), 154 ) );
550
551   application.SendNotification();
552
553   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
554
555   END_TEST;
556 }
557
558 int UtcDaliPanGestureRecognizerSlowMoving(void)
559 {
560   TestApplication application;
561
562   PanGestureDetector detector = PanGestureDetector::New();
563
564   Actor actor = Actor::New();
565   actor.SetSize(100.0f, 100.0f);
566   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
567   Stage::GetCurrent().Add(actor);
568
569   // Render and notify
570   application.SendNotification();
571   application.Render();
572
573   detector.Attach(actor);
574
575   SignalData data;
576   GestureReceivedFunctor functor(data);
577   detector.DetectedSignal().Connect(&application, functor);
578
579   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), 150 ) );
580   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 40.0f ), 251 ) );
581   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 60.0f ), 352 ) );
582   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 70.0f ), 453 ) );
583   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 80.0f ), 554 ) );
584   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 90.0f ), 655 ) );
585
586   application.SendNotification();
587
588   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
589
590   END_TEST;
591 }
592
593 int UtcDaliPanGestureRecognizerNewParamsMinNum(void)
594 {
595   TestApplication application;
596
597   Integration::SetPanGestureMinimumPanEvents(8);
598
599
600   PanGestureDetector detector = PanGestureDetector::New();
601
602   Actor actor = Actor::New();
603   actor.SetSize(100.0f, 100.0f);
604   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
605   Stage::GetCurrent().Add(actor);
606
607   // Render and notify
608   application.SendNotification();
609   application.Render();
610
611   detector.Attach(actor);
612
613   SignalData data;
614   GestureReceivedFunctor functor(data);
615   detector.DetectedSignal().Connect(&application, functor);
616
617   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), 150 ) );
618   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 40.0f ), 251 ) );
619   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 60.0f ), 352 ) );
620   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 70.0f ), 453 ) );
621   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 80.0f ), 554 ) );
622   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 90.0f ), 655 ) );
623
624   application.SendNotification();
625
626   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
627
628   END_TEST;
629 }
630
631 int UtcDaliPanGestureRecognizerNewParamsMinDistance(void)
632 {
633   TestApplication application;
634
635   Integration::SetPanGestureMinimumDistance(100);
636
637   PanGestureDetector detector = PanGestureDetector::New();
638
639   Actor actor = Actor::New();
640   actor.SetSize(100.0f, 100.0f);
641   actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
642   Stage::GetCurrent().Add(actor);
643
644   // Render and notify
645   application.SendNotification();
646   application.Render();
647
648   detector.Attach(actor);
649
650   SignalData data;
651   GestureReceivedFunctor functor(data);
652   detector.DetectedSignal().Connect(&application, functor);
653
654   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), 150 ) );
655   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 40.0f ), 251 ) );
656   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 60.0f ), 352 ) );
657   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 70.0f ), 453 ) );
658   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 80.0f ), 554 ) );
659   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 90.0f ), 655 ) );
660
661   application.SendNotification();
662
663   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
664
665   END_TEST;
666 }