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 // Need to override adaptor classes for toolkit test harness, so include
22 // test harness headers before dali headers.
23 #include <dali-toolkit-test-suite-utils.h>
26 #include <dali-toolkit/dali-toolkit.h>
27 #include <dali-toolkit/public-api/align-enumerations.h>
28 #include <dali-toolkit/devel-api/controls/control-devel.h>
29 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
30 #include <dali-toolkit/devel-api/visuals/image-visual-actions-devel.h>
33 #include <toolkit-event-thread-callback.h>
35 #include "dummy-control.h"
38 using namespace Dali::Toolkit;
40 void utc_dali_toolkit_control_startup(void)
42 test_return_value = TET_UNDEF;
45 void utc_dali_toolkit_control_cleanup(void)
47 test_return_value = TET_PASS;
50 ///////////////////////////////////////////////////////////////////////////////////////////////////
55 bool gObjectCreatedCallBackCalled;
57 void TestCallback(BaseHandle handle)
59 gObjectCreatedCallBackCalled = true;
62 void TestVoidCallback()
66 static bool gKeyInputFocusCallBackCalled;
68 static void TestKeyInputFocusCallback( Control control )
70 tet_infoline(" TestKeyInputFocusCallback");
72 gKeyInputFocusCallBackCalled = true;
75 const char* TEST_LARGE_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/tbcol.png";
76 const char* TEST_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
77 const char* TEST_SVG_FILE_NAME = TEST_RESOURCE_DIR "/Kid1.svg";
79 Vector4 GetControlBackgroundColor( Control& control )
81 Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND );
82 Property::Map* resultMap = propValue.GetMap();
83 DALI_TEST_CHECK( resultMap->Find( ColorVisual::Property::MIX_COLOR ) );
86 resultMap->Find( ColorVisual::Property::MIX_COLOR )->Get( color );
91 bool gResourceReadySignalFired = false;
93 void ResourceReadySignal( Control control )
95 if( control.GetVisualResourceStatus( Control::Property::BACKGROUND ) == Visual::ResourceStatus::FAILED )
97 Property::Map propertyMap;
98 propertyMap.Insert( ImageVisual::Property::URL, TEST_SVG_FILE_NAME );
99 control.SetProperty( Control::Property::BACKGROUND, propertyMap );
102 gResourceReadySignalFired = true;
107 ///////////////////////////////////////////////////////////////////////////////////////////////////
110 int UtcDaliControlConstructor(void)
112 ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
116 DALI_TEST_CHECK( !Control::DownCast(dummy) );
118 dummy = DummyControl::New();
120 DALI_TEST_CHECK( Control::DownCast(dummy) );
124 int UtcDaliControlNew(void)
126 ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
130 DALI_TEST_CHECK( !Control::DownCast(control) );
132 control = Control::New();
134 DALI_TEST_CHECK( Control::DownCast(control) );
139 int UtcDaliControlRegister(void)
141 ToolkitTestApplication application;
143 // Ensure the object is registered after creation
144 ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
145 DALI_TEST_CHECK( registry );
147 gObjectCreatedCallBackCalled = false;
148 registry.ObjectCreatedSignal().Connect( &TestCallback );
150 Alignment alignment = Alignment::New();
152 DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
156 int UtcDaliControlCopyAndAssignment(void)
158 ToolkitTestApplication application;
160 DummyControl control = DummyControl::New();
161 Control emptyControl;
163 Control controlCopy( control );
164 DALI_TEST_CHECK( control == controlCopy );
166 Control emptyControlCopy( emptyControl );
167 DALI_TEST_CHECK( emptyControl == emptyControlCopy );
169 Control controlEquals;
170 controlEquals = control;
171 DALI_TEST_CHECK( control == controlEquals );
173 Control emptyControlEquals;
174 emptyControlEquals = emptyControl;
175 DALI_TEST_CHECK( emptyControl == emptyControlEquals );
179 DALI_TEST_CHECK( control == controlCopy );
183 int UtcDaliControlDownCast(void)
185 ToolkitTestApplication application;
187 DummyControl control;
189 DALI_TEST_CHECK( !Control::DownCast( control ) );
191 control = DummyControl::New();
193 DALI_TEST_CHECK( Control::DownCast( control ) );
197 DALI_TEST_CHECK( !Control::DownCast( actor ) );
199 actor = Actor::New();
201 DALI_TEST_CHECK( !Control::DownCast( actor ) );
205 int UtcDaliControlDownCastTemplate(void)
207 ToolkitTestApplication application;
209 DummyControl control;
211 DALI_TEST_CHECK( !DummyControl::DownCast( control ));
213 control = DummyControl::New();
215 DALI_TEST_CHECK( DummyControl::DownCast( control ) );
219 DALI_TEST_CHECK( !DummyControl::DownCast( actor ) );
221 actor = Actor::New();
223 DALI_TEST_CHECK( !DummyControl::DownCast( actor ) );
227 int UtcDaliControlNavigationProperties(void)
229 ToolkitTestApplication application;
231 Control control = Control::New();
232 Stage::GetCurrent().Add( control );
234 DALI_TEST_EQUALS( -1, control.GetProperty( DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
235 DALI_TEST_EQUALS( -1, control.GetProperty( DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
236 DALI_TEST_EQUALS( -1, control.GetProperty( DevelControl::Property::UP_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
237 DALI_TEST_EQUALS( -1, control.GetProperty( DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
239 control.SetProperty( DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID, 1 );
240 DALI_TEST_EQUALS( 1, control.GetProperty( DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
241 control.SetProperty( DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID, 2 );
242 DALI_TEST_EQUALS( 2, control.GetProperty( DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
243 control.SetProperty( DevelControl::Property::UP_FOCUSABLE_ACTOR_ID, 3 );
244 DALI_TEST_EQUALS( 3, control.GetProperty( DevelControl::Property::UP_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
245 control.SetProperty( DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID, 4 );
246 DALI_TEST_EQUALS( 4, control.GetProperty( DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
248 control.SetProperty( DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID, 15 );
249 DALI_TEST_EQUALS( 15, control.GetProperty( DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
250 control.SetProperty( DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID, 16 );
251 DALI_TEST_EQUALS( 16, control.GetProperty( DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
252 control.SetProperty( DevelControl::Property::UP_FOCUSABLE_ACTOR_ID, 17 );
253 DALI_TEST_EQUALS( 17, control.GetProperty( DevelControl::Property::UP_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
254 control.SetProperty( DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID, 18 );
255 DALI_TEST_EQUALS( 18, control.GetProperty( DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
260 int UtcDaliControlKeyInputFocus(void)
262 ToolkitTestApplication application;
263 Stage stage = Stage::GetCurrent();
265 DummyControl control;
267 PushButton pushButton1 = PushButton::New();
268 stage.Add( pushButton1 );
270 pushButton1.SetKeyInputFocus();
271 DALI_TEST_CHECK( pushButton1.HasKeyInputFocus() );
273 pushButton1.ClearKeyInputFocus();
274 DALI_TEST_CHECK( !pushButton1.HasKeyInputFocus() );
278 int UtcDaliControlGetImplementationN(void)
280 ToolkitTestApplication application;
281 DummyControl control;
287 Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( control );
288 (void)controlImpl; // Avoid unused warning
289 tet_result(TET_FAIL);
291 catch (DaliException &exception)
293 tet_result(TET_PASS);
299 int UtcDaliControlGetImplementationConstN(void)
301 ToolkitTestApplication application;
302 DummyControl control;
308 const DummyControl constControl(control);
309 const Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( constControl );
310 (void)controlImpl; // Avoid unused warning
311 tet_result(TET_FAIL);
313 catch (DaliException &exception)
315 tet_result(TET_PASS);
321 int UtcDaliControlGetImplementationP(void)
323 ToolkitTestApplication application;
324 DummyControl control = DummyControl::New();
330 Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( control );
331 (void)controlImpl; // Avoid unused warning
332 tet_result(TET_PASS);
334 catch (DaliException &exception)
336 tet_result(TET_FAIL);
342 int UtcDaliControlGetImplementationConstP(void)
344 ToolkitTestApplication application;
345 DummyControl control = DummyControl::New();
350 const DummyControl constControl(control);
351 const Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( constControl );
352 (void)controlImpl; // Avoid unused warning
353 tet_result(TET_PASS);
355 catch (DaliException &exception)
357 tet_result(TET_FAIL);
363 int UtcDaliControlSignalConnectDisconnect(void)
365 ToolkitTestApplication application;
368 DummyControl dummy = DummyControlImpl::New();
370 Actor actor = Actor::New();
371 DALI_TEST_EQUALS( actor.OnStageSignal().GetConnectionCount(), 0u, TEST_LOCATION );
372 Toolkit::Internal::Control& control = Toolkit::Internal::GetImplementation( dummy );
373 DummyControlImpl* dummyImpl = dynamic_cast<DummyControlImpl*>(&control);
375 if( dummyImpl == NULL )
377 tet_result( TET_FAIL );
381 actor.OnStageSignal().Connect( dummyImpl, &DummyControlImpl::CustomSlot1 );
382 DALI_TEST_EQUALS( actor.OnStageSignal().GetConnectionCount(), 1u, TEST_LOCATION );
383 DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, false, TEST_LOCATION );
385 Stage::GetCurrent().Add( actor );
386 DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, true, TEST_LOCATION );
388 dummyImpl->mCustomSlot1Called = false;
389 actor.OnStageSignal().Disconnect( dummyImpl, &DummyControlImpl::CustomSlot1 );
390 DALI_TEST_EQUALS( actor.OnStageSignal().GetConnectionCount(), 0u, TEST_LOCATION );
391 Stage::GetCurrent().Remove( actor );
392 Stage::GetCurrent().Add( actor );
393 DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, false, TEST_LOCATION );
398 int UtcDaliControlSignalAutomaticDisconnect(void)
400 ToolkitTestApplication application;
402 Actor actor = Actor::New();
405 DummyControl dummy = DummyControlImpl::New();
406 Toolkit::Internal::Control& control = Toolkit::Internal::GetImplementation( dummy );
407 DummyControlImpl* dummyImpl = dynamic_cast<DummyControlImpl*>(&control);
409 if( dummyImpl == NULL )
411 tet_result( TET_FAIL );
415 actor.OnStageSignal().Connect( dummyImpl, &DummyControlImpl::CustomSlot1 );
416 DALI_TEST_EQUALS( actor.OnStageSignal().GetConnectionCount(), 1u, TEST_LOCATION );
417 DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, false, TEST_LOCATION );
419 Stage::GetCurrent().Add( actor );
420 DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, true, TEST_LOCATION );
421 Stage::GetCurrent().Remove( actor );
423 // dummyControl automatically disconnects
425 DALI_TEST_EQUALS( actor.OnStageSignal().GetConnectionCount(), 0u, TEST_LOCATION );
427 const Vector3 ignoredSize( 20, 20, 0 );
428 actor.SetSize( ignoredSize );
432 int UtcDaliControlTestParameters(void)
434 ToolkitTestApplication application;
435 DummyControl test = DummyControl::New();
437 test.SetSize( 0.7f, 0.7f, 0.7f );
439 Stage::GetCurrent().Add( test );
441 application.SendNotification();
442 application.Render();
444 float width = 640.0f;
445 float height = test.GetHeightForWidth( width );
446 DALI_TEST_EQUALS( 640.0f, height, TEST_LOCATION );
447 DALI_TEST_EQUALS( 640.0f, test.GetWidthForHeight( height ), TEST_LOCATION );
449 test.KeyEventSignal();
451 // Provide coverage for pointer destructor
452 Control* testControlPtr = new Control;
453 DALI_TEST_CHECK( testControlPtr );
454 delete testControlPtr;
458 int UtcDaliControlBackgroundColor(void)
460 ToolkitTestApplication application;
461 Control control = Control::New();
463 DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND ).Get< Property::Map >().Empty() );
465 control.SetProperty( Control::Property::BACKGROUND, Color::RED );
467 Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND );
468 Property::Map* resultMap = propValue.GetMap();
469 DALI_TEST_CHECK( resultMap->Find( Toolkit::Visual::Property::TYPE ) );
470 DALI_TEST_CHECK( resultMap->Find( Toolkit::Visual::Property::TYPE )->Get<int>() == Visual::COLOR );
471 DALI_TEST_CHECK( resultMap->Find( ColorVisual::Property::MIX_COLOR ) );
472 DALI_TEST_CHECK( resultMap->Find( ColorVisual::Property::MIX_COLOR )->Get<Vector4>() == Color::RED );
474 control.SetProperty( Control::Property::BACKGROUND, Color::YELLOW );
476 propValue = control.GetProperty( Control::Property::BACKGROUND );
477 resultMap = propValue.GetMap();
478 DALI_TEST_CHECK( resultMap->Find( ColorVisual::Property::MIX_COLOR ) );
479 DALI_TEST_CHECK( resultMap->Find( ColorVisual::Property::MIX_COLOR )->Get<Vector4>() == Color::YELLOW );
484 int UtcDaliControlBackgroundColorRendererCount(void)
486 tet_infoline( "Test ensures we only create renderers when non-transparent color is requested or if we our clipping-mode is set to CLIP_CHILDREN" );
488 ToolkitTestApplication application;
489 Control control = Control::New();
490 Stage::GetCurrent().Add( control );
492 tet_infoline( "Set transparent, no renderers should be created" );
493 control.SetBackgroundColor( Color::TRANSPARENT );
494 application.SendNotification();
495 application.Render();
496 DALI_TEST_EQUALS( control.GetRendererCount(), 0u, TEST_LOCATION );
498 tet_infoline( "Set transparent alpha with positive RGB values, no renderers should be created, but returned color should reflect what we set" );
499 const Vector4 alphaZero( 1.0f, 0.5f, 0.25f, 0.0f );
500 control.SetBackgroundColor( alphaZero );
501 application.SendNotification();
502 application.Render();
503 DALI_TEST_EQUALS( control.GetRendererCount(), 0u, TEST_LOCATION );
504 DALI_TEST_EQUALS( GetControlBackgroundColor( control ), alphaZero, TEST_LOCATION );
506 tet_infoline( "Set semi transparent alpha with positive RGB values, 1 renderer should be created, but returned color should reflect what we set" );
507 const Vector4 semiTransparent( 1.0f, 0.75f, 0.5f, 0.5f );
508 control.SetBackgroundColor( semiTransparent );
509 application.SendNotification();
510 application.Render();
511 DALI_TEST_EQUALS( control.GetRendererCount(), 1u, TEST_LOCATION );
512 DALI_TEST_EQUALS( GetControlBackgroundColor( control ), semiTransparent, TEST_LOCATION );
514 tet_infoline( "Set transparent, ensure no renderers are created" );
515 control.SetBackgroundColor( Color::TRANSPARENT );
516 application.SendNotification();
517 application.Render();
518 DALI_TEST_EQUALS( control.GetRendererCount(), 0u, TEST_LOCATION );
519 DALI_TEST_EQUALS( GetControlBackgroundColor( control ), Color::TRANSPARENT, TEST_LOCATION );
521 tet_infoline( "Set control to clip its children, a renderer should be created which will be transparent" );
522 control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
523 application.SendNotification();
524 application.Render();
525 DALI_TEST_EQUALS( control.GetRendererCount(), 1u, TEST_LOCATION );
526 DALI_TEST_EQUALS( GetControlBackgroundColor( control ), Color::TRANSPARENT, TEST_LOCATION );
528 tet_infoline( "Set a color, only 1 renderer should exist" );
529 control.SetBackgroundColor( Color::RED );
530 application.SendNotification();
531 application.Render();
532 DALI_TEST_EQUALS( control.GetRendererCount(), 1u, TEST_LOCATION );
533 DALI_TEST_EQUALS( GetControlBackgroundColor( control ), Color::RED, TEST_LOCATION );
535 tet_infoline( "Clear the background, no renderers" );
536 control.ClearBackground();
537 application.SendNotification();
538 application.Render();
539 DALI_TEST_EQUALS( control.GetRendererCount(), 0u, TEST_LOCATION );
541 tet_infoline( "Set control to clip its children again, a renderer should be created which will be transparent" );
542 control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
543 application.SendNotification();
544 application.Render();
545 DALI_TEST_EQUALS( control.GetRendererCount(), 1u, TEST_LOCATION );
546 DALI_TEST_EQUALS( GetControlBackgroundColor( control ), Color::TRANSPARENT, TEST_LOCATION );
548 tet_infoline( "Disable clipping, no renderers" );
549 control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::DISABLED );
550 application.SendNotification();
551 application.Render();
552 DALI_TEST_EQUALS( control.GetRendererCount(), 0u, TEST_LOCATION );
553 DALI_TEST_EQUALS( GetControlBackgroundColor( control ), Color::TRANSPARENT, TEST_LOCATION );
558 int UtcDaliControlBackgroundImage(void)
560 ToolkitTestApplication application;
561 Control control = Control::New();
563 tet_infoline( "Set first background image" );
564 control.SetProperty( Control::Property::BACKGROUND, "TestImage" );
566 Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND );
567 Property::Map* resultMap = propValue.GetMap();
568 DALI_TEST_CHECK( resultMap->Find( Toolkit::Visual::Property::TYPE ) );
569 DALI_TEST_CHECK( resultMap->Find( Toolkit::Visual::Property::TYPE )->Get<int>() == Visual::IMAGE );
570 DALI_TEST_CHECK( resultMap->Find( ImageVisual::Property::URL ) );
571 DALI_TEST_CHECK( resultMap->Find( ImageVisual::Property::URL )->Get<std::string>() == "TestImage" );
573 tet_infoline( "Set replacement background image" );
574 control.SetProperty( Control::Property::BACKGROUND, "TestImage2" );
576 propValue = control.GetProperty( Control::Property::BACKGROUND );
577 resultMap = propValue.GetMap();
578 DALI_TEST_CHECK( resultMap->Find( ImageVisual::Property::URL ) );
579 DALI_TEST_CHECK( resultMap->Find( ImageVisual::Property::URL )->Get<std::string>() == "TestImage2" );
584 int UtcDaliControlBackgroundProperties(void)
586 ToolkitTestApplication application;
587 Control control = Control::New();
589 DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND ).Get< Property::Map >().Empty() );
591 Property::Map imageMap;
592 imageMap[ Toolkit::Visual::Property::TYPE ] = Visual::IMAGE;
593 imageMap[ ImageVisual::Property::URL ] = "TestImage";
594 control.SetProperty( Control::Property::BACKGROUND, imageMap );
595 Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND );
596 Property::Map* resultMap = propValue.GetMap();
597 DALI_TEST_CHECK( resultMap->Find( Toolkit::Visual::Property::TYPE ) );
598 DALI_TEST_EQUALS( resultMap->Find( Toolkit::Visual::Property::TYPE )->Get<int>(),(int)Visual::IMAGE, TEST_LOCATION );
599 DALI_TEST_CHECK( resultMap->Find( ImageVisual::Property::URL ) );
600 DALI_TEST_EQUALS( resultMap->Find( ImageVisual::Property::URL )->Get<std::string>(), "TestImage", TEST_LOCATION );
602 Property::Map rendererMap;
603 rendererMap[Visual::Property::TYPE] = Visual::COLOR;
604 rendererMap[ColorVisual::Property::MIX_COLOR] = Color::CYAN;
605 control.SetProperty( Control::Property::BACKGROUND, rendererMap );
606 propValue = control.GetProperty( Control::Property::BACKGROUND );
607 resultMap = propValue.GetMap();
608 DALI_TEST_CHECK( resultMap->Find( Toolkit::Visual::Property::TYPE ) );
609 DALI_TEST_EQUALS( resultMap->Find( Toolkit::Visual::Property::TYPE )->Get<int>(), (int)Visual::COLOR, TEST_LOCATION );
610 DALI_TEST_CHECK( resultMap->Find( ColorVisual::Property::MIX_COLOR ) );
611 DALI_TEST_EQUALS( resultMap->Find( ColorVisual::Property::MIX_COLOR )->Get<Vector4>(), Color::CYAN, TEST_LOCATION );
613 Property::Map emptyMap;
614 control.SetProperty( Control::Property::BACKGROUND, emptyMap );
615 DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND ).Get< Property::Map >().Empty() );
618 control.SetProperty( Control::Property::BACKGROUND, "Foobar.png" );
619 propValue = control.GetProperty( Control::Property::BACKGROUND );
620 resultMap = propValue.GetMap();
621 DALI_TEST_EQUALS( resultMap->Find( Toolkit::Visual::Property::TYPE )->Get<int>(), (int)Visual::IMAGE, TEST_LOCATION );
622 DALI_TEST_EQUALS( resultMap->Find( ImageVisual::Property::URL )->Get<std::string>(), "Foobar.png", TEST_LOCATION );
625 control.SetProperty( Control::Property::BACKGROUND, Color::RED );
626 propValue = control.GetProperty( Control::Property::BACKGROUND );
627 resultMap = propValue.GetMap();
628 DALI_TEST_EQUALS( resultMap->Find( Toolkit::Visual::Property::TYPE )->Get<int>(), (int)Visual::COLOR, TEST_LOCATION );
629 DALI_TEST_EQUALS( resultMap->Find( ColorVisual::Property::MIX_COLOR )->Get<Vector4>(), Color::RED, TEST_LOCATION );
634 int UtcDaliControlShadowProperties(void)
636 ToolkitTestApplication application;
637 Control control = Control::New();
639 DALI_TEST_CHECK( control.GetProperty( DevelControl::Property::SHADOW ).Get< Property::Map >().Empty() );
641 Property::Map imageMap;
642 imageMap[ Toolkit::Visual::Property::TYPE ] = Visual::IMAGE;
643 imageMap[ ImageVisual::Property::URL ] = "TestImage";
644 control.SetProperty( DevelControl::Property::SHADOW, imageMap );
645 Property::Value propValue = control.GetProperty( DevelControl::Property::SHADOW );
646 Property::Map* resultMap = propValue.GetMap();
647 DALI_TEST_CHECK( resultMap->Find( Toolkit::Visual::Property::TYPE ) );
648 DALI_TEST_EQUALS( resultMap->Find( Toolkit::Visual::Property::TYPE )->Get<int>(),(int)Visual::IMAGE, TEST_LOCATION );
649 DALI_TEST_CHECK( resultMap->Find( ImageVisual::Property::URL ) );
650 DALI_TEST_EQUALS( resultMap->Find( ImageVisual::Property::URL )->Get<std::string>(), "TestImage", TEST_LOCATION );
652 Property::Map colorMap;
653 colorMap[Visual::Property::TYPE] = Visual::COLOR;
654 colorMap[ColorVisual::Property::MIX_COLOR] = Color::CYAN;
655 control.SetProperty( DevelControl::Property::SHADOW, colorMap );
656 propValue = control.GetProperty( DevelControl::Property::SHADOW );
657 resultMap = propValue.GetMap();
658 DALI_TEST_CHECK( resultMap->Find( Toolkit::Visual::Property::TYPE ) );
659 DALI_TEST_EQUALS( resultMap->Find( Toolkit::Visual::Property::TYPE )->Get<int>(), (int)Visual::COLOR, TEST_LOCATION );
660 DALI_TEST_CHECK( resultMap->Find( ColorVisual::Property::MIX_COLOR ) );
661 DALI_TEST_EQUALS( resultMap->Find( ColorVisual::Property::MIX_COLOR )->Get<Vector4>(), Color::CYAN, TEST_LOCATION );
663 Property::Map emptyMap;
664 control.SetProperty( DevelControl::Property::SHADOW, emptyMap );
665 DALI_TEST_CHECK( control.GetProperty( DevelControl::Property::SHADOW ).Get< Property::Map >().Empty() );
670 int UtcDaliControlKeyProperties(void)
672 ToolkitTestApplication application;
674 Control control = Control::New();
675 Stage::GetCurrent().Add( control );
677 DALI_TEST_EQUALS( control.HasKeyInputFocus(), control.GetProperty( Control::Property::KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
679 control.SetKeyInputFocus();
680 DALI_TEST_EQUALS( true, control.GetProperty( Control::Property::KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
682 control.ClearKeyInputFocus();
683 DALI_TEST_EQUALS( false, control.GetProperty( Control::Property::KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
685 control.SetProperty( Control::Property::KEY_INPUT_FOCUS, true );
686 DALI_TEST_EQUALS( true, control.HasKeyInputFocus(), TEST_LOCATION );
691 int UtcDaliControlGestureSignals(void)
693 ToolkitTestApplication application;
694 ConnectionTracker connectionTracker;
695 Control control = Control::New();
697 // Each gesture detector gets created when connecting to the gesture signals
698 DALI_TEST_CHECK( !control.GetTapGestureDetector() );
699 control.ConnectSignal( &connectionTracker, "tapped", &TestVoidCallback );
700 DALI_TEST_CHECK( control.GetTapGestureDetector() );
702 DALI_TEST_CHECK( !control.GetPanGestureDetector() );
703 control.ConnectSignal( &connectionTracker, "panned", &TestVoidCallback );
704 DALI_TEST_CHECK( control.GetPanGestureDetector() );
706 DALI_TEST_CHECK( !control.GetPinchGestureDetector() );
707 control.ConnectSignal( &connectionTracker, "pinched", &TestVoidCallback );
708 DALI_TEST_CHECK( control.GetPinchGestureDetector() );
710 DALI_TEST_CHECK( !control.GetLongPressGestureDetector() );
711 control.ConnectSignal( &connectionTracker, "longPressed", &TestVoidCallback );
712 DALI_TEST_CHECK( control.GetLongPressGestureDetector() );
717 int UtcDaliControlImplKeyInputFocusGainedSignal(void)
719 ToolkitTestApplication application;
721 Control control = Control::New();
722 Stage::GetCurrent().Add( control );
724 gKeyInputFocusCallBackCalled = false;
725 control.KeyInputFocusGainedSignal().Connect(&TestKeyInputFocusCallback);
727 application.SendNotification();
728 application.Render();
730 control.SetKeyInputFocus();
732 DALI_TEST_CHECK( control.HasKeyInputFocus() );
734 DALI_TEST_CHECK( gKeyInputFocusCallBackCalled );
739 int UtcDaliControlImplKeyInputFocusLostSignal(void)
741 ToolkitTestApplication application;
743 Control control = Control::New();
744 Stage::GetCurrent().Add( control );
746 gKeyInputFocusCallBackCalled = false;
747 control.KeyInputFocusLostSignal().Connect(&TestKeyInputFocusCallback);
749 application.SendNotification();
750 application.Render();
752 control.SetKeyInputFocus();
754 DALI_TEST_CHECK( control.HasKeyInputFocus() );
756 control.ClearKeyInputFocus();
758 DALI_TEST_CHECK( gKeyInputFocusCallBackCalled );
763 int UtcDaliControlImplGetControlExtensionP(void)
765 ToolkitTestApplication application;
766 Control control = Control::New();
768 Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( control );
770 DALI_TEST_CHECK( NULL == controlImpl.GetControlExtension() );
775 int UtcDaliControlAutoClipping(void)
777 ToolkitTestApplication application;
778 Control control = Control::New();
780 tet_infoline( "Test to see if a renderer gets added when we are clipping children" );
782 DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
784 control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
786 Stage::GetCurrent().Add( control );
788 application.SendNotification();
789 application.Render();
791 DALI_TEST_EQUALS( 1, control.GetRendererCount(), TEST_LOCATION );
796 int UtcDaliControlAutoClippingN(void)
798 ToolkitTestApplication application;
799 Control control = Control::New();
800 control.SetProperty( Control::Property::BACKGROUND, Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::COLOR )
801 .Add( ColorVisual::Property::MIX_COLOR, Color::RED ) );
803 tet_infoline( "Test to ensure that a renderer does NOT get added when we are clipping children and already have renderers/visuals" );
805 DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
807 control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
809 Stage::GetCurrent().Add( control );
811 application.SendNotification();
812 application.Render();
814 DALI_TEST_EQUALS( 1, control.GetRendererCount(), TEST_LOCATION ); // Only 1, not 2
816 // Ensure the background color is still RED rather than what's set by the automatic clipping
817 Property::Value value = control.GetProperty( Control::Property::BACKGROUND );
818 Property::Map* map = value.GetMap();
819 DALI_TEST_CHECK( map );
820 Property::Value* colorValue = map->Find(ColorVisual::Property::MIX_COLOR );
821 DALI_TEST_CHECK( colorValue );
822 DALI_TEST_EQUALS( colorValue->Get< Vector4 >(), Color::RED, TEST_LOCATION );
827 int UtcDaliControlAutoClippingWhenAlreadyOnStage(void)
829 ToolkitTestApplication application;
830 Control control = Control::New();
832 tet_infoline( "Test to see if a renderer gets added when we are clipping children and when already on stage" );
834 DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
836 Stage::GetCurrent().Add( control );
838 application.SendNotification();
839 application.Render();
841 DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
843 control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
845 application.SendNotification();
846 application.Render();
848 DALI_TEST_EQUALS( 1, control.GetRendererCount(), TEST_LOCATION );
853 int UtcDaliControlAutoClippingWhenAlreadyOnStageN(void)
855 ToolkitTestApplication application;
856 Control control = Control::New();
857 control.SetProperty( Control::Property::BACKGROUND, Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::COLOR )
858 .Add( ColorVisual::Property::MIX_COLOR, Color::RED ) );
860 tet_infoline( "Test to ensure that a renderer does NOT get added when we are clipping children and already have renderers/visuals and when already on stage" );
862 DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
864 Stage::GetCurrent().Add( control );
866 application.SendNotification();
867 application.Render();
869 DALI_TEST_EQUALS( 1, control.GetRendererCount(), TEST_LOCATION );
871 control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
873 application.SendNotification();
874 application.Render();
876 DALI_TEST_EQUALS( 1, control.GetRendererCount(), TEST_LOCATION ); // Still should be 1
878 // Ensure the background color is still RED rather than what's set by the automatic clipping
879 Property::Value value = control.GetProperty( Control::Property::BACKGROUND );
880 Property::Map* map = value.GetMap();
881 DALI_TEST_CHECK( map );
882 Property::Value* colorValue = map->Find(ColorVisual::Property::MIX_COLOR );
883 DALI_TEST_CHECK( colorValue );
884 DALI_TEST_EQUALS( colorValue->Get< Vector4 >(), Color::RED, TEST_LOCATION );
889 int UtcDaliControlSetTransformSize(void)
891 ToolkitTestApplication application;
892 Control control = Control::New();
894 Property::Map transformMap;
895 transformMap.Add( Visual::Transform::Property::OFFSET, Vector2( 10, 10 ) )
896 .Add( Visual::Transform::Property::ANCHOR_POINT, Align::BOTTOM_END )
897 .Add( Visual::Transform::Property::ORIGIN, Align::BOTTOM_END )
898 .Add( Visual::Transform::Property::SIZE, Vector2( 10, 20 ) );
900 control.SetProperty( Control::Property::BACKGROUND, Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::COLOR )
901 .Add( Visual::Property::TRANSFORM, transformMap ) );
903 tet_infoline( "Test to ensure that the control background transform does not get overwritten when adding to the stage" );
905 Stage::GetCurrent().Add( control );
907 application.SendNotification();
908 application.Render();
910 // Ensure the transform property still matches what we set
911 Property::Value value = control.GetProperty( Control::Property::BACKGROUND );
912 Property::Map* map = value.GetMap();
913 DALI_TEST_CHECK( map );
914 Property::Value* transformValue = map->Find( Visual::Property::TRANSFORM );
915 DALI_TEST_CHECK( transformValue );
917 Property::Map* retMap = transformValue->GetMap();
918 DALI_TEST_CHECK( retMap );
919 DALI_TEST_EQUALS( retMap->Find( Visual::Transform::Property::OFFSET )->Get< Vector2 >(), Vector2( 10, 10 ), TEST_LOCATION );
920 DALI_TEST_EQUALS( retMap->Find( Visual::Transform::Property::ANCHOR_POINT )->Get< int >(), (int)Align::BOTTOM_END, TEST_LOCATION );
921 DALI_TEST_EQUALS( retMap->Find( Visual::Transform::Property::ORIGIN )->Get< int >(), (int)Align::BOTTOM_END, TEST_LOCATION );
922 DALI_TEST_EQUALS( retMap->Find( Visual::Transform::Property::SIZE )->Get< Vector2 >(), Vector2( 10, 20 ), TEST_LOCATION );
928 int UtcDaliControlResourcesReady(void)
930 ToolkitTestApplication application;
931 tet_infoline( "Register 2 visuals and check ResourceReady when a visual is disabled" );
933 VisualFactory factory = VisualFactory::Get();
934 DALI_TEST_CHECK( factory );
936 Property::Map propertyMapLarge;
937 propertyMapLarge.Insert( Toolkit::Visual::Property::TYPE, Visual::IMAGE );
938 propertyMapLarge.Insert( ImageVisual::Property::URL, TEST_LARGE_IMAGE_FILE_NAME );
940 Property::Map propertyMapSmall;
941 propertyMapSmall.Insert( Toolkit::Visual::Property::TYPE, Visual::IMAGE );
942 propertyMapSmall.Insert( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME );
944 Visual::Base smallVisual = factory.CreateVisual( propertyMapSmall );
945 smallVisual.SetName("smallVisual");
946 DALI_TEST_CHECK( smallVisual );
948 DummyControl actor = DummyControl::New();
949 DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
951 dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, smallVisual );
953 actor.SetSize( 200.f, 200.f );
955 Toolkit::Visual::ResourceStatus resourceStatus = actor.GetVisualResourceStatus(DummyControl::Property::TEST_VISUAL);
956 DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
957 DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION );
958 DALI_TEST_EQUALS( static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::PREPARING), TEST_LOCATION );
960 Stage::GetCurrent().Add( actor );
961 application.SendNotification();
962 application.Render();
964 DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
966 application.SendNotification();
967 application.Render();
969 resourceStatus = actor.GetVisualResourceStatus(DummyControl::Property::TEST_VISUAL);
970 DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
971 DALI_TEST_EQUALS( actor.IsResourceReady(), true, TEST_LOCATION );
972 DALI_TEST_EQUALS( static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::READY), TEST_LOCATION );
974 Visual::Base largeVisual = factory.CreateVisual( propertyMapLarge );
975 largeVisual.SetName("largeVisual");
976 DALI_TEST_CHECK( largeVisual );
978 tet_infoline( "Register Visual but set disabled, IsResourceReady should be true" );
980 dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, largeVisual, false );
982 resourceStatus = actor.GetVisualResourceStatus(DummyControl::Property::TEST_VISUAL2);
983 DALI_TEST_EQUALS( static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::PREPARING), TEST_LOCATION );
985 application.SendNotification();
987 resourceStatus = actor.GetVisualResourceStatus(DummyControl::Property::TEST_VISUAL2);
988 DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
989 DALI_TEST_EQUALS( actor.IsResourceReady(), true, TEST_LOCATION );
990 DALI_TEST_EQUALS( static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::PREPARING), TEST_LOCATION );
992 dummyImpl.EnableVisual( DummyControl::Property::TEST_VISUAL2, true );
994 DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
996 application.SendNotification();
998 resourceStatus = actor.GetVisualResourceStatus(DummyControl::Property::TEST_VISUAL2);
999 DALI_TEST_EQUALS( static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::READY), TEST_LOCATION );
1004 int UtcDaliControlResourcesReady02(void)
1006 ToolkitTestApplication application;
1007 tet_infoline( "Change a resource during ResourceReady callback" );
1009 gResourceReadySignalFired = false;
1011 Control control = Control::New();
1012 control.SetSize( 200.f, 200.f );
1013 control.ResourceReadySignal().Connect( &ResourceReadySignal );
1015 Property::Map propertyMap;
1016 propertyMap.Insert( ImageVisual::Property::URL, "invalid.jpg" );
1017 control.SetProperty( Control::Property::BACKGROUND, propertyMap );
1019 Stage::GetCurrent().Add( control );
1021 application.SendNotification();
1022 application.Render();
1024 DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
1026 application.SendNotification();
1027 application.Render();
1029 DALI_TEST_EQUALS( control.IsResourceReady(), true, TEST_LOCATION );
1030 DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
1031 gResourceReadySignalFired = false;
1036 int UtcDaliControlMarginProperty(void)
1038 ToolkitTestApplication application;
1040 Control control = Control::New();
1041 control.SetBackgroundColor( Color::BLUE );
1043 control.SetProperty( Control::Property::MARGIN, Extents( 20, 10, 0, 0 ) );
1045 Stage::GetCurrent().Add( control );
1047 application.SendNotification();
1048 application.Render();
1050 DALI_TEST_EQUALS( control.GetProperty<Extents>( Control::Property::MARGIN ), Extents( 20, 10, 0, 0 ), TEST_LOCATION );
1052 // Parent control has one ImageView as a Child.
1053 ImageView image = ImageView::New();
1054 image.SetBackgroundColor( Color::RED );
1055 image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
1056 image.SetProperty( Control::Property::PADDING, Extents( 10, 10, 10, 10 ) );
1057 control.Add( image );
1059 application.SendNotification();
1060 application.Render();
1062 DALI_TEST_EQUALS( image.GetProperty<Extents>( Control::Property::PADDING ), Extents( 10, 10, 10, 10 ), TEST_LOCATION );
1067 int UtcDaliControlPaddingProperty(void)
1069 ToolkitTestApplication application;
1071 Control control = Control::New();
1072 control.SetBackgroundColor( Color::BLUE );
1074 control.SetProperty( Control::Property::PADDING, Extents( 15, 10, 5, 10 ) );
1076 Stage::GetCurrent().Add( control );
1078 application.SendNotification();
1079 application.Render();
1081 DALI_TEST_EQUALS( control.GetProperty<Extents>( Control::Property::PADDING ), Extents( 15, 10, 5, 10 ), TEST_LOCATION );
1083 Control child = Control::New();
1086 application.SendNotification();
1087 application.Render();
1089 DALI_TEST_EQUALS( child.GetProperty<Vector3>( Dali::Actor::Property::POSITION ), Vector3( 15, 5, 0 ), TEST_LOCATION );
1091 control.SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::RIGHT_TO_LEFT);
1092 application.SendNotification();
1093 application.Render();
1094 DALI_TEST_EQUALS( child.GetProperty<Vector3>( Dali::Actor::Property::POSITION ), Vector3( 10, 5, 0 ), TEST_LOCATION );
1096 control.SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::LEFT_TO_RIGHT);
1097 application.SendNotification();
1098 application.Render();
1100 DALI_TEST_EQUALS( child.GetProperty<Vector3>( Dali::Actor::Property::POSITION ), Vector3( 15, 5, 0 ), TEST_LOCATION );
1105 int UtcDaliControlDoAction(void)
1107 ToolkitTestApplication application;
1108 tet_infoline( "DoAction on a visual registered with a control" );
1110 // Set up trace debug
1111 TestGlAbstraction& gl = application.GetGlAbstraction();
1112 TraceCallStack& textureTrace = gl.GetTextureTrace();
1113 textureTrace.Enable( true );
1115 //Created AnimatedImageVisual
1116 VisualFactory factory = VisualFactory::Get();
1117 Visual::Base imageVisual = factory.CreateVisual( TEST_IMAGE_FILE_NAME, ImageDimensions() );
1119 DummyControl dummyControl = DummyControl::New(true);
1120 Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
1122 dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual );
1123 dummyControl.SetSize(200.f, 200.f);
1124 Stage::GetCurrent().Add( dummyControl );
1126 DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
1128 application.SendNotification();
1129 application.Render();
1130 DALI_TEST_EQUALS( textureTrace.CountMethod("DeleteTextures"), 0, TEST_LOCATION );
1131 DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION );
1132 textureTrace.Reset();
1134 Property::Map attributes;
1135 DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, DevelImageVisual::Action::RELOAD, attributes );
1137 tet_infoline( "Perform RELOAD action. should reload Image and generate a texture" );
1138 DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
1140 application.SendNotification();
1141 application.Render();
1142 DALI_TEST_EQUALS( textureTrace.CountMethod("DeleteTextures"), 1, TEST_LOCATION );
1143 DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION );
1147 int UtcDaliControlDoActionWhenNotStage(void)
1149 ToolkitTestApplication application;
1150 tet_infoline( "DoAction on a visual registered with a control but not staged" );
1152 // Set up trace debug
1153 TestGlAbstraction& gl = application.GetGlAbstraction();
1154 TraceCallStack& textureTrace = gl.GetTextureTrace();
1155 textureTrace.Enable( true );
1157 //Created AnimatedImageVisual
1158 VisualFactory factory = VisualFactory::Get();
1159 Visual::Base imageVisual = factory.CreateVisual( TEST_IMAGE_FILE_NAME, ImageDimensions() );
1161 DummyControl dummyControl = DummyControl::New(true);
1162 Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
1164 dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual );
1165 dummyControl.SetSize(200.f, 200.f);
1167 application.SendNotification();
1168 application.Render();
1169 DALI_TEST_EQUALS( textureTrace.CountMethod("DeleteTextures"), 0, TEST_LOCATION );
1170 DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION );
1171 textureTrace.Reset();
1173 Property::Map attributes;
1174 DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, DevelImageVisual::Action::RELOAD, attributes );
1176 tet_infoline( "Perform RELOAD action. should reload Image and generate a texture" );
1177 DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
1179 application.SendNotification();
1180 application.Render();
1181 DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION );
1182 textureTrace.Reset();
1184 tet_infoline( "Adding control to stage will in turn add the visual to the stage" );
1186 Stage::GetCurrent().Add( dummyControl );
1187 application.SendNotification();
1188 application.Render();
1189 tet_infoline( "No change in textures could occurs as already loaded and cached texture will be used" );
1191 DALI_TEST_EQUALS( textureTrace.CountMethod("DeleteTextures"), 0, TEST_LOCATION );
1192 DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION );
1193 textureTrace.Reset();