2 * Copyright (c) 2016-2016 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.
20 #include <dali-toolkit-test-suite-utils.h>
21 #include <dali-toolkit/devel-api/builder/builder.h>
22 #include <dali/integration-api/events/touch-event-integ.h>
23 #include <dali-toolkit/dali-toolkit.h>
24 #include <test-button.h>
25 #include <test-animation-data.h>
27 #define STRINGIFY(A)#A
30 using namespace Toolkit;
32 namespace BuilderControlProperty
37 INTEGER_PROPERTY = Toolkit::Control::CONTROL_PROPERTY_END_INDEX + 1,
48 return Toolkit::Control::New();
51 int gSetPropertyCalledCount = 0;
53 void SetProperty( BaseObject* object, Property::Index propertyIndex, const Property::Value& value )
55 ++gSetPropertyCalledCount;
58 Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex )
60 return Property::Value();
63 } // unnamed namespace
66 Dali::TypeRegistration typeRegistration( "BuilderControl", typeid( Toolkit::Control ), Create );
68 Dali::PropertyRegistration propertyInteger( typeRegistration, "integerProperty", INTEGER_PROPERTY, Property::INTEGER, &SetProperty, &GetProperty );
69 Dali::PropertyRegistration propertyMatrix3( typeRegistration, "matrix3Property", MATRIX3_PROPERTY, Property::MATRIX3, &SetProperty, &GetProperty );
70 Dali::PropertyRegistration propertyMatrix( typeRegistration, "matrixProperty", MATRIX_PROPERTY, Property::MATRIX, &SetProperty, &GetProperty );
71 Dali::PropertyRegistration propertyNone( typeRegistration, "noneProperty", NONE_PROPERTY, Property::NONE, &SetProperty, &GetProperty );
78 std::string ReplaceQuotes(const std::string &in_s)
81 // wrong as no embedded quote but had regex link problems
82 std::replace(s.begin(), s.end(), '\'', '"');
88 BuilderFunctor( bool& called ) : mCalled( called )
105 void builder_startup(void)
107 test_return_value = TET_UNDEF;
110 void builder_cleanup(void)
112 test_return_value = TET_PASS;
115 int UtcDaliBuilderQuitSignal(void)
117 ToolkitTestApplication application;
119 // JSON with a quit event when the actor is touched
124 "\"type\": \"Layer\","
125 "\"size\": [100,100,1],"
126 "\"parentOrigin\": \"TOP_LEFT\","
127 "\"anchorPoint\": \"TOP_LEFT\","
128 "\"maximumSize\": [100,100],"
129 "\"orientation\": [10,10,10,10],"
130 "\"clippingBox\": [10,10,10,10],"
132 "\"name\": \"touch\","
133 "\"action\": \"quit\""
138 Builder builder = Builder::New();
139 builder.LoadFromString( json );
140 builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
142 // Connect to builder's quit signal
143 bool functorCalled( false );
144 builder.QuitSignal().Connect( &application, BuilderFunctor( functorCalled ) );
147 application.SendNotification();
148 application.Render();
150 // Emit touch event and check that our quit method is called
151 Integration::TouchEvent touchEvent;
152 Integration::Point point;
153 point.SetState( PointState::DOWN );
154 point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
155 touchEvent.points.push_back( point );
156 application.ProcessEvent( touchEvent );
157 DALI_TEST_CHECK( functorCalled );
163 int UtcDaliBuilderAnimationP(void)
165 ToolkitTestApplication application;
167 // JSON with a quit event when the actor is touched
172 " \"ALPHA_FUNCTION\":\"EASE_IN_OUT\""
178 " \"points\":[ [-150, -50, 0], [0.0,70.0,0.0], [190.0,-150.0,0.0] ],"
179 " \"curvature\":0.35"
185 " \"endAction\": \"BAKE\","
186 " \"disconnectAction\": \"BAKE\","
189 " \"actor\": \"greeting\","
190 " \"property\": \"position\","
191 " \"value\": [300, 300, -1000],"
192 " \"alphaFunction\": \"{ALPHA_FUNCTION}\","
193 " \"relative\": true,"
200 " \"actor\": \"greeting\","
201 " \"property\": \"visible\","
202 " \"alphaFunction\": \"LINEAR\","
206 " \"actor\": \"greeting\","
207 " \"property\": \"sizeWidth\","
208 " \"alphaFunction\": \"REVERSE\","
212 " \"actor\": \"greeting\","
213 " \"property\": \"orientation\","
214 " \"alphaFunction\": \"EASE_IN\","
215 " \"value\": [10.0,20.0,30.0]"
218 " \"actor\": \"greeting\","
219 " \"property\": \"orientation\","
220 " \"alphaFunction\": \"EASE_OUT\","
221 " \"value\": [0.0, 0.0, 0.0, 1.0]"
224 " \"actor\": \"greeting\","
225 " \"property\": \"orientation\","
226 " \"alphaFunction\": \"EASE_IN_OUT\","
227 " \"value\": [0.0, 0.0, 0.0, 1.0]"
230 " \"actor\": \"greeting\","
231 " \"property\": \"orientation\","
232 " \"alphaFunction\": \"EASE_IN_SINE\","
233 " \"value\": [0.0, 0.0, 0.0, 1.0]"
236 " \"actor\": \"greeting\","
237 " \"property\": \"orientation\","
238 " \"alphaFunction\": \"EASE_OUT_SINE\","
239 " \"value\": [0.0, 0.0, 0.0, 1.0]"
242 " \"actor\": \"greeting\","
243 " \"property\": \"orientation\","
244 " \"alphaFunction\": \"EASE_IN_OUT_SINE\","
245 " \"value\": [0.0, 0.0, 0.0, 1.0]"
248 " \"actor\": \"greeting\","
249 " \"property\": \"orientation\","
250 " \"alphaFunction\": \"BOUNCE\","
251 " \"value\": [0.0, 0.0, 0.0, 1.0]"
254 " \"actor\": \"greeting\","
255 " \"property\": \"orientation\","
256 " \"alphaFunction\": \"SIN\","
257 " \"value\": [0.0, 0.0, 0.0, 1.0]"
260 " \"actor\": \"greeting\","
261 " \"property\": \"orientation\","
262 " \"alphaFunction\": \"EASE_OUT_BACK\","
263 " \"value\": [0.0, 0.0, 0.0, 1.0]"
267 " \"pathAnimation\": {"
268 " \"duration\": 3.0,"
269 " \"endAction\": \"DISCARD\","
270 " \"disconnectAction\": \"BAKE_FINAL\","
271 " \"properties\": [{"
272 " \"actor\": \"greeting\","
273 " \"path\":\"path0\","
274 " \"forward\":[1,0,0],"
275 " \"alphaFunction\": \"EASE_IN_OUT\","
284 " \"name\": \"greeting\","
285 " \"type\": \"TextLabel\","
286 " \"text\": \"Touch me\","
287 " \"styles\": [\"basicText\"],"
288 " \"position\": [0, -120, 0],"
289 " \"size\": [200, 200, 1],"
290 " \"orientation\": [0, 0, 30],"
292 " \"name\": \"touch\","
293 " \"action\": \"play\","
294 " \"animation\": \"animate\""
299 Builder builder = Builder::New();
300 builder.LoadFromString( json );
301 builder.AddActors( Stage::GetCurrent().GetRootLayer() );
303 Animation anim = builder.CreateAnimation("animate");
305 DALI_TEST_CHECK( anim );
308 map["ALPHA_FUNCTION"] = "EASE_IN_SQUARE";
309 anim = builder.CreateAnimation("animate", map);
311 DALI_TEST_CHECK( anim );
313 anim = builder.CreateAnimation("pathAnimation");
315 DALI_TEST_CHECK( anim );
318 // Emit touch event and check that our quit method is called
319 Integration::TouchEvent touchEvent;
320 Integration::Point point;
321 point.SetState( PointState::DOWN );
322 point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
323 touchEvent.points.push_back( point );
324 application.ProcessEvent( touchEvent );
327 application.SendNotification();
328 application.Render();
334 int UtcDaliBuilderAnimationN(void)
336 ToolkitTestApplication application;
338 // JSON with a quit event when the actor is touched
343 " \"TEXT\": \"Touch Me\","
344 " \"NAME\": \"greeting\" "
350 " \"points\":[ [-150, -50, 0], [0.0,70.0,0.0], [190.0,-150.0,0.0] ],"
351 " \"curvature\":0.35"
357 " \"endAction\": \"BAKE\","
358 " \"disconnectAction\": \"BAKE\","
361 " \"actor\": \"{NAME}\","
362 " \"property\": \"positioninvalid\","
363 " \"value\": [300, 300, -1000],"
364 " \"alphaFunction\": \"EASE_IN_OUT\","
365 " \"relative\": true,"
375 " \"endAction\": \"BAKE\","
376 " \"disconnectAction\": \"BAKE\","
379 " \"actor\": \"{NAME}\","
380 " \"property\": \"positioninvalid\","
381 " \"value\": [300, 300, -1000],"
382 " \"alphaFunction\": \"EGGS_OVER_EASY\","
383 " \"relative\": true,"
391 " \"pathAnimation\": {"
392 " \"duration\": 3.0,"
393 " \"endAction\": \"DISCARD\","
394 " \"disconnectAction\": \"BAKE_FINAL\","
395 " \"properties\": [{"
396 " \"actor\": \"greeting\","
397 " \"path\":\"pathDoesntExist\","
398 " \"forward\":[1,0,0],"
399 " \"alphaFunction\": \"EASE_IN_OUT\","
408 " \"name\": \"greeting\","
409 " \"type\": \"TextLabel\","
410 " \"text\": \"Touch me\","
411 " \"styles\": [\"basicText\"],"
412 " \"position\": [0, -120, 0],"
413 " \"size\": [200, 200, 1],"
414 " \"orientation\": [0, 0, 30],"
416 " \"name\": \"touch\","
417 " \"action\": \"play\","
418 " \"animation\": \"animate\""
422 " \"name\": \"greeting2\","
423 " \"type\": \"TextLabel\","
424 " \"text\": \"Touch me\""
429 Builder builder = Builder::New();
430 builder.LoadFromString( json );
431 builder.AddActors( Stage::GetCurrent().GetRootLayer() );
433 Animation anim = builder.CreateAnimation("animate");
435 // log warning line coverage
436 anim = builder.CreateAnimation("pathAnimation");
437 DALI_TEST_CHECK(anim);
439 anim = builder.CreateAnimation("animate");
440 DALI_TEST_CHECK(anim);
442 anim = builder.CreateAnimation("animate2");
443 DALI_TEST_CHECK(anim);
445 // create referencing a different actor aka animation templates
447 map["NAME"] = "greeting2";
448 anim = builder.CreateAnimation("animate2", map);
449 DALI_TEST_CHECK(anim);
451 // alternative actor to use for FindChildByName
452 anim = builder.CreateAnimation("animate2", Dali::Stage::GetCurrent().GetRootLayer());
453 DALI_TEST_CHECK(anim);
455 // alternative actor to use for FindChildByName
456 anim = builder.CreateAnimation("animate2", map, Dali::Stage::GetCurrent().GetRootLayer());
457 DALI_TEST_CHECK(anim);
464 int UtcDaliBuilderConstantsP(void)
466 ToolkitTestApplication application;
468 // JSON with a quit event when the actor is touched
473 " \"IMAGE_PATH\": \"apath\","
475 " \"ANCHOR\": \"TOP_LEFT\","
476 " \"PADDING\": [1,2,3,4]"
480 " \"type\": \"ImageView\","
481 " \"name\": \"{NAME}\","
482 " \"size\": [100,100,1],"
483 " \"parentOrigin\": \"TOP_LEFT\","
484 " \"anchorPoint\": \"{ANCHOR}\","
485 " \"padding\": \"{PADDING}\","
486 " \"image\": { \"url\": \"dir/{IMAGE_PATH}\" },"
487 " \"sizeWidth\": \"{WIDTH}\","
489 " \"name\": \"touch\","
490 " \"action\": \"quit\""
496 Builder builder = Builder::New();
497 builder.LoadFromString( json );
499 builder.AddConstant( "NAME", "image" );
501 Property::Map map = builder.GetConstants();
503 Dali::Property::Value* pValue = map.Find( "NAME" );
505 DALI_TEST_CHECK( pValue );
507 pValue = map.Find( "IMAGE_PATH" );
509 DALI_TEST_CHECK( pValue );
511 Dali::Property::Value value = builder.GetConstant( "WIDTH" );
513 DALI_TEST_CHECK( value.GetType() != Property::NONE );
515 builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
516 DALI_TEST_CHECK( builder );
518 Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("image");
519 DALI_TEST_CHECK( actor );
524 int UtcDaliBuilderTemplatesAndStylesP(void)
526 ToolkitTestApplication application;
528 // JSON with a quit event when the actor is touched
533 " \"SIZE\": [10,20,30]"
537 " \"imageStyle\": \n"
539 " \"color\": [1,0,0,1],\n"
541 " \"childImage\": {\n"
542 " \"color\": \"34\"\n"
549 " \"imageViewTemplate\": { \n"
550 " \"type\": \"ImageView\",\n"
551 " \"styles\": [\"imageStyle\"]\n"
553 " \"imageTree\": { \n"
554 " \"type\": \"ImageView\",\n"
555 " \"styles\": [\"imageStyle\"],\n"
556 " \"name\": \"image\",\n"
557 " \"size\": \"{SIZE}\",\n"
559 " \"name\": \"touch\",\n"
560 " \"action\": \"quit\"\n"
564 " \"type\":\"ImageView\",\n"
565 " \"name\":\"childImage\", \n"
575 " \"type\":\"imageViewTemplate\",\n"
576 " \"name\":\"childImage2\"\n"
583 " \"type\": \"imageTree\","
584 " \"size\": [100,100,1]"
589 std::string stylejson(
591 " \"color\": [1,0,0,1],\n"
593 " \"childImage\": {\n"
594 " \"color\": \"#344353\"\n"
600 std::string templatejson(
602 " \"type\": \"ImageView\",\n"
603 " \"styles\": [\"imageStyle\"],\n"
604 " \"name\": \"image\",\n"
605 " \"size\": \"{SIZE}\",\n"
607 " \"name\": \"touch\",\n"
608 " \"action\": \"quit\"\n"
612 " \"type\":\"ImageView\",\n"
613 " \"name\":\"childImage\" \n"
619 Builder builder = Builder::New();
620 builder.LoadFromString( json );
622 ImageView actor = ImageView::DownCast( builder.Create( "imageTree" ) );
623 DALI_TEST_CHECK( actor );
625 Dali::Property::Map map;
626 map["SIZE"] = Vector3(100,100,1);
627 actor = ImageView::DownCast( builder.Create( "imageTree", map ) );
628 DALI_TEST_CHECK( actor );
630 // create from json snippet
631 actor = ImageView::DownCast( builder.CreateFromJson( templatejson ) );
632 DALI_TEST_CHECK( actor );
635 // NB: already applied in create
636 DALI_TEST_CHECK( builder.ApplyStyle( "imageStyle", actor ) );
638 // apply from json snippet
639 DALI_TEST_CHECK( builder.ApplyFromJson( actor, stylejson ) );
644 int UtcDaliBuilderRenderTasksP(void)
646 ToolkitTestApplication application;
648 // JSON with a quit event when the actor is touched
654 " \"sourceActor\": \"image\",\n"
655 " \"cameraActor\": \"camera\" \n"
661 " \"type\": \"CameraActor\",\n"
662 " \"name\": \"camera\"\n"
665 " \"type\": \"ImageView\",\n"
666 " \"name\": \"image\",\n"
667 " \"size\": [100,100,1],\n"
669 " \"name\": \"touch\",\n"
670 " \"action\": \"quit\"\n"
674 " \"type\":\"ImageView\",\n"
675 " \"name\":\"childImage\" \n"
683 Builder builder = Builder::New();
684 builder.LoadFromString( json );
686 unsigned int count = Stage::GetCurrent().GetRenderTaskList().GetTaskCount();
689 builder.CreateRenderTask( "task0" );
691 DALI_TEST_CHECK( count <
692 Stage::GetCurrent().GetRenderTaskList().GetTaskCount() );
697 int UtcDaliBuilderChildActionP(void)
699 ToolkitTestApplication application;
701 // JSON with a quit event when the actor is touched
706 " \"type\": \"Actor\",\n"
707 " \"name\": \"actor\",\n"
708 " \"size\": [100,100,1],\n"
709 " \"parentOrigin\": \"TOP_LEFT\",\n"
710 " \"anchorPoint\": \"TOP_LEFT\",\n"
712 " \"type\": \"Actor\",\n"
713 " \"name\": \"subActor\"\n"
716 " \"name\": \"touch\",\n"
717 " \"action\": \"hide\",\n"
718 " \"actor\": \"actor\",\n"
719 " \"childActor\": \"subActor\"\n"
725 Builder builder = Builder::New();
726 builder.LoadFromString( json );
727 builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
730 application.SendNotification();
731 application.Render();
733 // Emit touch event and check that our quit method is called
734 Integration::TouchEvent touchEvent;
735 Integration::Point point;
736 point.SetState( PointState::DOWN );
737 point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
738 touchEvent.points.push_back( point );
739 application.ProcessEvent( touchEvent );
742 application.SendNotification();
743 application.Render();
745 Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("subActor");
746 DALI_TEST_CHECK( actor );
748 DALI_TEST_CHECK( !actor.IsVisible() );
753 int UtcDaliBuilderSetPropertyActionP(void)
755 ToolkitTestApplication application;
757 // JSON with a quit event when the actor is touched
762 " \"type\": \"Actor\",\n"
763 " \"name\": \"actor\",\n"
764 " \"size\": [100,100,1],\n"
765 " \"parentOrigin\": \"TOP_LEFT\",\n"
766 " \"anchorPoint\": \"TOP_LEFT\",\n"
768 " \"type\": \"Actor\",\n"
769 " \"name\": \"subActor\"\n"
772 " \"name\": \"touch\",\n"
773 " \"action\": \"set\",\n"
774 " \"actor\": \"subActor\",\n"
775 " \"property\": \"visible\",\n"
776 " \"value\": false\n"
782 Builder builder = Builder::New();
783 builder.LoadFromString( json );
784 builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
787 application.SendNotification();
788 application.Render();
790 // Emit touch event and check that our quit method is called
791 Integration::TouchEvent touchEvent;
792 Integration::Point point;
793 point.SetState( PointState::DOWN );
794 point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
795 touchEvent.points.push_back( point );
796 application.ProcessEvent( touchEvent );
799 application.SendNotification();
800 application.Render();
802 Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("subActor");
803 DALI_TEST_CHECK( actor );
805 DALI_TEST_CHECK( !actor.IsVisible() );
810 int UtcDaliBuilderGenericActionP(void)
812 ToolkitTestApplication application;
814 // JSON with a quit event when the actor is touched
819 " \"type\": \"Actor\",\n"
820 " \"name\": \"actor\",\n"
821 " \"size\": [100,100,1],\n"
822 " \"parentOrigin\": \"TOP_LEFT\",\n"
823 " \"anchorPoint\": \"TOP_LEFT\",\n"
825 " \"type\": \"Actor\",\n"
826 " \"name\": \"subActor\"\n"
829 " \"name\": \"touch\",\n"
830 " \"action\": \"hide\"\n"
836 Builder builder = Builder::New();
837 builder.LoadFromString( json );
838 builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
841 application.SendNotification();
842 application.Render();
844 // Emit touch event and check that our quit method is called
845 Integration::TouchEvent touchEvent;
846 Integration::Point point;
847 point.SetState( PointState::DOWN );
848 point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
849 touchEvent.points.push_back( point );
850 application.ProcessEvent( touchEvent );
853 application.SendNotification();
854 application.Render();
856 Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("actor");
857 DALI_TEST_CHECK( actor );
859 DALI_TEST_CHECK( !actor.IsVisible() );
864 int UtcDaliBuilderPropertyNotificationP(void)
866 ToolkitTestApplication application;
868 // JSON with a quit event when the actor is touched
873 " \"type\": \"Actor\",\n"
874 " \"name\": \"actor\",\n"
875 " \"size\": [100,100,1],\n"
876 " \"parentOrigin\": \"TOP_LEFT\",\n"
877 " \"anchorPoint\": \"TOP_LEFT\",\n"
879 " \"type\": \"Actor\",\n"
880 " \"name\": \"subActor\"\n"
883 " \"name\": \"touch\",\n"
884 " \"action\": \"hide\"\n"
886 " \"notifications\": [{\n"
887 " \"property\": \"visible\",\n"
888 " \"condition\": \"False\",\n"
889 " \"action\": \"show\"\n"
892 " \"property\": \"positionX\",\n"
893 " \"condition\": \"LessThan\",\n"
895 " \"action\": \"show\"\n"
898 " \"property\": \"positionY\",\n"
899 " \"condition\": \"GreaterThan\",\n"
900 " \"arg0\": 200.0,\n"
901 " \"action\": \"show\"\n"
904 " \"property\": \"positionZ\",\n"
905 " \"condition\": \"Inside\",\n"
908 " \"action\": \"show\"\n"
911 " \"property\": \"positionZ\",\n"
912 " \"condition\": \"Outside\",\n"
915 " \"action\": \"show\"\n"
921 Builder builder = Builder::New();
922 builder.LoadFromString( json );
923 builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
926 application.SendNotification();
927 application.Render();
929 // Emit touch event and check that our quit method is called
930 Integration::TouchEvent touchEvent;
931 Integration::Point point;
932 point.SetState( PointState::DOWN );
933 point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
934 touchEvent.points.push_back( point );
935 application.ProcessEvent( touchEvent );
938 application.SendNotification();
939 application.Render();
942 application.SendNotification();
943 application.Render();
945 Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("actor");
946 DALI_TEST_CHECK( actor );
948 DALI_TEST_CHECK( actor.IsVisible() );
953 int UtcDaliBuilderPropertyNotificationN(void)
955 ToolkitTestApplication application;
957 // JSON with a quit event when the actor is touched
962 " \"type\": \"Actor\",\n"
963 " \"notifications\": [{\n"
964 " \"property\": \"visible\",\n"
965 " \"condition\": \"ErrorCondition\",\n"
966 " \"action\": \"show\"\n"
974 Builder builder = Builder::New();
975 builder.LoadFromString( json );
976 builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
977 DALI_TEST_CHECK( false );
981 DALI_TEST_CHECK( true );
989 int UtcDaliBuilderCustomPropertyP(void)
991 ToolkitTestApplication application;
993 // JSON with a quit event when the actor is touched
998 " \"imageTree\": { \n"
999 " \"type\": \"ImageView\",\n"
1000 " \"name\": \"image\",\n"
1001 " \"size\": [100,100,1],\n"
1002 " \"signals\": [{\n"
1003 " \"name\": \"touch\",\n"
1004 " \"action\": \"quit\"\n"
1006 " \"properties\": {\n"
1007 " \"newproperty\": true\n"
1009 " \"animatableProperties\": {\n"
1010 " \"newAnimatableproperty\": 3\n"
1014 " \"type\":\"ImageView\",\n"
1015 " \"name\":\"childImage\" \n"
1023 Builder builder = Builder::New();
1024 builder.LoadFromString( json );
1026 ImageView actor = ImageView::DownCast( builder.Create( "imageTree" ) );
1027 DALI_TEST_CHECK( actor );
1029 // NB: already applied in create
1030 Property::Index index = actor.GetPropertyIndex("newproperty");
1031 DALI_TEST_CHECK( Property::INVALID_INDEX != index );
1032 Property::Value value = actor.GetProperty(index);
1033 DALI_TEST_CHECK( value.Get<bool>() == true );
1035 index = actor.GetPropertyIndex("newAnimatableproperty");
1036 DALI_TEST_CHECK( Property::INVALID_INDEX != index );
1037 value = actor.GetProperty(index);
1038 DALI_TEST_CHECK( value.Get<int>() == 3 );
1043 int UtcDaliBuilderCustomShaderP(void)
1045 ToolkitTestApplication application;
1047 // JSON with a quit event when the actor is touched
1052 " \"type\": \"ImageView\",\n"
1053 " \"name\": \"Image1\",\n"
1054 " \"position\": [\n"
1055 " 0.40461349487305,\n"
1059 " \"parentOrigin\": [0.5, 0.5, 0.5],\n"
1060 " \"size\": [200, 200, 0],\n"
1061 " \"effect\": \"Ripple2D\",\n"
1063 " \"url\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\",\n"
1064 " \"desiredWidth\": 200,\n"
1065 " \"desiredHeight\": 80,\n"
1067 " \"fragmentShader\": \"precision mediump float;\\nuniform sampler2D sTexture;\\nuniform vec4 uColor;\\nuniform float uAmplitude;\\nuniform float uTime;\\nvarying vec2 vTexCoord;\\nvoid main()\\n{\\n highp vec2 pos = -1.0 + 2.0 * vTexCoord;\\n highp float len = length(pos);\\n highp vec2 texCoord = vTexCoord + pos/len * sin( len * 12.0 - uTime * 4.0 ) * uAmplitude;\\n gl_FragColor = texture2D(sTexture, texCoord) * uColor;}\\n\\n\"\n"
1070 " \"customAnimatableProperties\": {\n"
1071 " \"uAmplitude\": 0.02,\n"
1076 " \"name\": \"onStage\",\n"
1077 " \"action\": \"play\",\n"
1078 " \"animation\": \"Animation_1\"\n"
1083 " \"animations\": {\n"
1084 " \"Animation_1\": {\n"
1086 " \"properties\": [\n"
1088 " \"actor\": \"Image1\",\n"
1089 " \"property\": \"uTime\",\n"
1090 " \"value\": 10.0,\n"
1091 " \"alphaFunction\": \"LINEAR\",\n"
1092 " \"timePeriod\": {\n"
1094 " \"duration\": 10.0\n"
1104 Builder builder = Builder::New();
1105 builder.LoadFromString( json );
1107 builder.AddActors ( "stage", Stage::GetCurrent().GetRootLayer() );
1109 // Render and notify
1110 application.SendNotification();
1111 application.Render();
1113 Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("Image1");
1116 DALI_TEST_CHECK( actor );
1122 int UtcDaliBuilderLoadFromStringN(void)
1124 ToolkitTestApplication application;
1126 // JSON with a quit event when the actor is touched
1128 "asdfsadf dsf asdf asdf {"
1131 "\"type\": \"Actor\","
1132 "\"size\": [100,100,1],"
1133 "\"parentOrigin\": \"TOP_LEFT\","
1134 "\"anchorPoint\": \"TOP_LEFT\","
1136 "\"name\": \"touch\","
1137 "\"action\": \"quit\""
1142 Builder builder = Builder::New();
1144 bool assert1 = false;
1148 builder.LoadFromString( json );
1150 catch( Dali::DaliException& e )
1152 DALI_TEST_PRINT_ASSERT( e );
1153 DALI_TEST_EQUALS(e.condition, "!\"Cannot parse JSON\"", TEST_LOCATION);
1157 DALI_TEST_CHECK( assert1 );
1163 int UtcDaliBuilderAddActorsP(void)
1165 ToolkitTestApplication application;
1167 // JSON with a quit event when the actor is touched
1170 " \"arbitarysection\":\n"
1172 " \"type\": \"Actor\",\n"
1173 " \"name\": \"actor\",\n"
1174 " \"size\": [100,100,1],\n"
1175 " \"parentOrigin\": \"TOP_LEFT\",\n"
1176 " \"anchorPoint\": \"TOP_LEFT\",\n"
1178 " \"type\": \"Actor\",\n"
1179 " \"name\": \"subActor\",\n"
1180 " \"visible\": false\n"
1182 " \"signals\": [{\n"
1183 " \"name\": \"touch\",\n"
1184 " \"action\": \"hide\",\n"
1185 " \"actor\": \"actor\",\n"
1186 " \"childActor\": \"subActor\"\n"
1192 Builder builder = Builder::New();
1193 builder.LoadFromString( json );
1194 builder.AddActors ( "arbitarysection", Stage::GetCurrent().GetRootLayer() );
1196 // Render and notify
1197 application.SendNotification();
1198 application.Render();
1200 Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("subActor");
1201 DALI_TEST_CHECK( actor );
1203 DALI_TEST_CHECK( !actor.IsVisible() );
1208 int UtcDaliBuilderFrameBufferP(void)
1210 ToolkitTestApplication application;
1212 // JSON with a quit event when the actor is touched
1217 " \"FB_WIDTH\": 200.0,\n"
1218 " \"FB_HEIGHT\": 200.0,\n"
1219 " \"FB_SIZE\": [200,200],\n"
1220 " \"FB_ASPECT_RATIO\": 1\n"
1224 " \"type\": \"ImageView\",\n"
1225 " \"name\": \"fbOnStage\",\n"
1226 " \"position\": [\n"
1227 " 0.40461349487305,\n"
1231 " \"parentOrigin\": [0.5, 0.5, 0.5],\n"
1232 " \"size\": [300, 300, 0],\n"
1233 " \"image\": \"fb0\",\n"
1234 " \"clearColor\": [1,0,0,1]\n"
1237 " \"type\": \"ImageView\",\n"
1238 " \"name\": \"Image1\",\n"
1239 " \"size\": [200, 200, 0],\n"
1240 " \"parentOrigin\": [0.5, 0.5, 0.5],\n"
1241 " \"effect\": \"Ripple2D\",\n"
1243 " \"url\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\"\n"
1247 " \"name\": \"onStage\",\n"
1248 " \"action\": \"play\",\n"
1249 " \"animation\": \"Animation_1\"\n"
1254 " \"type\":\"CameraActor\",\n"
1255 " \"name\":\"fbCam\",\n"
1256 " \"aspectRatio\": \"{FB_ASPECT_RATIO}\",\n"
1257 " \"projectionMode\": \"PERSPECTIVE_PROJECTION\",\n"
1258 " \"fieldOfView\": 0.785,\n"
1259 " \"invertYAxis\": true\n"
1262 " \"frameBufferImages\":\n"
1266 " \"type\": \"FrameBufferImage\",\n"
1267 " \"width\": { \"typeCast\":\"float\", \"value\":\"{FB_WIDTH}\" },\n"
1268 " \"height\": { \"typeCast\":\"float\", \"value\":\"{FB_HEIGHT}\" }\n"
1271 " \"renderTasks\":\n"
1276 " \"sourceActor\": \"fbOnStage\"\n"
1279 " \"sourceActor\": \"Image1\",\n"
1280 " \"targetFrameBuffer\": \"fb0\",\n"
1281 " \"viewportSize\":\"{FB_SIZE}\",\n"
1282 " \"cameraActor\":\"fbCam\"\n"
1287 " \"animations\": {\n"
1288 " \"Animation_1\": {\n"
1290 " \"properties\": [\n"
1292 " \"actor\": \"Image1\",\n"
1293 " \"property\": \"uTime\",\n"
1294 " \"value\": 10.0,\n"
1295 " \"alphaFunction\": \"LINEAR\",\n"
1296 " \"timePeriod\": {\n"
1298 " \"duration\": 10.0\n"
1300 " \"gui-builder-timeline-color\": \"#8dc0da\"\n"
1307 Builder builder = Builder::New();
1309 // frame buffer coverage
1310 builder.LoadFromString( json );
1312 // Render and notify
1313 application.SendNotification();
1314 application.Render();
1316 Dali::FrameBufferImage frameBuffer = builder.GetFrameBufferImage( "fb0" );
1317 DALI_TEST_CHECK( frameBuffer );
1319 Dali::FrameBufferImage frameBuffer2 = builder.GetFrameBufferImage( "fb0" );
1320 DALI_TEST_CHECK( frameBuffer2 );
1321 DALI_TEST_CHECK( frameBuffer == frameBuffer2 );
1323 DALI_TEST_CHECK( true );
1328 int UtcDaliBuilderPathConstraintsP(void)
1330 ToolkitTestApplication application;
1332 // JSON with a quit event when the actor is touched
1337 " \"FB_WIDTH\": 200.0,\n"
1338 " \"FB_HEIGHT\": 200.0,\n"
1339 " \"FB_SIZE\": [200,200],\n"
1340 " \"FB_ASPECT_RATIO\": 1\n"
1344 " \"type\": \"ImageView\",\n"
1345 " \"name\": \"Image1\",\n"
1346 " \"size\": [200, 200, 0],\n"
1347 " \"parentOrigin\": [0.5, 0.5, 0.5],\n"
1348 " \"effect\": \"Ripple2D\",\n"
1350 " \"url\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\"\n"
1354 " \"name\": \"onStage\",\n"
1355 " \"action\": \"play\",\n"
1356 " \"animation\": \"pathAnimation\"\n"
1359 " \"name\": \"onStage\",\n"
1360 " \"action\": \"applyConstraint\",\n"
1361 " \"constrainer\": \"constrainer0\",\n"
1362 " \"properties\":\n"
1365 " \"source\": \"Image1\",\n"
1366 " \"sourceProperty\": \"positionX\",\n"
1367 " \"target\": \"Image1\",\n"
1368 " \"targetProperty\": \"colorRed\",\n"
1369 " \"range\": [-300,300]\n"
1374 " \"name\": \"onStage\",\n"
1375 " \"action\": \"applyConstraint\",\n"
1376 " \"constrainer\": \"constrainer1\",\n"
1377 " \"properties\":\n"
1380 " \"source\": \"Image1\",\n"
1381 " \"sourceProperty\": \"positionX\",\n"
1382 " \"target\": \"Image1\",\n"
1383 " \"targetProperty\": \"colorBlue\",\n"
1384 " \"range\": [-300,300]\n"
1389 " \"name\": \"offStage\",\n"
1390 " \"action\": \"removeConstraints\",\n"
1391 " \"constrainer\": \"constrainer0\",\n"
1392 " \"properties\":\n"
1395 " \"source\": \"Image1\",\n"
1396 " \"sourceProperty\": \"positionX\",\n"
1397 " \"target\": \"Image1\",\n"
1398 " \"targetProperty\": \"colorRed\",\n"
1399 " \"range\": [-300,300]\n"
1404 " \"name\": \"offStage\",\n"
1405 " \"action\": \"removeConstraints\",\n"
1406 " \"constrainer\": \"constrainer1\",\n"
1407 " \"properties\":\n"
1410 " \"source\": \"Image1\",\n"
1411 " \"sourceProperty\": \"positionX\",\n"
1412 " \"target\": \"Image1\",\n"
1413 " \"targetProperty\": \"colorBlue\",\n"
1414 " \"range\": [-300,300]\n"
1425 " \"points\":[ [-150, -50, 0], [0.0,70.0,0.0], [190.0,-150.0,0.0] ],\n"
1426 " \"curvature\":0.35\n"
1429 " \"constrainers\":\n"
1431 " \"constrainer0\":\n"
1433 " \"type\": \"PathConstrainer\",\n"
1434 " \"points\": [ [0, 0, 0], [0,0,0], [0,0,0] ],\n"
1435 " \"controlPoints\": [ [0, 0, 0], [0,0,0], [0,0,0] ]\n"
1437 " \"constrainer1\":\n"
1439 " \"type\": \"LinearConstrainer\",\n"
1440 " \"value\": [ 0, 0, 0 ]\n"
1443 " \"animations\": {\n"
1444 " \"pathAnimation\": {\n"
1445 " \"duration\": 3.0,\n"
1446 " \"properties\":\n"
1448 " \"actor\": \"Image1\",\n"
1449 " \"path\":\"path0\",\n"
1450 " \"forward\":[1,0,0],\n"
1451 " \"alphaFunction\": \"EASE_IN_OUT\",\n"
1452 " \"timePeriod\": {\n"
1454 " \"duration\": 3\n"
1458 " \"actor\": \"Image1\",\n"
1459 " \"property\": \"uTime\",\n"
1460 " \"value\": 10.0,\n"
1461 " \"alphaFunction\": \"LINEAR\",\n"
1462 " \"timePeriod\": {\n"
1464 " \"duration\": 10.0\n"
1466 " \"gui-builder-timeline-color\": \"#8dc0da\"\n"
1469 " \"Animation_1\": {\n"
1471 " \"properties\": [\n"
1473 " \"actor\": \"Image1\",\n"
1474 " \"property\": \"uTime\",\n"
1475 " \"value\": 10.0,\n"
1476 " \"alphaFunction\": \"LINEAR\",\n"
1477 " \"timePeriod\": {\n"
1479 " \"duration\": 10.0\n"
1481 " \"gui-builder-timeline-color\": \"#8dc0da\"\n"
1488 Builder builder = Builder::New();
1490 // frame buffer coverage
1491 builder.LoadFromString( json );
1493 // Render and notify
1494 application.SendNotification();
1495 application.Render();
1497 Dali::Path path = builder.GetPath( "path0" );
1498 DALI_TEST_CHECK( path );
1500 Dali::Path path2 = builder.GetPath( "path0" );
1501 DALI_TEST_CHECK( path2 );
1502 DALI_TEST_CHECK( path == path2 );
1504 Dali::PathConstrainer constrainer0 = builder.GetPathConstrainer( "constrainer0" );
1505 DALI_TEST_CHECK( constrainer0 );
1507 Dali::PathConstrainer constrainer0_2 = builder.GetPathConstrainer( "constrainer0" );
1508 DALI_TEST_CHECK( constrainer0_2 );
1509 DALI_TEST_CHECK( constrainer0 == constrainer0_2 );
1511 Dali::LinearConstrainer constrainer1 = builder.GetLinearConstrainer( "constrainer1" );
1512 DALI_TEST_CHECK( constrainer1 );
1514 Dali::LinearConstrainer constrainer1_2 = builder.GetLinearConstrainer( "constrainer1" );
1515 DALI_TEST_CHECK( constrainer1 == constrainer1_2 );
1519 Actor actor = Actor::New();
1520 Stage::GetCurrent().Add( actor );
1521 builder.AddActors( actor );
1523 // Render and notify
1524 application.SendNotification();
1525 application.Render();
1527 actor.GetChildAt( 0 ).Unparent();
1532 #define CHECK_MAP_ELEMENT( xMap, xKey, xType, xPropType, xExpected, xLocation ) \
1534 Property::Value* value = xMap->Find( xKey ); \
1535 DALI_TEST_EQUALS( value==NULL, false, xLocation); \
1536 if( value != NULL ) \
1538 DALI_TEST_EQUALS( value->GetType(), xPropType, xLocation ); \
1540 value->Get(result); \
1541 DALI_TEST_EQUALS( result, xExpected, TEST_LOCATION ); \
1542 std::ostringstream oss; \
1543 oss << "Animation element " << xKey << "= " << result << std::endl; \
1544 tet_printf( oss.str().c_str() ); \
1548 tet_printf("Can't find map element " xKey "\n"); \
1553 int UtcDaliBuilderMapping01(void)
1555 ToolkitTestApplication application;
1561 " \"buttonPressFadeOut\":{\n"
1562 " \"alphaFunction\":\"EASE_OUT\",\n"
1563 " \"timePeriod\":{\n"
1565 " \"duration\":0.4\n"
1568 " \"buttonPressFadeIn\":{\n"
1569 " \"alphaFunction\":\"EASE_IN\",\n"
1570 " \"timePeriod\":{\n"
1572 " \"duration\":0.5\n"
1575 " \"transition:buttonPressed\":\n"
1578 " \"target\": \"unselectedBackgroundRenderer\",\n"
1579 " \"property\": \"opacity\",\n"
1581 " \"animator\":\"<buttonPressFadeOut>\"\n"
1584 " \"transition:buttonReleased\":\n"
1587 " \"target\": \"unselectedBackgroundRenderer\",\n"
1588 " \"property\": \"opacity\",\n"
1590 " \"animator\":\"<buttonPressFadeIn>\"\n"
1593 " \"target\": \"unselectedForegroundRenderer\",\n"
1594 " \"property\": \"scale\",\n"
1595 " \"value\": [ 1, 1, 1 ],\n"
1596 " \"animator\":\"<buttonPressFadeIn>\"\n"
1599 " \"target\": \"selectedBackgroundRenderer\",\n"
1600 " \"property\": \"opacity\",\n"
1602 " \"animator\": \"<buttonPressFadeOut>\"\n"
1605 " \"target\": \"selectedForegroundRenderer\",\n"
1606 " \"property\": \"scale\",\n"
1607 " \"value\": [ 0, 0, 0 ],\n"
1608 " \"animator\":\"<buttonPressFadeOut>\"\n"
1614 " \"testbutton\":\n"
1616 " \"pressTransition\":\"<transition:buttonPressed>\",\n"
1617 " \"releaseTransition\":\"<transition:buttonReleased>\"\n"
1622 Builder builder = Builder::New();
1623 builder.LoadFromString( json );
1625 Test::TestButton testButton = Test::TestButton::New();
1626 Stage::GetCurrent().Add( testButton );
1628 // Render and notify
1629 application.SendNotification();
1630 application.Render();
1632 DALI_TEST_CHECK( builder.ApplyStyle( "testbutton", testButton ) );
1634 // Now check that it has loaded the transition correctly:
1635 Property::Value transition = testButton.GetProperty(Test::TestButton::Property::PRESS_TRANSITION);
1636 DALI_TEST_EQUALS( transition.GetType(), Property::ARRAY, TEST_LOCATION );
1637 Property::Array* array = transition.GetArray();
1639 DALI_TEST_EQUALS( array->Size(), 1, TEST_LOCATION );
1640 Property::Value element = array->GetElementAt(0);
1641 DALI_TEST_CHECK( element.GetType() == Property::MAP );
1642 Property::Map* map = element.GetMap();
1644 CHECK_MAP_ELEMENT(map, "target", std::string, Property::STRING, "unselectedBackgroundRenderer", TEST_LOCATION);
1645 CHECK_MAP_ELEMENT(map, "property", std::string, Property::STRING, "opacity", TEST_LOCATION);
1646 CHECK_MAP_ELEMENT(map, "alphaFunction", int, Property::INTEGER, (int)Dali::AlphaFunction::EASE_OUT, TEST_LOCATION);
1647 CHECK_MAP_ELEMENT(map, "timePeriodDelay", float, Property::FLOAT, 0.0f, TEST_LOCATION);
1648 CHECK_MAP_ELEMENT(map, "timePeriodDuration", float, Property::FLOAT, 0.4f, TEST_LOCATION);
1654 int UtcDaliBuilderMappingCycleCheck(void)
1656 ToolkitTestApplication application;
1662 " \"cyclicKey1\":\"<cyclicKey1>\",\n"
1663 " \"cyclicKey2\":\"<cyclicKey3>\",\n"
1664 " \"cyclicKey3\":\"<cyclicKey2>\",\n"
1666 " \"alphaFunction\":\"EASE_IN\",\n"
1667 " \"timePeriod\":{\n"
1668 " \"delay\":\"<cyclicKey3>\",\n"
1669 " \"duration\":0.6\n"
1672 " \"transition:buttonPressed\":\n"
1675 " \"target\": \"<cyclicKey1>\",\n"
1676 " \"property\": \"<cyclicKey2>\",\n"
1678 " \"animator\":\"<FadeOut>\"\n"
1684 " \"testbutton\":\n"
1686 " \"pressTransition\":\"<transition:buttonPressed>\",\n"
1687 " \"releaseTransition\":\"<cyclicKey2>\",\n"
1688 " \"disabledTransition\":\"<cyclicKey3>\",\n"
1689 " \"enabledTransition\":\"<unknownKey>\"\n"
1694 Builder builder = Builder::New();
1695 builder.LoadFromString( json );
1697 Test::TestButton testButton = Test::TestButton::New();
1698 Stage::GetCurrent().Add( testButton );
1700 // Render and notify
1701 application.SendNotification();
1702 application.Render();
1704 DALI_TEST_CHECK( builder.ApplyStyle( "testbutton", testButton ) );
1706 // Now check that it has loaded the transition correctly:
1707 Property::Value transition = testButton.GetProperty(Test::TestButton::Property::PRESS_TRANSITION);
1708 DALI_TEST_EQUALS( transition.GetType(), Property::ARRAY, TEST_LOCATION );
1709 Property::Array* array = transition.GetArray();
1711 DALI_TEST_EQUALS( array->Size(), 1, TEST_LOCATION );
1712 Property::Value element = array->GetElementAt(0);
1713 DALI_TEST_CHECK( element.GetType() == Property::MAP );
1714 Property::Map* map = element.GetMap();
1716 CHECK_MAP_ELEMENT(map, "target", std::string, Property::STRING, "", TEST_LOCATION);
1717 CHECK_MAP_ELEMENT(map, "property", std::string, Property::STRING, "", TEST_LOCATION);
1718 CHECK_MAP_ELEMENT(map, "timePeriodDuration", float, Property::FLOAT, 0.6f, TEST_LOCATION);
1723 int UtcDaliBuilderTypeCasts(void)
1725 ToolkitTestApplication application;
1731 "\"type\": \"Layer\","
1732 "\"maximumSize\": { \"typeCast\":\"vector2\", \"value\":[100,15] },"
1733 "\"position\": { \"typeCast\":\"vector3\", \"value\":[100,10,1] },"
1734 "\"color\": { \"typeCast\":\"vector4\", \"value\":[0.5,0.5,0.5,1] },"
1735 "\"sensitive\": { \"typeCast\":\"boolean\", \"value\":false },"
1736 "\"orientation\": { \"typeCast\":\"rotation\", \"value\":[10,10,10,10] },"
1737 "\"colorMode\": { \"typeCast\":\"string\", \"value\":\"USE_OWN_MULTIPLY_PARENT_COLOR\" },"
1738 "\"clippingBox\": { \"typeCast\":\"rect\", \"value\":[10,10,10,10] }"
1743 Actor rootActor = Actor::New();
1744 Stage::GetCurrent().Add( rootActor );
1746 Builder builder = Builder::New();
1747 builder.LoadFromString( json );
1748 builder.AddActors( rootActor );
1750 application.SendNotification();
1751 application.Render();
1753 Actor createdActor = rootActor.GetChildAt( 0 );
1754 DALI_TEST_EQUALS( createdActor.GetMaximumSize(), Vector2(100.0f,15.0f), TEST_LOCATION );
1755 DALI_TEST_EQUALS( createdActor.GetCurrentPosition(), Vector3(100.0f,10.0f,1.0f), TEST_LOCATION );
1756 DALI_TEST_EQUALS( createdActor.GetCurrentColor(), Vector4(0.5f,0.5f,0.5f,1.0f), TEST_LOCATION );
1757 DALI_TEST_EQUALS( createdActor.IsSensitive(), false, TEST_LOCATION );
1758 DALI_TEST_EQUALS( createdActor.GetColorMode(), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION );
1763 int UtcDaliBuilderBuilderControl(void)
1765 ToolkitTestApplication application;
1771 "\"type\": \"BuilderControl\","
1772 "\"integerProperty\": 10,"
1773 "\"matrix3Property\": [ 1,2,3,4,5,6,7,8,9 ],"
1774 "\"matrixProperty\": [ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 ],"
1775 "\"noneProperty\": 10"
1780 Actor rootActor = Actor::New();
1781 Stage::GetCurrent().Add( rootActor );
1783 Builder builder = Builder::New();
1784 builder.LoadFromString( json );
1785 builder.AddActors( rootActor );
1787 application.SendNotification();
1788 application.Render();
1790 DALI_TEST_EQUALS( BuilderControlProperty::gSetPropertyCalledCount, 4, TEST_LOCATION );
1795 int UtcDaliBuilderActionsWithParams(void)
1797 ToolkitTestApplication application;
1799 // JSON with a quit event when the actor is touched
1805 " \"type\": \"ImageView\",\n"
1806 " \"name\": \"image\",\n"
1807 " \"size\": [100,100,1],\n"
1808 " \"signals\": [{\n"
1809 " \"name\": \"touch\",\n"
1810 " \"action\": \"show\",\n"
1811 " \"parameters\": {\n"
1812 " \"property1\" : 10,\n"
1813 " \"property2\" : [1,2],\n"
1814 " \"property3\" : [1,2,3],\n"
1815 " \"property4\" : [1,2,3,4]\n"
1823 Builder builder = Builder::New();
1824 builder.LoadFromString( json );
1825 builder.AddActors( Stage::GetCurrent().GetRootLayer() );
1827 DALI_TEST_CHECK( true ); // For Coverage