2 * Copyright (c) 2019 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/integration-api/scene.h>
22 #include <dali/integration-api/events/key-event-integ.h>
23 #include <dali/public-api/events/key-event.h>
24 #include <dali/integration-api/events/touch-event-integ.h>
25 #include <dali/integration-api/events/wheel-event-integ.h>
27 #include <dali-test-suite-utils.h>
28 #include <mesh-builder.h>
30 // Internal headers are allowed here
35 const std::string DEFAULT_DEVICE_NAME("hwKeyboard");
37 // Functor for EventProcessingFinished signal
38 struct EventProcessingFinishedFunctor
41 * @param[in] eventProcessingFinished reference to a boolean variable used to check if signal has been called.
43 EventProcessingFinishedFunctor( bool& eventProcessingFinished )
44 : mEventProcessingFinished( eventProcessingFinished )
49 mEventProcessingFinished = true;
52 bool& mEventProcessingFinished;
55 // Stores data that is populated in the key-event callback and will be read by the TET cases
56 struct KeyEventSignalData
59 : functorCalled(false)
64 functorCalled = false;
66 receivedKeyEvent.keyModifier = 0;
67 receivedKeyEvent.keyPressedName.clear();
68 receivedKeyEvent.keyPressed.clear();
72 KeyEvent receivedKeyEvent;
75 // Functor that sets the data when called
76 struct KeyEventReceivedFunctor
78 KeyEventReceivedFunctor( KeyEventSignalData& data ) : signalData( data ) { }
80 bool operator()( const KeyEvent& keyEvent )
82 signalData.functorCalled = true;
83 signalData.receivedKeyEvent = keyEvent;
88 KeyEventSignalData& signalData;
91 // Stores data that is populated in the touched signal callback and will be read by the TET cases
92 struct TouchedSignalData
95 : functorCalled(false),
96 createNewScene(false),
97 newSceneCreated(false)
102 functorCalled = false;
103 createNewScene = false;
104 newSceneCreated = false;
106 receivedTouchEvent.points.clear();
107 receivedTouchEvent.time = 0;
109 receivedTouchData.Reset();
114 bool newSceneCreated;
115 TouchEvent receivedTouchEvent;
116 TouchData receivedTouchData;
119 // Functor that sets the data when touched signal is received
120 struct TouchedFunctor
122 TouchedFunctor( TouchedSignalData& data ) : signalData( data ) { }
124 void operator()( const TouchEvent& touch )
126 signalData.functorCalled = true;
127 signalData.receivedTouchEvent = touch;
130 TouchedSignalData& signalData;
133 // Functor that sets the data when touched signal is received
136 TouchFunctor( TouchedSignalData& data ) : signalData( data ) { }
138 void operator()( const TouchData& touch )
140 signalData.functorCalled = true;
141 signalData.receivedTouchData = touch;
143 if ( signalData.createNewScene )
145 TestRenderSurface* surface = new TestRenderSurface( PositionSize( 0.0f, 0.0f, 480.0f, 800.0f ) ); // This is a leak, but we need to keep the surface alive till the end
146 Dali::Integration::Scene scene = Dali::Integration::Scene::New( *surface );
147 DALI_TEST_CHECK( scene );
149 signalData.newSceneCreated = true;
155 signalData.functorCalled = true;
158 TouchedSignalData& signalData;
161 // Stores data that is populated in the wheel-event callback and will be read by the TET cases
162 struct WheelEventSignalData
164 WheelEventSignalData()
165 : functorCalled(false)
170 functorCalled = false;
174 WheelEvent receivedWheelEvent;
177 // Functor that sets the data when wheel-event signal is received
178 struct WheelEventReceivedFunctor
180 WheelEventReceivedFunctor( WheelEventSignalData& data ) : signalData( data ) { }
182 bool operator()( const WheelEvent& wheelEvent )
184 signalData.functorCalled = true;
185 signalData.receivedWheelEvent = wheelEvent;
190 WheelEventSignalData& signalData;
193 // Stores data that is populated in the KeyEventGeneratedSignal callback and will be read by the TET cases
194 struct KeyEventGeneratedSignalData
196 KeyEventGeneratedSignalData()
197 : functorCalled(false)
202 functorCalled = false;
204 receivedKeyEvent.keyModifier = 0;
205 receivedKeyEvent.keyPressedName.clear();
206 receivedKeyEvent.keyPressed.clear();
210 KeyEvent receivedKeyEvent;
213 // Functor that sets the data when called
214 struct KeyEventGeneratedReceivedFunctor
216 KeyEventGeneratedReceivedFunctor( KeyEventGeneratedSignalData& data )
220 bool operator()( const KeyEvent& keyEvent )
222 signalData.functorCalled = true;
223 signalData.receivedKeyEvent = keyEvent;
230 signalData.functorCalled = true;
234 KeyEventGeneratedSignalData& signalData;
237 void GenerateTouch( TestApplication& application, PointState::Type state, const Vector2& screenPosition )
239 Integration::TouchEvent touchEvent;
240 Integration::Point point;
241 point.SetState( state );
242 point.SetScreenPosition( screenPosition );
243 touchEvent.points.push_back( point );
244 application.ProcessEvent( touchEvent );
247 bool DummyTouchCallback( Actor actor, const TouchEvent& touch )
252 } // unnamed namespace
254 int UtcDaliSceneAdd(void)
256 TestApplication application;
257 tet_infoline("Testing Dali::Integration::Scene::Add");
259 Dali::Integration::Scene scene = application.GetScene();
261 Actor actor = Actor::New();
262 DALI_TEST_CHECK( !actor.OnStage() );
265 DALI_TEST_CHECK( actor.OnStage() );
270 int UtcDaliSceneRemove(void)
272 TestApplication application;
273 tet_infoline("Testing Dali::Integration::Scene::Remove");
275 Dali::Integration::Scene scene = application.GetScene();
277 Actor actor = Actor::New();
278 DALI_TEST_CHECK( !actor.OnStage() );
281 DALI_TEST_CHECK( actor.OnStage() );
284 DALI_TEST_CHECK( !actor.OnStage() );
289 int UtcDaliSceneGetSize(void)
291 TestApplication application;
292 tet_infoline("Testing Dali::Integration::Scene::GetSize");
294 Dali::Integration::Scene scene = application.GetScene();
295 Size size = scene.GetSize();
296 DALI_TEST_EQUALS( TestApplication::DEFAULT_SURFACE_WIDTH, size.width, TEST_LOCATION );
297 DALI_TEST_EQUALS( TestApplication::DEFAULT_SURFACE_HEIGHT, size.height, TEST_LOCATION );
302 int UtcDaliSceneGetDpi(void)
304 TestApplication application; // Initializes core DPI to default values
306 // Test that setting core DPI explicitly also sets up the scene's DPI.
307 Dali::Integration::Scene scene = application.GetScene();
308 scene.SetDpi( Vector2(200.0f, 180.0f) );
309 Vector2 dpi = scene.GetDpi();
310 DALI_TEST_EQUALS( dpi.x, 200.0f, TEST_LOCATION );
311 DALI_TEST_EQUALS( dpi.y, 180.0f, TEST_LOCATION );
315 int UtcDaliSceneGetRenderTaskList(void)
317 TestApplication application;
318 tet_infoline("Testing Dali::Integration::Scene::GetRenderTaskList");
320 Dali::Integration::Scene scene = application.GetScene();
322 // Check we get a valid instance.
323 const RenderTaskList& tasks = scene.GetRenderTaskList();
325 // There should be 1 task by default.
326 DALI_TEST_EQUALS( tasks.GetTaskCount(), 1u, TEST_LOCATION );
328 // RenderTaskList has it's own UTC tests.
329 // But we can confirm that GetRenderTaskList in Stage retrieves the same RenderTaskList each time.
330 RenderTask newTask = scene.GetRenderTaskList().CreateTask();
332 DALI_TEST_EQUALS( scene.GetRenderTaskList().GetTask( 1 ), newTask, TEST_LOCATION );
337 int UtcDaliSceneGetRootLayer(void)
339 TestApplication application;
340 tet_infoline("Testing Dali::Integration::Scene::GetRootLayer");
342 Dali::Integration::Scene scene = application.GetScene();
343 Layer layer = scene.GetLayer( 0 );
344 DALI_TEST_CHECK( layer );
346 // Check that GetRootLayer() correctly retreived layer 0.
347 DALI_TEST_CHECK( scene.GetRootLayer() == layer );
352 int UtcDaliSceneGetLayerCount(void)
354 TestApplication application;
355 tet_infoline("Testing Dali::Integration::Scene::GetLayerCount");
357 Dali::Integration::Scene scene = application.GetScene();
358 // Initially we have a default layer
359 DALI_TEST_EQUALS( scene.GetLayerCount(), 1u, TEST_LOCATION );
361 Layer layer = Layer::New();
364 DALI_TEST_EQUALS( scene.GetLayerCount(), 2u, TEST_LOCATION );
368 int UtcDaliSceneGetLayer(void)
370 TestApplication application;
371 tet_infoline("Testing Dali::Integration::Scene::GetLayer");
373 Dali::Integration::Scene scene = application.GetScene();
375 Layer rootLayer = scene.GetLayer( 0 );
376 DALI_TEST_CHECK( rootLayer );
378 Layer layer = Layer::New();
381 Layer sameLayer = scene.GetLayer( 1 );
382 DALI_TEST_CHECK( layer == sameLayer );
387 int UtcDaliSceneGet(void)
389 TestApplication application;
390 tet_infoline("Testing Dali::Integration::Scene::Get");
392 Dali::Integration::Scene scene = application.GetScene();
394 Actor actor = Actor::New();
395 DALI_TEST_CHECK( Dali::Integration::Scene() == Dali::Integration::Scene::Get( actor ) );
399 DALI_TEST_CHECK( scene == Dali::Integration::Scene::Get( actor ) );
404 int UtcDaliSceneDiscard(void)
406 TestApplication application;
407 tet_infoline("Testing Dali::Scene::Discard");
409 // Create a new Scene
410 TestRenderSurface surface( PositionSize( 0.0f, 0.0f, 480.0f, 800.0f ) );
411 Dali::Integration::Scene scene = Dali::Integration::Scene::New( surface );
412 DALI_TEST_CHECK( scene );
414 // One reference of scene kept here and the other one kept in the Core
415 DALI_TEST_CHECK( scene.GetBaseObject().ReferenceCount() == 2 );
417 // Render and notify.
418 application.SendNotification();
419 application.Render(0);
421 // Keep the reference of the root layer handle so it will still be alive after the scene is deleted
422 Layer rootLayer = scene.GetRootLayer();
423 DALI_TEST_CHECK( rootLayer );
424 DALI_TEST_CHECK( rootLayer.GetBaseObject().ReferenceCount() == 2 );
426 // Request to discard the scene from the Core
428 DALI_TEST_CHECK( scene.GetBaseObject().ReferenceCount() == 1 );
430 // Reset the scene handle
433 // Render and notify.
434 application.SendNotification();
435 application.Render(0);
437 // At this point, the scene should have been automatically deleted
438 // To prove this, the ref count of the root layer handle should be decremented to 1
439 DALI_TEST_CHECK( rootLayer.GetBaseObject().ReferenceCount() == 1 );
441 // Delete the root layer handle
444 // Render and notify.
445 application.SendNotification();
446 application.Render(0);
451 int UtcDaliSceneCreateNewSceneDuringCoreEventProcessing(void)
453 TestApplication application;
455 Dali::Integration::Scene scene = application.GetScene();
457 TouchedSignalData data;
458 data.createNewScene = true;
459 TouchFunctor functor( data );
460 scene.TouchSignal().Connect( &application, functor );
462 // Render and notify.
463 application.SendNotification();
464 application.Render();
466 GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) );
468 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
469 DALI_TEST_EQUALS( true, data.createNewScene, TEST_LOCATION );
470 DALI_TEST_EQUALS( true, data.newSceneCreated, TEST_LOCATION );
476 int UtcDaliSceneRootLayerAndSceneAlignment(void)
478 TestApplication application;
481 TestRenderSurface surface( PositionSize( 0.0f, 0.0f, 480.0f, 800.0f ) );
482 Dali::Integration::Scene scene = Dali::Integration::Scene::New( surface );
483 DALI_TEST_CHECK( scene );
485 // One reference of scene kept here and the other one kept in the Core
486 DALI_TEST_CHECK( scene.GetBaseObject().ReferenceCount() == 2 );
488 // Add a renderable actor to the scene
489 auto actor = CreateRenderableActor();
492 // Render and notify.
493 application.SendNotification();
494 application.Render(0);
496 // Keep the reference of the root layer handle so it will still be alive after the scene is deleted
497 Layer rootLayer = scene.GetRootLayer();
498 DALI_TEST_CHECK( rootLayer );
499 DALI_TEST_CHECK( rootLayer.GetBaseObject().ReferenceCount() == 2 );
501 // Request to discard the scene from the Core
503 DALI_TEST_CHECK( scene.GetBaseObject().ReferenceCount() == 1 );
505 // Reset the scene handle
508 // Render and notify.
509 application.SendNotification();
510 application.Render(0);
512 // At this point, the scene should have been automatically deleted
513 // To prove this, the ref count of the root layer handle should be decremented to 1
514 DALI_TEST_CHECK( rootLayer.GetBaseObject().ReferenceCount() == 1 );
516 // Create a new Scene while the root layer of the deleted scene is still alive
517 TestRenderSurface surface2( PositionSize( 0.0f, 0.0f, 480.0f, 800.0f ) );
518 Dali::Integration::Scene newScene = Dali::Integration::Scene::New( surface2 );
519 DALI_TEST_CHECK( newScene );
521 // Render and notify.
522 application.SendNotification();
523 application.Render(0);
525 // At this point, we have only one scene but two root layers
526 // The root layer of the deleted scene is still alive
527 DALI_TEST_CHECK( rootLayer.GetBaseObject().ReferenceCount() == 1 );
529 // Delete the root layer of the deleted scene
532 // Render and notify.
533 application.SendNotification();
534 application.Render(0);
539 int UtcDaliSceneDeleteSurface(void)
541 TestApplication application;
543 // Create the render surface for the scene
544 TestRenderSurface* renderSurface = new TestRenderSurface( Dali::PositionSize( 0, 0, 480.0f, 800.0f ) );
547 Dali::Integration::Scene scene = Dali::Integration::Scene::New( *renderSurface );
548 DALI_TEST_CHECK( scene );
550 // Render and notify.
551 application.SendNotification();
552 application.Render(0);
554 // Add a renderable actor to the scene
555 auto actor = CreateRenderableActor();
558 // Render and notify.
559 application.SendNotification();
560 application.Render(0);
562 // Notify the Core that the render surface will be deleted.
563 application.GetCore().SurfaceDeleted( renderSurface );
565 // Delete the render surface
566 delete renderSurface;
567 renderSurface = nullptr;
569 // Render and notify.
570 application.SendNotification();
571 application.Render(0);
576 int UtcDaliSceneEventProcessingFinishedP(void)
578 TestApplication application;
579 Dali::Integration::Scene scene = application.GetScene();
581 bool eventProcessingFinished = false;
582 EventProcessingFinishedFunctor functor( eventProcessingFinished );
583 scene.EventProcessingFinishedSignal().Connect( &application, functor );
585 Actor actor( Actor::New() );
588 application.SendNotification();
589 application.Render();
591 DALI_TEST_CHECK( eventProcessingFinished );
596 int UtcDaliSceneEventProcessingFinishedN(void)
598 TestApplication application;
599 Dali::Integration::Scene scene = application.GetScene();
601 bool eventProcessingFinished = false;
602 EventProcessingFinishedFunctor functor( eventProcessingFinished );
603 scene.EventProcessingFinishedSignal().Connect( &application, functor );
605 Actor actor( Actor::New() );
608 // Do not complete event processing and confirm the signal has not been emitted.
609 DALI_TEST_CHECK( !eventProcessingFinished );
614 int UtcDaliSceneSignalKeyEventP(void)
616 TestApplication application;
617 Dali::Integration::Scene scene = application.GetScene();
619 KeyEventSignalData data;
620 KeyEventReceivedFunctor functor( data );
621 scene.KeyEventSignal().Connect( &application, functor );
623 Integration::KeyEvent event( "i", "", "i", 0, 0, 0, Integration::KeyEvent::Down, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
624 application.ProcessEvent( event );
626 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
627 DALI_TEST_CHECK( event.keyModifier == data.receivedKeyEvent.keyModifier );
628 DALI_TEST_CHECK( event.keyName == data.receivedKeyEvent.keyPressedName );
629 DALI_TEST_CHECK( event.keyString == data.receivedKeyEvent.keyPressed );
630 DALI_TEST_CHECK( event.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
634 Integration::KeyEvent event2( "i", "", "i", 0, 0, 0, Integration::KeyEvent::Up, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
635 application.ProcessEvent( event2 );
637 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
638 DALI_TEST_CHECK( event2.keyModifier == data.receivedKeyEvent.keyModifier );
639 DALI_TEST_CHECK( event2.keyName == data.receivedKeyEvent.keyPressedName );
640 DALI_TEST_CHECK( event2.keyString == data.receivedKeyEvent.keyPressed );
641 DALI_TEST_CHECK( event2.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
645 Integration::KeyEvent event3( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
646 application.ProcessEvent( event3 );
648 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
649 DALI_TEST_CHECK( event3.keyModifier == data.receivedKeyEvent.keyModifier );
650 DALI_TEST_CHECK( event3.keyName == data.receivedKeyEvent.keyPressedName );
651 DALI_TEST_CHECK( event3.keyString == data.receivedKeyEvent.keyPressed );
652 DALI_TEST_CHECK( event3.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
656 Integration::KeyEvent event4( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
657 application.ProcessEvent( event4 );
659 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
660 DALI_TEST_CHECK( event4.keyModifier == data.receivedKeyEvent.keyModifier );
661 DALI_TEST_CHECK( event4.keyName == data.receivedKeyEvent.keyPressedName );
662 DALI_TEST_CHECK( event4.keyString == data.receivedKeyEvent.keyPressed );
663 DALI_TEST_CHECK( event4.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
667 int UtcDaliSceneSignalKeyEventN(void)
669 TestApplication application;
670 Dali::Integration::Scene scene = application.GetScene();
672 KeyEventSignalData data;
673 KeyEventReceivedFunctor functor( data );
674 scene.KeyEventSignal().Connect( &application, functor );
676 // Check that a non-pressed key events data is not modified.
677 DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
682 int UtcDaliSceneTouchSignalP(void)
684 TestApplication application;
685 Dali::Integration::Scene scene = application.GetScene();
687 TouchedSignalData data;
688 TouchFunctor functor( data );
689 scene.TouchSignal().Connect( &application, functor );
691 // Render and notify.
692 application.SendNotification();
693 application.Render();
695 // Basic test: No actors, single touch (down then up).
697 GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) );
699 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
700 DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
701 DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) );
704 GenerateTouch( application, PointState::UP, Vector2( 10.0f, 10.0f ) );
706 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
707 DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
708 DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) );
712 // Add an actor to the scene.
713 Actor actor = Actor::New();
714 actor.SetSize( 100.0f, 100.0f );
715 actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
716 actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
717 actor.TouchedSignal().Connect( &DummyTouchCallback );
720 // Render and notify.
721 application.SendNotification();
722 application.Render();
724 // Actor on scene, single touch, down in actor, motion, then up outside actor.
726 GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) );
728 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
729 DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
730 DALI_TEST_CHECK( data.receivedTouchData.GetHitActor(0) == actor );
733 GenerateTouch( application, PointState::MOTION, Vector2( 150.0f, 10.0f ) ); // Some motion
735 DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
738 GenerateTouch( application, PointState::UP, Vector2( 150.0f, 10.0f ) ); // Some motion
740 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
741 DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
742 DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) );
746 // Multiple touch. Should only receive a touch on first down and last up.
748 Integration::TouchEvent touchEvent;
749 Integration::Point point;
752 point.SetState( PointState::DOWN );
753 point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
754 touchEvent.points.push_back( point );
755 application.ProcessEvent( touchEvent );
756 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
757 DALI_TEST_EQUALS( data.receivedTouchData.GetPointCount(), 1u, TEST_LOCATION );
761 touchEvent.points[0].SetState( PointState::STATIONARY );
762 point.SetDeviceId( 1 );
763 point.SetScreenPosition( Vector2( 50.0f, 50.0f ) );
764 touchEvent.points.push_back( point );
765 application.ProcessEvent( touchEvent );
766 DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
769 // Primary point is up
770 touchEvent.points[0].SetState( PointState::UP );
771 touchEvent.points[1].SetState( PointState::STATIONARY );
772 application.ProcessEvent( touchEvent );
773 DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
776 // Remove 1st point now, 2nd point is now in motion
777 touchEvent.points.erase( touchEvent.points.begin() );
778 touchEvent.points[0].SetState( PointState::MOTION );
779 touchEvent.points[0].SetScreenPosition( Vector2( 150.0f, 50.0f ) );
780 application.ProcessEvent( touchEvent );
781 DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
785 touchEvent.points[0].SetState( PointState::UP );
786 application.ProcessEvent( touchEvent );
787 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
788 DALI_TEST_EQUALS( data.receivedTouchData.GetPointCount(), 1u, TEST_LOCATION );
794 int UtcDaliSceneTouchSignalN(void)
796 TestApplication application;
797 Dali::Integration::Scene scene = application.GetScene();
799 TouchedSignalData data;
800 TouchFunctor functor( data );
801 scene.TouchSignal().Connect( &application, functor );
803 // Render and notify.
804 application.SendNotification();
805 application.Render();
807 // Confirm functor not called before there has been any touch event.
808 DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
810 // No actors, single touch, down, motion then up.
812 GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) );
814 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
815 DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
816 DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0));
820 // Confirm there is no signal when the touchpoint is only moved.
821 GenerateTouch( application, PointState::MOTION, Vector2( 1200.0f, 10.0f ) ); // Some motion
823 DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
826 // Confirm a following up event generates a signal.
827 GenerateTouch( application, PointState::UP, Vector2( 1200.0f, 10.0f ) );
829 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
830 DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
831 DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0));
835 // Add an actor to the scene.
836 Actor actor = Actor::New();
837 actor.SetSize( 100.0f, 100.0f );
838 actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
839 actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
840 actor.TouchedSignal().Connect( &DummyTouchCallback );
843 // Render and notify.
844 application.SendNotification();
845 application.Render();
847 // Actor on scene. Interrupted before down and interrupted after down.
849 GenerateTouch( application, PointState::INTERRUPTED, Vector2( 10.0f, 10.0f ) );
851 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
852 DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
853 DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) );
854 DALI_TEST_CHECK( data.receivedTouchData.GetState(0) == PointState::INTERRUPTED );
857 GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) );
859 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
860 DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
861 DALI_TEST_CHECK( data.receivedTouchData.GetHitActor(0) == actor );
862 DALI_TEST_CHECK( data.receivedTouchData.GetState(0) == PointState::DOWN );
865 GenerateTouch( application, PointState::INTERRUPTED, Vector2( 10.0f, 10.0f ) );
867 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
868 DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
869 DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) );
870 DALI_TEST_CHECK( data.receivedTouchData.GetState(0) == PointState::INTERRUPTED );
872 DALI_TEST_EQUALS( data.receivedTouchData.GetPointCount(), 1u, TEST_LOCATION );
874 // Check that getting info about a non-existent point returns an empty handle
875 Actor actor = data.receivedTouchData.GetHitActor( 1 );
876 DALI_TEST_CHECK( !actor );
884 int UtcDaliSceneSignalWheelEventP(void)
886 TestApplication application;
887 Dali::Integration::Scene scene = application.GetScene();
889 WheelEventSignalData data;
890 WheelEventReceivedFunctor functor( data );
891 scene.WheelEventSignal().Connect( &application, functor );
893 Integration::WheelEvent event( Integration::WheelEvent::CUSTOM_WHEEL, 0, 0u, Vector2( 0.0f, 0.0f ), 1, 1000u );
894 application.ProcessEvent( event );
896 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
897 DALI_TEST_CHECK( static_cast< WheelEvent::Type >(event.type) == data.receivedWheelEvent.type );
898 DALI_TEST_CHECK( event.direction == data.receivedWheelEvent.direction );
899 DALI_TEST_CHECK( event.modifiers == data.receivedWheelEvent.modifiers );
900 DALI_TEST_CHECK( event.point == data.receivedWheelEvent.point );
901 DALI_TEST_CHECK( event.z == data.receivedWheelEvent.z );
902 DALI_TEST_CHECK( event.timeStamp == data.receivedWheelEvent.timeStamp );
906 Integration::WheelEvent event2( Integration::WheelEvent::CUSTOM_WHEEL, 0, 0u, Vector2( 0.0f, 0.0f ), -1, 1000u );
907 application.ProcessEvent( event2 );
909 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
910 DALI_TEST_CHECK( static_cast< WheelEvent::Type >(event2.type) == data.receivedWheelEvent.type );
911 DALI_TEST_CHECK( event2.direction == data.receivedWheelEvent.direction );
912 DALI_TEST_CHECK( event2.modifiers == data.receivedWheelEvent.modifiers );
913 DALI_TEST_CHECK( event2.point == data.receivedWheelEvent.point );
914 DALI_TEST_CHECK( event2.z == data.receivedWheelEvent.z );
915 DALI_TEST_CHECK( event2.timeStamp == data.receivedWheelEvent.timeStamp );
919 int UtcDaliSceneEnsureEmptySceneCleared(void)
921 tet_infoline( "Ensure we clear the newly added window" );
923 TestApplication application;
925 auto& glAbstraction = application.GetGlAbstraction();
926 auto clearCountBefore = glAbstraction.GetClearCountCalled();
928 application.SendNotification();
929 application.Render();
931 // No actor, no rendering at all
932 DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore, TEST_LOCATION );
933 DALI_TEST_EQUALS( glAbstraction.GetLastClearColor(), Color::TRANSPARENT, TEST_LOCATION );
935 // Need to create a renderable as we don't start rendering until we have at least one
936 // We don't need to add this to any scene
937 auto actor = CreateRenderableActor();
939 application.SendNotification();
940 application.Render();
942 // Default background color
943 DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 1, TEST_LOCATION );
944 DALI_TEST_EQUALS( glAbstraction.GetLastClearColor(), Color::BLACK, TEST_LOCATION );
946 // Create a new scene and set the background colors of both the new and the main scenes
947 auto defaultScene = application.GetScene();
948 defaultScene.SetBackgroundColor( Color::WHITE );
950 application.SendNotification();
951 application.Render();
953 DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 2, TEST_LOCATION );
954 DALI_TEST_EQUALS( glAbstraction.GetLastClearColor(), Color::WHITE, TEST_LOCATION );
956 TestRenderSurface surface( PositionSize( 0.0f, 0.0f, 480.0f, 800.0f ) );
957 auto newScene = Integration::Scene::New( surface );
958 newScene.SetBackgroundColor( Color::RED );
960 application.SendNotification();
961 application.Render();
963 // + 2 clear for 2 scenes
964 DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 4, TEST_LOCATION );
965 DALI_TEST_EQUALS( glAbstraction.GetLastClearColor(), Color::RED, TEST_LOCATION );
967 // Add the actor to the main scene
968 defaultScene.Add( actor );
970 application.SendNotification();
971 application.Render();
973 // + 2 clear for 2 scenes
974 DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 6, TEST_LOCATION );
975 DALI_TEST_EQUALS( glAbstraction.GetLastClearColor(), Color::RED, TEST_LOCATION );
977 // Add another scene and set its background color, ensure we clear it to the appropriate color
978 // + 3 clear for 3 scenes
979 TestRenderSurface surface2( PositionSize( 0.0f, 0.0f, 480.0f, 800.0f ) );
980 auto thirdScene = Integration::Scene::New( surface2 );
981 thirdScene.SetBackgroundColor( Color::BLUE );
983 application.SendNotification();
984 application.Render();
986 DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 9, TEST_LOCATION );
987 DALI_TEST_EQUALS( glAbstraction.GetLastClearColor(), Color::BLUE, TEST_LOCATION );
992 int UtcDaliSceneSurfaceResizedDefaultScene(void)
994 tet_infoline( "Ensure resizing of the surface is handled properly" );
996 TestApplication application;
998 auto defaultScene = application.GetScene();
999 Integration::RenderSurface* defaultSurface = defaultScene.GetSurface();
1000 DALI_TEST_CHECK( defaultSurface );
1002 // Ensure stage size matches the surface size
1003 auto stage = Stage::GetCurrent();
1004 DALI_TEST_EQUALS( stage.GetSize(), Vector2( defaultSurface->GetPositionSize().width, defaultSurface->GetPositionSize().height ), TEST_LOCATION );
1006 // Resize the surface and inform the scene accordingly
1007 Vector2 newSize( 1000.0f, 2000.0f );
1008 DALI_TEST_CHECK( stage.GetSize() != newSize );
1009 defaultSurface->MoveResize( PositionSize( 0, 0, newSize.width, newSize.height ) );
1010 defaultScene.SurfaceResized( false );
1012 DALI_TEST_EQUALS( stage.GetSize(), newSize, TEST_LOCATION );
1013 DALI_TEST_EQUALS( defaultScene.GetSize(), newSize, TEST_LOCATION );
1018 int UtcDaliSceneSurfaceResizedDefaultSceneViewport(void)
1020 tet_infoline( "Ensure resizing of the surface & viewport is handled properly" );
1022 TestApplication application;
1023 TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
1024 TraceCallStack& callStack = glAbstraction.GetViewportTrace();
1025 glAbstraction.EnableViewportCallTrace( true );
1027 // Initial scene setup
1028 Geometry geometry = CreateQuadGeometry();
1029 Shader shader = CreateShader();
1030 Renderer renderer = Renderer::New( geometry, shader );
1032 Actor actor = Actor::New();
1033 actor.AddRenderer(renderer);
1034 actor.SetSize(400, 400);
1035 Stage::GetCurrent().Add(actor);
1037 // Render before resizing surface
1038 application.SendNotification();
1039 application.Render(0);
1040 glAbstraction.ResetViewportCallStack();
1042 auto defaultScene = application.GetScene();
1043 Integration::RenderSurface* defaultSurface = defaultScene.GetSurface();
1044 DALI_TEST_CHECK( defaultSurface );
1046 // Ensure stage size matches the surface size
1047 auto stage = Stage::GetCurrent();
1048 DALI_TEST_EQUALS( stage.GetSize(), Vector2( defaultSurface->GetPositionSize().width, defaultSurface->GetPositionSize().height ), TEST_LOCATION );
1050 // Resize the surface and inform the scene accordingly
1051 Vector2 newSize( 1000.0f, 2000.0f );
1052 std::string viewportParams( "0, 0, 1000, 2000" ); // to match newSize
1053 DALI_TEST_CHECK( stage.GetSize() != newSize );
1054 defaultSurface->MoveResize( PositionSize( 0, 0, newSize.width, newSize.height ) );
1055 defaultScene.SurfaceResized();
1057 DALI_TEST_EQUALS( stage.GetSize(), newSize, TEST_LOCATION );
1058 DALI_TEST_EQUALS( defaultScene.GetSize(), newSize, TEST_LOCATION );
1060 // Render after resizing surface
1061 application.SendNotification();
1062 application.Render(0);
1064 // Check that the viewport is handled properly
1065 DALI_TEST_CHECK( callStack.FindMethodAndGetParameters("Viewport", viewportParams ) );
1070 int UtcDaliSceneSurfaceResizedMultipleRenderTasks(void)
1072 tet_infoline( "Ensure resizing of the surface & viewport is handled properly" );
1074 TestApplication application;
1075 TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
1076 TraceCallStack& callStack = glAbstraction.GetViewportTrace();
1077 glAbstraction.EnableViewportCallTrace( true );
1079 // Initial scene setup
1080 auto stage = Stage::GetCurrent();
1082 Geometry geometry = CreateQuadGeometry();
1083 Shader shader = CreateShader();
1084 Renderer renderer = Renderer::New( geometry, shader );
1086 Actor actor = Actor::New();
1087 actor.AddRenderer(renderer);
1088 int testWidth = 400;
1089 int testHeight = 400;
1090 actor.SetSize(testWidth, testHeight);
1093 CameraActor offscreenCameraActor = CameraActor::New( Size( testWidth, testHeight ) );
1094 Stage::GetCurrent().Add( offscreenCameraActor );
1096 FrameBuffer newFrameBuffer = FrameBuffer::New( testWidth, testHeight, FrameBuffer::Attachment::NONE );
1098 RenderTask newTask = stage.GetRenderTaskList().CreateTask();
1099 newTask.SetCameraActor( offscreenCameraActor );
1100 newTask.SetSourceActor( actor );
1101 newTask.SetFrameBuffer( newFrameBuffer );
1102 newTask.SetViewportPosition( Vector2(0, 0) );
1103 newTask.SetViewportSize( Vector2(testWidth, testHeight) );
1105 // Render before resizing surface
1106 application.SendNotification();
1107 application.Render(0);
1108 glAbstraction.ResetViewportCallStack();
1110 Rect<int32_t> initialViewport = newTask.GetViewport();
1111 int initialWidth = initialViewport.width;
1112 int initialHeight = initialViewport.height;
1113 DALI_TEST_EQUALS( initialWidth, testWidth, TEST_LOCATION );
1114 DALI_TEST_EQUALS( initialHeight, testHeight, TEST_LOCATION );
1116 auto defaultScene = application.GetScene();
1117 Integration::RenderSurface* defaultSurface = defaultScene.GetSurface();
1118 DALI_TEST_CHECK( defaultSurface );
1120 // Ensure stage size matches the surface size
1121 DALI_TEST_EQUALS( stage.GetSize(), Vector2( defaultSurface->GetPositionSize().width, defaultSurface->GetPositionSize().height ), TEST_LOCATION );
1123 // Resize the surface and inform the scene accordingly
1124 Vector2 newSize( 800.0f, 480.0f );
1125 std::string viewportParams( "0, 0, 800, 480" ); // to match newSize
1126 DALI_TEST_CHECK( stage.GetSize() != newSize );
1127 defaultSurface->MoveResize( PositionSize( 0, 0, newSize.width, newSize.height ) );
1128 defaultScene.SurfaceResized();
1130 DALI_TEST_EQUALS( stage.GetSize(), newSize, TEST_LOCATION );
1131 DALI_TEST_EQUALS( defaultScene.GetSize(), newSize, TEST_LOCATION );
1133 // Render after resizing surface
1134 application.SendNotification();
1135 application.Render(0);
1137 // Check that the viewport is handled properly
1138 DALI_TEST_CHECK( callStack.FindMethodAndGetParameters("Viewport", viewportParams ) );
1140 // Second render-task should not be affected
1141 Rect<int32_t> viewport = newTask.GetViewport();
1142 int width = viewport.width;
1143 int height = viewport.height;
1144 DALI_TEST_EQUALS( width, testWidth, TEST_LOCATION );
1145 DALI_TEST_EQUALS( height, testHeight, TEST_LOCATION );
1150 int UtcDaliSceneSurfaceResizedAdditionalScene(void)
1152 tet_infoline( "Ensure resizing of the surface is handled properly on additional scenes" );
1154 TestApplication application;
1155 Vector2 originalSurfaceSize( 500.0f, 1000.0f );
1157 TestRenderSurface surface( PositionSize( 0.0f, 0.0f, originalSurfaceSize.width, originalSurfaceSize.height ) );
1159 auto scene = Integration::Scene::New( surface );
1161 // Ensure stage size does NOT match the surface size
1162 auto stage = Stage::GetCurrent();
1163 const auto stageSize = stage.GetSize();
1164 DALI_TEST_CHECK( stageSize != originalSurfaceSize );
1165 DALI_TEST_EQUALS( originalSurfaceSize, scene.GetSize(), TEST_LOCATION );
1167 // Resize the surface and inform the scene accordingly
1168 Vector2 newSize( 1000.0f, 2000.0f );
1169 DALI_TEST_CHECK( stage.GetSize() != newSize );
1170 surface.MoveResize( PositionSize( 0, 0, newSize.width, newSize.height ) );
1171 scene.SurfaceResized( false );
1173 // Ensure the stage hasn't been resized
1174 DALI_TEST_EQUALS( stage.GetSize(), stageSize, TEST_LOCATION );
1175 DALI_TEST_EQUALS( scene.GetSize(), newSize, TEST_LOCATION );
1180 int UtcDaliSceneSetSurface(void)
1182 tet_infoline( "Scene::SetSurface test" );
1184 TestApplication application;
1186 // Create a scene with a surface and ensure the size and surface is set correctly on the scene
1187 Vector2 surfaceSize( 480.0f, 800.0f );
1188 TestRenderSurface surface( PositionSize( 0.0f, 0.0f, surfaceSize.width, surfaceSize.height ) );
1189 auto scene = Integration::Scene::New( surface );
1190 DALI_TEST_EQUALS( scene.GetSize(), surfaceSize, TEST_LOCATION );
1191 DALI_TEST_CHECK( scene.GetSurface() == &surface );
1193 // Create a new surface and set that on the scene
1194 Vector2 newSurfaceSize( 1000.0f, 1000.0f );
1195 TestRenderSurface newSurface( PositionSize( 0.0f, 0.0f, newSurfaceSize.width, newSurfaceSize.height ) );
1196 scene.SetSurface( newSurface );
1197 DALI_TEST_EQUALS( scene.GetSize(), newSurfaceSize, TEST_LOCATION );
1198 DALI_TEST_CHECK( scene.GetSurface() == &newSurface );
1200 // Ensure setting the same surface again doesn't have any side effects
1201 scene.SetSurface( newSurface );
1202 DALI_TEST_EQUALS( scene.GetSize(), newSurfaceSize, TEST_LOCATION );
1203 DALI_TEST_CHECK( scene.GetSurface() == &newSurface );
1208 int UtcDaliSceneKeyEventGeneratedSignalP(void)
1210 TestApplication application;
1211 Dali::Integration::Scene scene = application.GetScene();
1213 KeyEventGeneratedSignalData data;
1214 KeyEventGeneratedReceivedFunctor functor( data );
1215 scene.KeyEventGeneratedSignal().Connect( &application, functor );
1217 Integration::KeyEvent event( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
1218 application.ProcessEvent( event );
1220 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
1221 DALI_TEST_CHECK( event.keyModifier == data.receivedKeyEvent.keyModifier );
1222 DALI_TEST_CHECK( event.keyName == data.receivedKeyEvent.keyPressedName );
1223 DALI_TEST_CHECK( event.keyString == data.receivedKeyEvent.keyPressed );
1224 DALI_TEST_CHECK( event.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
1228 Integration::KeyEvent event2( "i", "", "i", 0, 0, 0, Integration::KeyEvent::Up, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
1229 application.ProcessEvent( event2 );
1231 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
1232 DALI_TEST_CHECK( event2.keyModifier == data.receivedKeyEvent.keyModifier );
1233 DALI_TEST_CHECK( event2.keyName == data.receivedKeyEvent.keyPressedName );
1234 DALI_TEST_CHECK( event2.keyString == data.receivedKeyEvent.keyPressed );
1235 DALI_TEST_CHECK( event2.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
1239 Integration::KeyEvent event3( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
1240 application.ProcessEvent( event3 );
1242 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
1243 DALI_TEST_CHECK( event3.keyModifier == data.receivedKeyEvent.keyModifier );
1244 DALI_TEST_CHECK( event3.keyName == data.receivedKeyEvent.keyPressedName );
1245 DALI_TEST_CHECK( event3.keyString == data.receivedKeyEvent.keyPressed );
1246 DALI_TEST_CHECK( event3.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
1250 Integration::KeyEvent event4( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
1251 application.ProcessEvent( event4 );
1253 DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
1254 DALI_TEST_CHECK( event4.keyModifier == data.receivedKeyEvent.keyModifier );
1255 DALI_TEST_CHECK( event4.keyName == data.receivedKeyEvent.keyPressedName );
1256 DALI_TEST_CHECK( event4.keyString == data.receivedKeyEvent.keyPressed );
1257 DALI_TEST_CHECK( event4.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
1261 int UtcDaliSceneEnsureReplacedSurfaceKeepsClearColor(void)
1263 tet_infoline( "Ensure we keep background color when the scene surface is replaced " );
1265 TestApplication application;
1267 // Create a new scene and set the background color of the main scene
1268 auto defaultScene = application.GetScene();
1269 defaultScene.SetBackgroundColor( Color::BLUE );
1271 // Need to create a renderable as we don't start rendering until we have at least one
1272 // We don't need to add this to any scene
1273 auto actor = CreateRenderableActor();
1275 auto& glAbstraction = application.GetGlAbstraction();
1276 auto clearCountBefore = glAbstraction.GetClearCountCalled();
1278 application.SendNotification();
1279 application.Render();
1281 DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 1, TEST_LOCATION );
1282 DALI_TEST_EQUALS( glAbstraction.GetLastClearColor(), Color::BLUE, TEST_LOCATION );
1284 TestRenderSurface surface( PositionSize( 0.0f, 0.0f, 480.0f, 800.0f ) );
1285 defaultScene.SetSurface( surface );
1287 application.SendNotification();
1288 application.Render();
1290 DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 2, TEST_LOCATION );
1291 DALI_TEST_EQUALS( glAbstraction.GetLastClearColor(), Color::BLUE, TEST_LOCATION );
1293 // Check when the main render task viewport is set the clear color is clipped using scissors
1294 TraceCallStack& scissorTrace = glAbstraction.GetScissorTrace();
1295 TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace();
1296 scissorTrace.Enable( true );
1297 enabledDisableTrace.Enable( true );
1299 defaultScene.GetRenderTaskList().GetTask( 0 ).SetViewport( Viewport( 0.0f, 0.0f, 100.0f, 100.0f ) );
1301 application.SendNotification();
1302 application.Render();
1304 // Check scissor test was enabled.
1305 DALI_TEST_CHECK( enabledDisableTrace.FindMethodAndParams( "Enable", "3089" ) ); // 3089 = 0xC11 (GL_SCISSOR_TEST)
1307 // Check the scissor was set, and the coordinates are correct.
1308 DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", "0, 700, 100, 100" ) );
1310 DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 3, TEST_LOCATION );
1311 DALI_TEST_EQUALS( glAbstraction.GetLastClearColor(), Color::BLUE, TEST_LOCATION );
1313 scissorTrace.Enable( false );
1314 scissorTrace.Reset();
1316 enabledDisableTrace.Enable( false );
1317 enabledDisableTrace.Reset();