2 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #include <dali/public-api/dali-core.h>
22 #include <dali/integration-api/events/touch-event-integ.h>
23 #include <dali/integration-api/render-task-list-integ.h>
24 #include <dali-test-suite-utils.h>
25 #include <test-touch-utils.h>
29 void utc_dali_pinch_gesture_detector_startup(void)
31 test_return_value = TET_UNDEF;
34 void utc_dali_pinch_gesture_detector_cleanup(void)
36 test_return_value = TET_PASS;
39 ///////////////////////////////////////////////////////////////////////////////
43 // Stores data that is populated in the callback and will be read by the TET cases
47 : functorCalled(false),
48 voidFunctorCalled(false),
49 receivedGesture(Gesture::Started)
54 functorCalled = false;
55 voidFunctorCalled = false;
57 receivedGesture.state = Gesture::Started;
58 receivedGesture.scale = 0.0f;
59 receivedGesture.speed = 0.0f;
60 receivedGesture.screenCenterPoint = Vector2(0.0f, 0.0f);
61 receivedGesture.localCenterPoint = Vector2(0.0f, 0.0f);
67 bool voidFunctorCalled;
68 PinchGesture receivedGesture;
72 // Functor that sets the data when called
73 struct GestureReceivedFunctor
75 GestureReceivedFunctor(SignalData& data) : signalData(data) { }
77 void operator()(Actor actor, const PinchGesture& pinch)
79 signalData.functorCalled = true;
80 signalData.receivedGesture = pinch;
81 signalData.pinchedActor = actor;
86 signalData.voidFunctorCalled = true;
89 SignalData& signalData;
92 // Functor that removes the gestured actor from stage
93 struct UnstageActorFunctor : public GestureReceivedFunctor
95 UnstageActorFunctor( SignalData& data, Gesture::State& stateToUnstage, Integration::Scene scene )
96 : GestureReceivedFunctor( data ),
97 stateToUnstage( stateToUnstage ),
102 void operator()( Actor actor, const PinchGesture& pinch )
104 GestureReceivedFunctor::operator()( actor, pinch );
106 if ( pinch.state == stateToUnstage )
108 scene.Remove( actor );
112 Gesture::State& stateToUnstage;
113 Integration::Scene scene;
116 // Functor for receiving a touch event
117 struct TouchEventFunctor
119 bool operator()(Actor actor, const TouchEvent& touch)
127 ///////////////////////////////////////////////////////////////////////////////
129 int UtcDaliPinchGestureDetectorConstructor(void)
131 TestApplication application;
133 PinchGestureDetector detector;
134 DALI_TEST_CHECK(!detector);
138 int UtcDaliPinchGestureDetectorCopyConstructorP(void)
140 TestApplication application;
142 PinchGestureDetector detector = PinchGestureDetector::New();;
144 PinchGestureDetector copy( detector );
145 DALI_TEST_CHECK( detector );
149 int UtcDaliPinchGestureDetectorAssignmentOperatorP(void)
151 TestApplication application;
153 PinchGestureDetector detector = PinchGestureDetector::New();;
155 PinchGestureDetector assign;
157 DALI_TEST_CHECK( detector );
159 DALI_TEST_CHECK( detector == assign );
163 int UtcDaliPinchGestureDetectorNew(void)
165 TestApplication application;
167 PinchGestureDetector detector = PinchGestureDetector::New();
169 DALI_TEST_CHECK(detector);
171 // Attach an actor and emit a touch event on the actor to ensure complete line coverage
172 Actor actor = Actor::New();
173 actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
174 actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
175 application.GetScene().Add(actor);
178 application.SendNotification();
179 application.Render();
181 detector.Attach(actor);
183 Integration::TouchEvent touchEvent(1);
184 Integration::Point point;
185 point.SetDeviceId( 1 );
186 point.SetState( PointState::DOWN );
187 point.SetScreenPosition( Vector2( 20.0f, 20.0f ) );
188 touchEvent.AddPoint(point);
189 application.ProcessEvent(touchEvent);
191 Integration::Point point2;
192 point.SetDeviceId( 1 );
193 point.SetState( PointState::DOWN );
194 point.SetScreenPosition( Vector2( 20.0f, 20.0f ) );
195 touchEvent.AddPoint(point2);
196 application.ProcessEvent(touchEvent);
200 int UtcDaliPinchGestureDetectorDownCast(void)
202 TestApplication application;
203 tet_infoline("Testing Dali::PinchGestureDetector::DownCast()");
205 PinchGestureDetector detector = PinchGestureDetector::New();
207 BaseHandle object(detector);
209 PinchGestureDetector detector2 = PinchGestureDetector::DownCast(object);
210 DALI_TEST_CHECK(detector2);
212 PinchGestureDetector detector3 = DownCast< PinchGestureDetector >(object);
213 DALI_TEST_CHECK(detector3);
215 BaseHandle unInitializedObject;
216 PinchGestureDetector detector4 = PinchGestureDetector::DownCast(unInitializedObject);
217 DALI_TEST_CHECK(!detector4);
219 PinchGestureDetector detector5 = DownCast< PinchGestureDetector >(unInitializedObject);
220 DALI_TEST_CHECK(!detector5);
222 GestureDetector detector6 = PinchGestureDetector::New();
223 PinchGestureDetector detector7 = PinchGestureDetector::DownCast(detector6);
224 DALI_TEST_CHECK(detector7);
228 // Negative test case for a method
229 int UtcDaliPinchGestureSignalReceptionNegative(void)
231 TestApplication application;
233 Actor actor = Actor::New();
234 actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
235 actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
236 application.GetScene().Add(actor);
239 application.SendNotification();
240 application.Render();
243 GestureReceivedFunctor functor(data);
245 PinchGestureDetector detector = PinchGestureDetector::New();
246 detector.Attach(actor);
247 detector.DetectedSignal().Connect(&application, functor);
249 // Do a pinch outside actor's area
250 TestStartPinch( application, Vector2( 112.0f, 62.0f ), Vector2( 112.0f, 162.0f ),
251 Vector2( 112.0f, 100.0f ), Vector2( 112.0f, 124.0f ), 100 );
253 DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
255 // Continue pinch into actor's area - we should still not receive the signal
257 TestContinuePinch( application, Vector2( 112.0f, 100.0f ), Vector2( 112.0f, 124.0f ),
258 Vector2( 5.0f, 5.0f ), Vector2( 35.0f, 35.0f ), 200 );
260 DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
262 // Stop pinching - we should still not receive the signal
264 TestEndPinch( application, Vector2( 6.0f, 6.0f ), Vector2( 18.0f, 18.0f ),
265 Vector2( 10.0f, 8.0f ), Vector2( 14.0f, 16.0f ), 300 );
267 DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
271 int UtcDaliPinchGestureSignalReceptionDownMotionLeave(void)
273 TestApplication application;
275 Actor actor = Actor::New();
276 actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
277 actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
278 application.GetScene().Add(actor);
281 application.SendNotification();
282 application.Render();
285 GestureReceivedFunctor functor(data);
287 PinchGestureDetector detector = PinchGestureDetector::New();
288 detector.Attach(actor);
289 detector.DetectedSignal().Connect(&application, functor);
291 // Start pan within the actor's area
292 TestStartPinch( application, Vector2( 5.0f, 20.0f ), Vector2( 35.0f, 20.0f ),
293 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
294 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
295 DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
296 DALI_TEST_EQUALS(0.666f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
297 DALI_TEST_EQUALS(66.666f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
298 DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
300 // Continue the pan within the actor's area - we should still receive the signal
302 TestContinuePinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
303 Vector2( 17.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 400 );
304 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
305 DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
306 DALI_TEST_EQUALS(0.2666f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
307 DALI_TEST_EQUALS(80.0f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
308 DALI_TEST_EQUALS(Vector2(21.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
310 // Pan Gesture leaves actor's area - we should still receive the signal
312 TestContinuePinch( application, Vector2( 17.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
313 Vector2( 300.0f, 10.0f ), Vector2( 340.0f, 10.0f ), 1000 );
314 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
315 DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
316 DALI_TEST_EQUALS(1.333f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
317 DALI_TEST_EQUALS(213.333f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
318 DALI_TEST_EQUALS(Vector2(320.0f, 10.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
320 // Gesture ends - we would receive a finished state
322 TestEndPinch( application, Vector2( 300.0f, 10.0f ), Vector2( 340.0f, 10.0f ),
323 Vector2( 305.0f, 10.0f ), Vector2( 315.0f, 10.0f ), 1500);
324 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
325 DALI_TEST_EQUALS(Gesture::Finished, data.receivedGesture.state, TEST_LOCATION);
326 DALI_TEST_EQUALS(0.333f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
327 DALI_TEST_EQUALS(600.0f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
328 DALI_TEST_EQUALS(Vector2(310.0f, 10.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
332 int UtcDaliPinchGestureSignalReceptionDownMotionUp(void)
334 TestApplication application;
336 Actor actor = Actor::New();
337 actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
338 actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
339 application.GetScene().Add(actor);
342 application.SendNotification();
343 application.Render();
346 GestureReceivedFunctor functor(data);
348 PinchGestureDetector detector = PinchGestureDetector::New();
349 detector.Attach(actor);
350 detector.DetectedSignal().Connect(&application, functor);
352 // Start pinch within the actor's area
353 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
354 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
355 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
356 DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
357 DALI_TEST_EQUALS(0.555f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
358 DALI_TEST_EQUALS(106.667f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
359 DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
361 // Continue the pinch within the actor's area - we should still receive the signal
363 TestContinuePinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
364 Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 500 );
365 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
366 DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
367 DALI_TEST_EQUALS(0.277f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
368 DALI_TEST_EQUALS(66.666f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
369 DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
371 // Gesture ends within actor's area - we would receive a finished state
373 TestEndPinch( application, Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
374 Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 1000);
375 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
376 DALI_TEST_EQUALS(Gesture::Finished, data.receivedGesture.state, TEST_LOCATION);
377 DALI_TEST_EQUALS(0.055f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
378 DALI_TEST_EQUALS(160.0f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
379 DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
383 int UtcDaliPinchGestureSignalReceptionDetach(void)
385 TestApplication application;
387 Actor actor = Actor::New();
388 actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
389 actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
390 application.GetScene().Add(actor);
393 application.SendNotification();
394 application.Render();
397 GestureReceivedFunctor functor(data);
399 PinchGestureDetector detector = PinchGestureDetector::New();
400 detector.Attach(actor);
401 detector.DetectedSignal().Connect(&application, functor);
403 // Start pinch within the actor's area
404 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
405 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
406 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
407 DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
410 // Continue the pinch within the actor's area - we should still receive the signal
412 TestContinuePinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
413 Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 500 );
414 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
415 DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
417 // Gesture ends within actor's area
419 TestEndPinch( application, Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
420 Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 1000);
421 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
422 DALI_TEST_EQUALS(Gesture::Finished, data.receivedGesture.state, TEST_LOCATION);
425 detector.DetachAll();
427 // Ensure we are no longer signalled
429 TestGeneratePinch( application );
430 DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
434 int UtcDaliPinchGestureSignalReceptionDetachWhilePinching(void)
436 TestApplication application;
438 Actor actor = Actor::New();
439 actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
440 actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
441 application.GetScene().Add(actor);
444 application.SendNotification();
445 application.Render();
448 GestureReceivedFunctor functor(data);
450 PinchGestureDetector detector = PinchGestureDetector::New();
451 detector.Attach(actor);
452 detector.DetectedSignal().Connect(&application, functor);
454 // Start pinch within the actor's area
455 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
456 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
457 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
458 DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
460 // Continue the pinch within the actor's area - we should still receive the signal
462 TestContinuePinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
463 Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 500 );
464 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
465 DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
467 // Detach actor during the pinch, we should not receive the next event
468 detector.DetachAll();
470 // Gesture ends within actor's area
472 TestEndPinch( application, Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
473 Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 1000);
474 DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
478 int UtcDaliPinchGestureSignalReceptionActorDestroyedWhilePinching(void)
480 TestApplication application;
483 GestureReceivedFunctor functor(data);
485 PinchGestureDetector detector = PinchGestureDetector::New();
486 detector.DetectedSignal().Connect(&application, functor);
488 // Attach a temporary actor to stop detector being removed from PinchGestureProcessor when main actor
490 Actor tempActor = Actor::New();
491 tempActor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
492 tempActor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT);
493 application.GetScene().Add(tempActor);
494 detector.Attach(tempActor);
496 // Actor lifetime is scoped
498 Actor actor = Actor::New();
499 actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
500 actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
501 application.GetScene().Add(actor);
504 application.SendNotification();
505 application.Render();
507 detector.Attach(actor);
509 // Start pinch within the actor's area
510 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
511 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
512 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
513 DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
515 // Continue the pinch within the actor's area - we should still receive the signal
517 TestContinuePinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
518 Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 500 );
519 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
520 DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
522 // Remove the actor from stage and reset the data
523 application.GetScene().Remove(actor);
526 application.SendNotification();
527 application.Render();
530 // Actor should now have been destroyed
532 // Gesture ends within the area where the actor used to be
534 TestEndPinch( application, Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
535 Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 1000);
536 DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
540 int UtcDaliPinchGestureSignalReceptionRotatedActor(void)
542 TestApplication application;
544 Actor actor = Actor::New();
545 actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
546 actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
547 application.GetScene().Add(actor);
549 // Render and notify a couple of times
550 application.SendNotification();
551 application.Render();
554 GestureReceivedFunctor functor(data);
556 PinchGestureDetector detector = PinchGestureDetector::New();
557 detector.Attach(actor);
558 detector.DetectedSignal().Connect(&application, functor);
560 // Do an entire pinch, only check finished value
561 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
562 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
564 TestEndPinch( application, Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
565 Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 1000);
566 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
567 DALI_TEST_EQUALS(0.055f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
568 DALI_TEST_EQUALS(160.0f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
569 DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
571 // Rotate actor again and render and notify
572 actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(180.0f), Vector3::ZAXIS) );
573 application.SendNotification();
574 application.Render();
576 // Do an entire pinch, only check finished value
577 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
578 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 2100 );
580 TestEndPinch( application, Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
581 Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 3000);
582 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
583 DALI_TEST_EQUALS(0.055f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
584 DALI_TEST_EQUALS(160.0f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
585 DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
587 // Rotate actor again and render and notify
588 actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(270.0f), Vector3::ZAXIS) );
589 application.SendNotification();
590 application.Render();
592 // Do an entire pinch, only check finished value
593 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
594 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 4100 );
596 TestEndPinch( application, Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
597 Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 5000);
598 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
599 DALI_TEST_EQUALS(0.055f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
600 DALI_TEST_EQUALS(160.0f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
601 DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
605 int UtcDaliPinchGestureSignalReceptionChildHit(void)
607 TestApplication application;
609 Actor parent = Actor::New();
610 parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
611 parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
612 application.GetScene().Add(parent);
614 // Set child to completely cover parent.
615 // Change rotation of child to be different from parent so that we can check if our local coordinate
616 // conversion of the parent actor is correct.
617 Actor child = Actor::New();
618 child.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
619 child.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
620 child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
621 child.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
624 TouchEventFunctor touchFunctor;
625 child.TouchedSignal().Connect(&application, touchFunctor);
628 application.SendNotification();
629 application.Render();
632 GestureReceivedFunctor functor(data);
634 PinchGestureDetector detector = PinchGestureDetector::New();
635 detector.Attach(parent);
636 detector.DetectedSignal().Connect(&application, functor);
638 // Do an entire pan, only check finished value - hits child area but parent should still receive it
639 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
640 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
642 TestEndPinch( application, Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
643 Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 1000);
644 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
645 DALI_TEST_EQUALS(true, parent == data.pinchedActor, TEST_LOCATION);
646 DALI_TEST_EQUALS(0.055f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
647 DALI_TEST_EQUALS(160.0f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
648 DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
650 // Attach child and generate same touch points to yield same results
651 // (Also proves that you can detach and then re-attach another actor)
652 detector.Attach(child);
653 detector.Detach(parent);
655 // Do an entire pan, only check finished value
656 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
657 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 2100 );
659 TestEndPinch( application, Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
660 Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 3000);
661 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
662 DALI_TEST_EQUALS(true, child == data.pinchedActor, TEST_LOCATION);
663 DALI_TEST_EQUALS(0.055f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
664 DALI_TEST_EQUALS(160.0f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
665 DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
669 int UtcDaliPinchGestureSignalReceptionAttachDetachMany(void)
671 TestApplication application;
673 Actor first = Actor::New();
674 first.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
675 first.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
676 application.GetScene().Add(first);
678 Actor second = Actor::New();
679 second.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
680 second.SetProperty( Actor::Property::POSITION_X, 100.0f);
681 second.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
682 application.GetScene().Add(second);
685 application.SendNotification();
686 application.Render();
689 GestureReceivedFunctor functor(data);
691 PinchGestureDetector detector = PinchGestureDetector::New();
692 detector.Attach(first);
693 detector.Attach(second);
694 detector.DetectedSignal().Connect(&application, functor);
696 // Start pinch within second actor's area
697 TestStartPinch( application, Vector2( 102.0f, 20.0f ), Vector2( 138.0f, 20.0f ),
698 Vector2( 110.0f, 20.0f ), Vector2( 130.0f, 20.0f ), 100 );
699 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
700 DALI_TEST_EQUALS(true, second == data.pinchedActor, TEST_LOCATION);
702 // Pinch moves into first actor's area - second actor should receive the pinch
704 TestContinuePinch( application, Vector2( 110.0f, 20.0f ), Vector2( 130.0f, 20.0f ),
705 Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 500 );
706 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
707 DALI_TEST_EQUALS(true, second == data.pinchedActor, TEST_LOCATION);
709 // Detach the second actor during the pinch, we should not receive the next event
710 detector.Detach(second);
712 // Gesture ends within actor's area
714 TestEndPinch( application, Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
715 Vector2( 119.0f, 20.0f ), Vector2( 121.0f, 20.0f ), 3000);
716 DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
720 int UtcDaliPinchGestureSignalReceptionActorBecomesUntouchable(void)
722 TestApplication application;
724 Actor actor = Actor::New();
725 actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
726 actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
727 application.GetScene().Add(actor);
730 application.SendNotification();
731 application.Render();
734 GestureReceivedFunctor functor(data);
736 PinchGestureDetector detector = PinchGestureDetector::New();
737 detector.Attach(actor);
738 detector.DetectedSignal().Connect(&application, functor);
740 // Start pinch in actor's area
741 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
742 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
743 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
745 // Pan continues within actor's area
747 TestContinuePinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
748 Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 500 );
749 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
751 // Actor become invisible - actor should not receive the next pinch
752 actor.SetProperty( Actor::Property::VISIBLE,false);
755 application.SendNotification();
756 application.Render();
758 // Gesture ends within actor's area
760 TestEndPinch( application, Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
761 Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 3000);
762 DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
766 int UtcDaliPinchGestureSignalReceptionMultipleDetectorsOnActor(void)
768 TestApplication application;
770 Actor actor = Actor::New();
771 actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
772 actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
773 application.GetScene().Add(actor);
775 Actor actor2 = Actor::New();
776 actor2.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
777 actor2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT);
778 application.GetScene().Add(actor2);
781 application.SendNotification();
782 application.Render();
784 // Attach actor to one detector
785 SignalData firstData;
786 GestureReceivedFunctor firstFunctor(firstData);
787 PinchGestureDetector firstDetector = PinchGestureDetector::New();
788 firstDetector.Attach(actor);
789 firstDetector.DetectedSignal().Connect(&application, firstFunctor);
791 // Attach actor to another detector
792 SignalData secondData;
793 GestureReceivedFunctor secondFunctor(secondData);
794 PinchGestureDetector secondDetector = PinchGestureDetector::New();
795 secondDetector.Attach(actor);
796 secondDetector.DetectedSignal().Connect(&application, secondFunctor);
798 // Add second actor to second detector, when we remove the actor, this will make sure that this
799 // gesture detector is not removed from the GestureDetectorProcessor. In this scenario, the
800 // functor should still not be called (which is what we're also testing).
801 secondDetector.Attach(actor2);
803 // Pinch in actor's area - both detector's functors should be called
804 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
805 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
806 DALI_TEST_EQUALS(true, firstData.functorCalled, TEST_LOCATION);
807 DALI_TEST_EQUALS(true, secondData.functorCalled, TEST_LOCATION);
809 // Pinch continues in actor's area - both detector's functors should be called
812 TestContinuePinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
813 Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 500 );
814 DALI_TEST_EQUALS(true, firstData.functorCalled, TEST_LOCATION);
815 DALI_TEST_EQUALS(true, secondData.functorCalled, TEST_LOCATION);
817 // Detach actor from firstDetector and emit pinch on actor, only secondDetector's functor should be called.
818 firstDetector.Detach(actor);
821 TestEndPinch( application, Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
822 Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 1000);
823 DALI_TEST_EQUALS(false, firstData.functorCalled, TEST_LOCATION);
824 DALI_TEST_EQUALS(true, secondData.functorCalled, TEST_LOCATION);
826 // New pinch on actor, only secondDetector has actor attached
829 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
830 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 1500 );
831 DALI_TEST_EQUALS(false, firstData.functorCalled, TEST_LOCATION);
832 DALI_TEST_EQUALS(true, secondData.functorCalled, TEST_LOCATION);
834 // Detach actor from secondDetector
835 secondDetector.Detach(actor);
838 TestContinuePinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
839 Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 2000 );
840 DALI_TEST_EQUALS(false, firstData.functorCalled, TEST_LOCATION);
841 DALI_TEST_EQUALS(false, secondData.functorCalled, TEST_LOCATION);
845 int UtcDaliPinchGestureSignalReceptionEnsureCorrectSignalling(void)
847 TestApplication application;
849 Actor actor1 = Actor::New();
850 actor1.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
851 actor1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
852 application.GetScene().Add(actor1);
854 GestureReceivedFunctor functor1(data1);
855 PinchGestureDetector detector1 = PinchGestureDetector::New();
856 detector1.Attach(actor1);
857 detector1.DetectedSignal().Connect(&application, functor1);
859 Actor actor2 = Actor::New();
860 actor2.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
861 actor2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT);
862 actor2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::BOTTOM_RIGHT);
863 application.GetScene().Add(actor2);
865 GestureReceivedFunctor functor2(data2);
866 PinchGestureDetector detector2 = PinchGestureDetector::New();
867 detector2.Attach(actor2);
868 detector2.DetectedSignal().Connect(&application, functor2);
871 application.SendNotification();
872 application.Render();
874 // Start pan in actor1's area, only data1 should be set
875 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
876 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
877 DALI_TEST_EQUALS(true, data1.functorCalled, TEST_LOCATION);
878 DALI_TEST_EQUALS(false, data2.functorCalled, TEST_LOCATION);
882 int UtcDaliPinchGestureActorUnstaged(void)
884 TestApplication application;
886 Actor actor = Actor::New();
887 actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
888 actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
889 application.GetScene().Add(actor);
892 application.SendNotification();
893 application.Render();
895 // State to remove actor in.
896 Gesture::State stateToUnstage( Gesture::Started );
898 // Attach actor to detector
900 UnstageActorFunctor functor( data, stateToUnstage, application.GetScene() );
901 PinchGestureDetector detector = PinchGestureDetector::New();
902 detector.Attach(actor);
903 detector.DetectedSignal().Connect( &application, functor );
906 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
907 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
908 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
910 TestEndPinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
911 Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 1000);
912 DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
916 application.SendNotification();
917 application.Render();
919 // Re-add actor to stage
920 application.GetScene().Add(actor);
923 application.SendNotification();
924 application.Render();
926 // Change state to Gesture::Continuing to remove
927 stateToUnstage = Gesture::Continuing;
930 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
931 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
932 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
934 TestContinuePinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
935 Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 500 );
936 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
938 TestEndPinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
939 Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 1000);
940 DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
944 application.SendNotification();
945 application.Render();
947 // Re-add actor to stage
948 application.GetScene().Add(actor);
951 application.SendNotification();
952 application.Render();
954 // Change state to Gesture::Continuing to remove
955 stateToUnstage = Gesture::Finished;
958 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
959 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
960 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
962 TestContinuePinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
963 Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 500 );
964 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
966 TestEndPinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
967 Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 1000);
968 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
969 tet_result( TET_PASS ); // If we get here then we have handled actor stage removal gracefully.
973 int UtcDaliPinchGestureActorStagedAndDestroyed(void)
975 TestApplication application;
977 Actor actor = Actor::New();
978 actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
979 actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
980 application.GetScene().Add(actor);
982 // Create and add a second actor so that GestureDetector destruction does not come into play.
983 Actor dummyActor( Actor::New() );
984 dummyActor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
985 dummyActor.SetProperty( Actor::Property::POSITION, Vector2( 100.0f, 100.0f ));
986 dummyActor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
987 application.GetScene().Add(dummyActor);
990 application.SendNotification();
991 application.Render();
993 // State to remove actor in.
994 Gesture::State stateToUnstage( Gesture::Started );
996 // Attach actor to detector
998 UnstageActorFunctor functor( data, stateToUnstage, application.GetScene() );
999 PinchGestureDetector detector = PinchGestureDetector::New();
1000 detector.Attach(actor);
1001 detector.Attach(dummyActor);
1002 detector.DetectedSignal().Connect( &application, functor );
1004 // Here we are testing a Started actor which is removed in the Started callback, but then added back
1005 // before we get a continuing state. As we were removed from the stage, even if we're at the same
1006 // position, we should still not be signalled.
1009 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
1010 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
1011 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
1014 // Render and notify
1015 application.SendNotification();
1016 application.Render();
1018 // Re add to the stage, we should not be signalled
1019 application.GetScene().Add(actor);
1021 // Render and notify
1022 application.SendNotification();
1023 application.Render();
1025 // Continue signal emission
1026 TestContinuePinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
1027 Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 500 );
1028 DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
1030 TestEndPinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
1031 Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 1000);
1032 DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
1035 // Here we delete an actor in started, we should not receive any subsequent signalling.
1038 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
1039 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 1500 );
1040 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
1043 // Render and notify
1044 application.SendNotification();
1045 application.Render();
1047 // Delete actor as well
1050 // Render and notify
1051 application.SendNotification();
1052 application.Render();
1054 // Continue signal emission
1055 TestContinuePinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
1056 Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 2000 );
1057 DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
1059 TestEndPinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
1060 Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 3000);
1061 DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
1065 int UtcDaliPinchGestureLayerConsumesTouch(void)
1067 TestApplication application;
1069 Actor actor = Actor::New();
1070 actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
1071 actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
1072 application.GetScene().Add(actor);
1076 GestureReceivedFunctor functor(data);
1077 PinchGestureDetector detector = PinchGestureDetector::New();
1078 detector.Attach(actor);
1079 detector.DetectedSignal().Connect( &application, functor );
1081 // Add a layer to overlap the actor
1082 Layer layer = Layer::New();
1083 layer.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
1084 layer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
1085 application.GetScene().Add( layer );
1088 // Render and notify
1089 application.SendNotification();
1090 application.Render();
1092 // Emit signals, should receive
1093 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
1094 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
1095 TestEndPinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
1096 Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 1000);
1097 DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
1100 // Set layer to consume all touch
1101 layer.SetProperty( Layer::Property::CONSUMES_TOUCH, true );
1103 // Render and notify
1104 application.SendNotification();
1105 application.Render();
1107 // Emit the same signals again, should not receive
1108 TestStartPinch( application, Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
1109 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 1500 );
1110 TestEndPinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
1111 Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 2000);
1112 DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);