2 * Copyright (c) 2017 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 );
80 BuilderFunctor( bool& called ) : mCalled( called )
97 void builder_startup(void)
99 test_return_value = TET_UNDEF;
102 void builder_cleanup(void)
104 test_return_value = TET_PASS;
107 int UtcDaliBuilderQuitSignal(void)
109 ToolkitTestApplication application;
111 // JSON with a quit event when the actor is touched
116 "\"type\": \"Layer\","
117 "\"size\": [100,100,1],"
118 "\"parentOrigin\": \"TOP_LEFT\","
119 "\"anchorPoint\": \"TOP_LEFT\","
120 "\"maximumSize\": [100,100],"
121 "\"orientation\": [10,10,10,10],"
122 "\"clippingBox\": [10,10,10,10],"
124 "\"name\": \"touch\","
125 "\"action\": \"quit\""
130 Builder builder = Builder::New();
131 builder.LoadFromString( json );
132 builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
134 // Connect to builder's quit signal
135 bool functorCalled( false );
136 builder.QuitSignal().Connect( &application, BuilderFunctor( functorCalled ) );
139 application.SendNotification();
140 application.Render();
142 // Emit touch event and check that our quit method is called
143 Integration::TouchEvent touchEvent;
144 Integration::Point point;
145 point.SetState( PointState::DOWN );
146 point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
147 touchEvent.points.push_back( point );
148 application.ProcessEvent( touchEvent );
149 DALI_TEST_CHECK( functorCalled );
155 int UtcDaliBuilderAnimationP(void)
157 ToolkitTestApplication application;
159 // JSON with a quit event when the actor is touched
164 " \"ALPHA_FUNCTION\":\"EASE_IN_OUT\""
170 " \"points\":[ [-150, -50, 0], [0.0,70.0,0.0], [190.0,-150.0,0.0] ],"
171 " \"curvature\":0.35"
177 " \"endAction\": \"BAKE\","
178 " \"disconnectAction\": \"BAKE\","
181 " \"actor\": \"greeting\","
182 " \"property\": \"position\","
183 " \"value\": [300, 300, -1000],"
184 " \"alphaFunction\": \"{ALPHA_FUNCTION}\","
185 " \"relative\": true,"
192 " \"actor\": \"greeting\","
193 " \"property\": \"visible\","
194 " \"alphaFunction\": \"LINEAR\","
198 " \"actor\": \"greeting\","
199 " \"property\": \"sizeWidth\","
200 " \"alphaFunction\": \"REVERSE\","
204 " \"actor\": \"greeting\","
205 " \"property\": \"orientation\","
206 " \"alphaFunction\": \"EASE_IN\","
207 " \"value\": [10.0,20.0,30.0]"
210 " \"actor\": \"greeting\","
211 " \"property\": \"orientation\","
212 " \"alphaFunction\": \"EASE_OUT\","
213 " \"value\": [0.0, 0.0, 0.0, 1.0]"
216 " \"actor\": \"greeting\","
217 " \"property\": \"orientation\","
218 " \"alphaFunction\": \"EASE_IN_OUT\","
219 " \"value\": [0.0, 0.0, 0.0, 1.0]"
222 " \"actor\": \"greeting\","
223 " \"property\": \"orientation\","
224 " \"alphaFunction\": \"EASE_IN_SINE\","
225 " \"value\": [0.0, 0.0, 0.0, 1.0]"
228 " \"actor\": \"greeting\","
229 " \"property\": \"orientation\","
230 " \"alphaFunction\": \"EASE_OUT_SINE\","
231 " \"value\": [0.0, 0.0, 0.0, 1.0]"
234 " \"actor\": \"greeting\","
235 " \"property\": \"orientation\","
236 " \"alphaFunction\": \"EASE_IN_OUT_SINE\","
237 " \"value\": [0.0, 0.0, 0.0, 1.0]"
240 " \"actor\": \"greeting\","
241 " \"property\": \"orientation\","
242 " \"alphaFunction\": \"BOUNCE\","
243 " \"value\": [0.0, 0.0, 0.0, 1.0]"
246 " \"actor\": \"greeting\","
247 " \"property\": \"orientation\","
248 " \"alphaFunction\": \"SIN\","
249 " \"value\": [0.0, 0.0, 0.0, 1.0]"
252 " \"actor\": \"greeting\","
253 " \"property\": \"orientation\","
254 " \"alphaFunction\": \"EASE_OUT_BACK\","
255 " \"value\": [0.0, 0.0, 0.0, 1.0]"
259 " \"pathAnimation\": {"
260 " \"duration\": 3.0,"
261 " \"endAction\": \"DISCARD\","
262 " \"disconnectAction\": \"BAKE_FINAL\","
263 " \"properties\": [{"
264 " \"actor\": \"greeting\","
265 " \"path\":\"path0\","
266 " \"forward\":[1,0,0],"
267 " \"alphaFunction\": \"EASE_IN_OUT\","
276 " \"name\": \"greeting\","
277 " \"type\": \"TextLabel\","
278 " \"text\": \"Touch me\","
279 " \"inherit\": [\"basicText\"],"
280 " \"position\": [0, -120, 0],"
281 " \"size\": [200, 200, 1],"
282 " \"orientation\": [0, 0, 30],"
284 " \"name\": \"touch\","
285 " \"action\": \"play\","
286 " \"animation\": \"animate\""
291 Builder builder = Builder::New();
292 builder.LoadFromString( json );
293 builder.AddActors( Stage::GetCurrent().GetRootLayer() );
295 Animation anim = builder.CreateAnimation("animate");
297 DALI_TEST_CHECK( anim );
300 map["ALPHA_FUNCTION"] = "EASE_IN_SQUARE";
301 anim = builder.CreateAnimation("animate", map);
303 DALI_TEST_CHECK( anim );
305 anim = builder.CreateAnimation("pathAnimation");
307 DALI_TEST_CHECK( anim );
310 // Emit touch event and check that our quit method is called
311 Integration::TouchEvent touchEvent;
312 Integration::Point point;
313 point.SetState( PointState::DOWN );
314 point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
315 touchEvent.points.push_back( point );
316 application.ProcessEvent( touchEvent );
319 application.SendNotification();
320 application.Render();
326 int UtcDaliBuilderAnimationN(void)
328 ToolkitTestApplication application;
330 // JSON with a quit event when the actor is touched
335 " \"TEXT\": \"Touch Me\","
336 " \"NAME\": \"greeting\" "
342 " \"points\":[ [-150, -50, 0], [0.0,70.0,0.0], [190.0,-150.0,0.0] ],"
343 " \"curvature\":0.35"
349 " \"endAction\": \"BAKE\","
350 " \"disconnectAction\": \"BAKE\","
353 " \"actor\": \"{NAME}\","
354 " \"property\": \"positioninvalid\","
355 " \"value\": [300, 300, -1000],"
356 " \"alphaFunction\": \"EASE_IN_OUT\","
357 " \"relative\": true,"
367 " \"endAction\": \"BAKE\","
368 " \"disconnectAction\": \"BAKE\","
371 " \"actor\": \"{NAME}\","
372 " \"property\": \"positioninvalid\","
373 " \"value\": [300, 300, -1000],"
374 " \"alphaFunction\": \"EGGS_OVER_EASY\","
375 " \"relative\": true,"
383 " \"pathAnimation\": {"
384 " \"duration\": 3.0,"
385 " \"endAction\": \"DISCARD\","
386 " \"disconnectAction\": \"BAKE_FINAL\","
387 " \"properties\": [{"
388 " \"actor\": \"greeting\","
389 " \"path\":\"pathDoesntExist\","
390 " \"forward\":[1,0,0],"
391 " \"alphaFunction\": \"EASE_IN_OUT\","
400 " \"name\": \"greeting\","
401 " \"type\": \"TextLabel\","
402 " \"text\": \"Touch me\","
403 " \"inherit\": [\"basicText\"],"
404 " \"position\": [0, -120, 0],"
405 " \"size\": [200, 200, 1],"
406 " \"orientation\": [0, 0, 30],"
408 " \"name\": \"touch\","
409 " \"action\": \"play\","
410 " \"animation\": \"animate\""
414 " \"name\": \"greeting2\","
415 " \"type\": \"TextLabel\","
416 " \"text\": \"Touch me\""
421 Builder builder = Builder::New();
422 builder.LoadFromString( json );
423 builder.AddActors( Stage::GetCurrent().GetRootLayer() );
425 Animation anim = builder.CreateAnimation("animate");
427 // log warning line coverage
428 anim = builder.CreateAnimation("pathAnimation");
429 DALI_TEST_CHECK(anim);
431 anim = builder.CreateAnimation("animate");
432 DALI_TEST_CHECK(anim);
434 anim = builder.CreateAnimation("animate2");
435 DALI_TEST_CHECK(anim);
437 // create referencing a different actor aka animation templates
439 map["NAME"] = "greeting2";
440 anim = builder.CreateAnimation("animate2", map);
441 DALI_TEST_CHECK(anim);
443 // alternative actor to use for FindChildByName
444 anim = builder.CreateAnimation("animate2", Dali::Stage::GetCurrent().GetRootLayer());
445 DALI_TEST_CHECK(anim);
447 // alternative actor to use for FindChildByName
448 anim = builder.CreateAnimation("animate2", map, Dali::Stage::GetCurrent().GetRootLayer());
449 DALI_TEST_CHECK(anim);
456 int UtcDaliBuilderConstantsP(void)
458 ToolkitTestApplication application;
460 // JSON with a quit event when the actor is touched
465 " \"IMAGE_PATH\": \"apath\","
467 " \"ANCHOR\": \"TOP_LEFT\","
468 " \"PADDING\": [1,2,3,4]"
472 " \"type\": \"ImageView\","
473 " \"name\": \"{NAME}\","
474 " \"size\": [100,100,1],"
475 " \"parentOrigin\": \"TOP_LEFT\","
476 " \"anchorPoint\": \"{ANCHOR}\","
477 " \"padding\": \"{PADDING}\","
478 " \"image\": { \"url\": \"dir/{IMAGE_PATH}\" },"
479 " \"sizeWidth\": \"{WIDTH}\","
481 " \"name\": \"touch\","
482 " \"action\": \"quit\""
488 Builder builder = Builder::New();
489 builder.LoadFromString( json );
491 builder.AddConstant( "NAME", "image" );
493 Property::Map map = builder.GetConstants();
495 Dali::Property::Value* pValue = map.Find( "NAME" );
497 DALI_TEST_CHECK( pValue );
499 pValue = map.Find( "IMAGE_PATH" );
501 DALI_TEST_CHECK( pValue );
503 Dali::Property::Value value = builder.GetConstant( "WIDTH" );
505 DALI_TEST_CHECK( value.GetType() != Property::NONE );
507 builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
508 DALI_TEST_CHECK( builder );
510 Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("image");
511 DALI_TEST_CHECK( actor );
516 int UtcDaliBuilderTemplatesAndStylesP(void)
518 ToolkitTestApplication application;
520 // JSON with a quit event when the actor is touched
525 " \"SIZE\": [10,20,30]"
529 " \"imageStyle\": \n"
531 " \"color\": [1,0,0,1],\n"
533 " \"childImage\": {\n"
534 " \"color\": \"34\"\n"
541 " \"imageViewTemplate\": { \n"
542 " \"type\": \"ImageView\",\n"
543 " \"styles\": [\"imageStyle\"]\n"
545 " \"imageTree\": { \n"
546 " \"type\": \"ImageView\",\n"
547 " \"styles\": [\"imageStyle\"],\n"
548 " \"name\": \"image\",\n"
549 " \"size\": \"{SIZE}\",\n"
551 " \"name\": \"touch\",\n"
552 " \"action\": \"quit\"\n"
556 " \"type\":\"ImageView\",\n"
557 " \"name\":\"childImage\", \n"
567 " \"type\":\"imageViewTemplate\",\n"
568 " \"name\":\"childImage2\"\n"
575 " \"type\": \"imageTree\","
576 " \"size\": [100,100,1]"
581 std::string stylejson(
583 " \"color\": [1,0,0,1],\n"
585 " \"childImage\": {\n"
586 " \"color\": \"#344353\"\n"
592 std::string templatejson(
594 " \"type\": \"ImageView\",\n"
595 " \"styles\": [\"imageStyle\"],\n"
596 " \"name\": \"image\",\n"
597 " \"size\": \"{SIZE}\",\n"
599 " \"name\": \"touch\",\n"
600 " \"action\": \"quit\"\n"
604 " \"type\":\"ImageView\",\n"
605 " \"name\":\"childImage\" \n"
611 Builder builder = Builder::New();
612 builder.LoadFromString( json );
614 ImageView actor = ImageView::DownCast( builder.Create( "imageTree" ) );
615 DALI_TEST_CHECK( actor );
617 Dali::Property::Map map;
618 map["SIZE"] = Vector3(100,100,1);
619 actor = ImageView::DownCast( builder.Create( "imageTree", map ) );
620 DALI_TEST_CHECK( actor );
622 // create from json snippet
623 actor = ImageView::DownCast( builder.CreateFromJson( templatejson ) );
624 DALI_TEST_CHECK( actor );
627 // NB: already applied in create
628 DALI_TEST_CHECK( builder.ApplyStyle( "imageStyle", actor ) );
630 // apply from json snippet
631 DALI_TEST_CHECK( builder.ApplyFromJson( actor, stylejson ) );
636 int UtcDaliBuilderRenderTasksP(void)
638 ToolkitTestApplication application;
640 // JSON with a quit event when the actor is touched
646 " \"sourceActor\": \"image\",\n"
647 " \"cameraActor\": \"camera\" \n"
653 " \"type\": \"CameraActor\",\n"
654 " \"name\": \"camera\"\n"
657 " \"type\": \"ImageView\",\n"
658 " \"name\": \"image\",\n"
659 " \"size\": [100,100,1],\n"
661 " \"name\": \"touch\",\n"
662 " \"action\": \"quit\"\n"
666 " \"type\":\"ImageView\",\n"
667 " \"name\":\"childImage\" \n"
675 Builder builder = Builder::New();
676 builder.LoadFromString( json );
678 unsigned int count = Stage::GetCurrent().GetRenderTaskList().GetTaskCount();
681 builder.CreateRenderTask( "task0" );
683 DALI_TEST_CHECK( count <
684 Stage::GetCurrent().GetRenderTaskList().GetTaskCount() );
689 int UtcDaliBuilderChildActionP(void)
691 ToolkitTestApplication application;
693 // JSON with a quit event when the actor is touched
698 " \"type\": \"Actor\",\n"
699 " \"name\": \"actor\",\n"
700 " \"size\": [100,100,1],\n"
701 " \"parentOrigin\": \"TOP_LEFT\",\n"
702 " \"anchorPoint\": \"TOP_LEFT\",\n"
704 " \"type\": \"Actor\",\n"
705 " \"name\": \"subActor\"\n"
708 " \"name\": \"touch\",\n"
709 " \"action\": \"hide\",\n"
710 " \"actor\": \"actor\",\n"
711 " \"childActor\": \"subActor\"\n"
717 Builder builder = Builder::New();
718 builder.LoadFromString( json );
719 builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
722 application.SendNotification();
723 application.Render();
725 // Emit touch event and check that our quit method is called
726 Integration::TouchEvent touchEvent;
727 Integration::Point point;
728 point.SetState( PointState::DOWN );
729 point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
730 touchEvent.points.push_back( point );
731 application.ProcessEvent( touchEvent );
734 application.SendNotification();
735 application.Render();
737 Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("subActor");
738 DALI_TEST_CHECK( actor );
740 DALI_TEST_CHECK( !actor.IsVisible() );
745 int UtcDaliBuilderSetPropertyActionP(void)
747 ToolkitTestApplication application;
749 // JSON with a quit event when the actor is touched
754 " \"type\": \"Actor\",\n"
755 " \"name\": \"actor\",\n"
756 " \"size\": [100,100,1],\n"
757 " \"parentOrigin\": \"TOP_LEFT\",\n"
758 " \"anchorPoint\": \"TOP_LEFT\",\n"
760 " \"type\": \"Actor\",\n"
761 " \"name\": \"subActor\"\n"
764 " \"name\": \"touch\",\n"
765 " \"action\": \"set\",\n"
766 " \"actor\": \"subActor\",\n"
767 " \"property\": \"visible\",\n"
768 " \"value\": false\n"
774 Builder builder = Builder::New();
775 builder.LoadFromString( json );
776 builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
779 application.SendNotification();
780 application.Render();
782 // Emit touch event and check that our quit method is called
783 Integration::TouchEvent touchEvent;
784 Integration::Point point;
785 point.SetState( PointState::DOWN );
786 point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
787 touchEvent.points.push_back( point );
788 application.ProcessEvent( touchEvent );
791 application.SendNotification();
792 application.Render();
794 Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("subActor");
795 DALI_TEST_CHECK( actor );
797 DALI_TEST_CHECK( !actor.IsVisible() );
802 int UtcDaliBuilderGenericActionP(void)
804 ToolkitTestApplication application;
806 // JSON with a quit event when the actor is touched
811 " \"type\": \"Actor\",\n"
812 " \"name\": \"actor\",\n"
813 " \"size\": [100,100,1],\n"
814 " \"parentOrigin\": \"TOP_LEFT\",\n"
815 " \"anchorPoint\": \"TOP_LEFT\",\n"
817 " \"type\": \"Actor\",\n"
818 " \"name\": \"subActor\"\n"
821 " \"name\": \"touch\",\n"
822 " \"action\": \"hide\"\n"
828 Builder builder = Builder::New();
829 builder.LoadFromString( json );
830 builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
833 application.SendNotification();
834 application.Render();
836 // Emit touch event and check that our quit method is called
837 Integration::TouchEvent touchEvent;
838 Integration::Point point;
839 point.SetState( PointState::DOWN );
840 point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
841 touchEvent.points.push_back( point );
842 application.ProcessEvent( touchEvent );
845 application.SendNotification();
846 application.Render();
848 Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("actor");
849 DALI_TEST_CHECK( actor );
851 DALI_TEST_CHECK( !actor.IsVisible() );
856 int UtcDaliBuilderPropertyNotificationP(void)
858 ToolkitTestApplication application;
860 // JSON with a quit event when the actor is touched
865 " \"type\": \"Actor\",\n"
866 " \"name\": \"actor\",\n"
867 " \"size\": [100,100,1],\n"
868 " \"parentOrigin\": \"TOP_LEFT\",\n"
869 " \"anchorPoint\": \"TOP_LEFT\",\n"
871 " \"type\": \"Actor\",\n"
872 " \"name\": \"subActor\"\n"
875 " \"name\": \"touch\",\n"
876 " \"action\": \"hide\"\n"
878 " \"notifications\": [{\n"
879 " \"property\": \"visible\",\n"
880 " \"condition\": \"False\",\n"
881 " \"action\": \"show\"\n"
884 " \"property\": \"positionX\",\n"
885 " \"condition\": \"LessThan\",\n"
887 " \"action\": \"show\"\n"
890 " \"property\": \"positionY\",\n"
891 " \"condition\": \"GreaterThan\",\n"
892 " \"arg0\": 200.0,\n"
893 " \"action\": \"show\"\n"
896 " \"property\": \"positionZ\",\n"
897 " \"condition\": \"Inside\",\n"
900 " \"action\": \"show\"\n"
903 " \"property\": \"positionZ\",\n"
904 " \"condition\": \"Outside\",\n"
907 " \"action\": \"show\"\n"
913 Builder builder = Builder::New();
914 builder.LoadFromString( json );
915 builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
918 application.SendNotification();
919 application.Render();
921 // Emit touch event and check that our quit method is called
922 Integration::TouchEvent touchEvent;
923 Integration::Point point;
924 point.SetState( PointState::DOWN );
925 point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
926 touchEvent.points.push_back( point );
927 application.ProcessEvent( touchEvent );
930 application.SendNotification();
931 application.Render();
934 application.SendNotification();
935 application.Render();
937 Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("actor");
938 DALI_TEST_CHECK( actor );
940 DALI_TEST_CHECK( actor.IsVisible() );
945 int UtcDaliBuilderPropertyNotificationN(void)
947 ToolkitTestApplication application;
949 // JSON with a quit event when the actor is touched
954 " \"type\": \"Actor\",\n"
955 " \"notifications\": [{\n"
956 " \"property\": \"visible\",\n"
957 " \"condition\": \"ErrorCondition\",\n"
958 " \"action\": \"show\"\n"
966 Builder builder = Builder::New();
967 builder.LoadFromString( json );
968 builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
969 DALI_TEST_CHECK( false );
973 DALI_TEST_CHECK( true );
981 int UtcDaliBuilderCustomPropertyP(void)
983 ToolkitTestApplication application;
985 // JSON with a quit event when the actor is touched
990 " \"imageTree\": { \n"
991 " \"type\": \"ImageView\",\n"
992 " \"name\": \"image\",\n"
993 " \"size\": [100,100,1],\n"
995 " \"name\": \"touch\",\n"
996 " \"action\": \"quit\"\n"
998 " \"properties\": {\n"
999 " \"newproperty\": true\n"
1001 " \"animatableProperties\": {\n"
1002 " \"newAnimatableproperty\": 3\n"
1006 " \"type\":\"ImageView\",\n"
1007 " \"name\":\"childImage\" \n"
1015 Builder builder = Builder::New();
1016 builder.LoadFromString( json );
1018 ImageView actor = ImageView::DownCast( builder.Create( "imageTree" ) );
1019 DALI_TEST_CHECK( actor );
1021 // NB: already applied in create
1022 Property::Index index = actor.GetPropertyIndex("newproperty");
1023 DALI_TEST_CHECK( Property::INVALID_INDEX != index );
1024 Property::Value value = actor.GetProperty(index);
1025 DALI_TEST_CHECK( value.Get<bool>() == true );
1027 index = actor.GetPropertyIndex("newAnimatableproperty");
1028 DALI_TEST_CHECK( Property::INVALID_INDEX != index );
1029 value = actor.GetProperty(index);
1030 DALI_TEST_CHECK( value.Get<int>() == 3 );
1035 int UtcDaliBuilderCustomShaderP(void)
1037 ToolkitTestApplication application;
1039 // JSON with a quit event when the actor is touched
1044 " \"type\": \"ImageView\",\n"
1045 " \"name\": \"Image1\",\n"
1046 " \"position\": [\n"
1047 " 0.40461349487305,\n"
1051 " \"parentOrigin\": [0.5, 0.5, 0.5],\n"
1052 " \"size\": [200, 200, 0],\n"
1053 " \"effect\": \"Ripple2D\",\n"
1055 " \"url\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\",\n"
1056 " \"desiredWidth\": 200,\n"
1057 " \"desiredHeight\": 80,\n"
1059 " \"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"
1062 " \"customAnimatableProperties\": {\n"
1063 " \"uAmplitude\": 0.02,\n"
1068 " \"name\": \"onStage\",\n"
1069 " \"action\": \"play\",\n"
1070 " \"animation\": \"Animation_1\"\n"
1075 " \"animations\": {\n"
1076 " \"Animation_1\": {\n"
1078 " \"properties\": [\n"
1080 " \"actor\": \"Image1\",\n"
1081 " \"property\": \"uTime\",\n"
1082 " \"value\": 10.0,\n"
1083 " \"alphaFunction\": \"LINEAR\",\n"
1084 " \"timePeriod\": {\n"
1086 " \"duration\": 10.0\n"
1096 Builder builder = Builder::New();
1097 builder.LoadFromString( json );
1099 builder.AddActors ( "stage", Stage::GetCurrent().GetRootLayer() );
1101 // Render and notify
1102 application.SendNotification();
1103 application.Render();
1105 Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("Image1");
1108 DALI_TEST_CHECK( actor );
1114 int UtcDaliBuilderLoadFromStringN(void)
1116 ToolkitTestApplication application;
1118 // JSON with a quit event when the actor is touched
1120 "asdfsadf dsf asdf asdf {"
1123 "\"type\": \"Actor\","
1124 "\"size\": [100,100,1],"
1125 "\"parentOrigin\": \"TOP_LEFT\","
1126 "\"anchorPoint\": \"TOP_LEFT\","
1128 "\"name\": \"touch\","
1129 "\"action\": \"quit\""
1134 Builder builder = Builder::New();
1136 bool assert1 = false;
1140 builder.LoadFromString( json );
1142 catch( Dali::DaliException& e )
1144 DALI_TEST_PRINT_ASSERT( e );
1145 DALI_TEST_EQUALS(e.condition, "!\"Cannot parse JSON\"", TEST_LOCATION);
1149 DALI_TEST_CHECK( assert1 );
1155 int UtcDaliBuilderAddActorsP(void)
1157 ToolkitTestApplication application;
1159 // JSON with a quit event when the actor is touched
1162 " \"arbitarysection\":\n"
1164 " \"type\": \"Actor\",\n"
1165 " \"name\": \"actor\",\n"
1166 " \"size\": [100,100,1],\n"
1167 " \"parentOrigin\": \"TOP_LEFT\",\n"
1168 " \"anchorPoint\": \"TOP_LEFT\",\n"
1170 " \"type\": \"Actor\",\n"
1171 " \"name\": \"subActor\",\n"
1172 " \"visible\": false\n"
1174 " \"signals\": [{\n"
1175 " \"name\": \"touch\",\n"
1176 " \"action\": \"hide\",\n"
1177 " \"actor\": \"actor\",\n"
1178 " \"childActor\": \"subActor\"\n"
1184 Builder builder = Builder::New();
1185 builder.LoadFromString( json );
1186 builder.AddActors ( "arbitarysection", Stage::GetCurrent().GetRootLayer() );
1188 // Render and notify
1189 application.SendNotification();
1190 application.Render();
1192 Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("subActor");
1193 DALI_TEST_CHECK( actor );
1195 DALI_TEST_CHECK( !actor.IsVisible() );
1200 int UtcDaliBuilderFrameBufferP(void)
1202 ToolkitTestApplication application;
1204 // JSON with a quit event when the actor is touched
1209 " \"FB_WIDTH\": 200.0,\n"
1210 " \"FB_HEIGHT\": 200.0,\n"
1211 " \"FB_SIZE\": [200,200],\n"
1212 " \"FB_ASPECT_RATIO\": 1\n"
1216 " \"type\": \"ImageView\",\n"
1217 " \"name\": \"fbOnStage\",\n"
1218 " \"position\": [\n"
1219 " 0.40461349487305,\n"
1223 " \"parentOrigin\": [0.5, 0.5, 0.5],\n"
1224 " \"size\": [300, 300, 0],\n"
1225 " \"image\": \"fb0\",\n"
1226 " \"clearColor\": [1,0,0,1]\n"
1229 " \"type\": \"ImageView\",\n"
1230 " \"name\": \"Image1\",\n"
1231 " \"size\": [200, 200, 0],\n"
1232 " \"parentOrigin\": [0.5, 0.5, 0.5],\n"
1233 " \"effect\": \"Ripple2D\",\n"
1235 " \"url\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\"\n"
1239 " \"name\": \"onStage\",\n"
1240 " \"action\": \"play\",\n"
1241 " \"animation\": \"Animation_1\"\n"
1246 " \"type\":\"CameraActor\",\n"
1247 " \"name\":\"fbCam\",\n"
1248 " \"aspectRatio\": \"{FB_ASPECT_RATIO}\",\n"
1249 " \"projectionMode\": \"PERSPECTIVE_PROJECTION\",\n"
1250 " \"fieldOfView\": 0.785,\n"
1251 " \"invertYAxis\": true\n"
1254 " \"frameBufferImages\":\n"
1258 " \"type\": \"FrameBufferImage\",\n"
1259 " \"width\": { \"typeCast\":\"float\", \"value\":\"{FB_WIDTH}\" },\n"
1260 " \"height\": { \"typeCast\":\"float\", \"value\":\"{FB_HEIGHT}\" }\n"
1263 " \"renderTasks\":\n"
1268 " \"sourceActor\": \"fbOnStage\"\n"
1271 " \"sourceActor\": \"Image1\",\n"
1272 " \"targetFrameBuffer\": \"fb0\",\n"
1273 " \"viewportSize\":\"{FB_SIZE}\",\n"
1274 " \"cameraActor\":\"fbCam\"\n"
1279 " \"animations\": {\n"
1280 " \"Animation_1\": {\n"
1282 " \"properties\": [\n"
1284 " \"actor\": \"Image1\",\n"
1285 " \"property\": \"uTime\",\n"
1286 " \"value\": 10.0,\n"
1287 " \"alphaFunction\": \"LINEAR\",\n"
1288 " \"timePeriod\": {\n"
1290 " \"duration\": 10.0\n"
1292 " \"gui-builder-timeline-color\": \"#8dc0da\"\n"
1299 Builder builder = Builder::New();
1301 // frame buffer coverage
1302 builder.LoadFromString( json );
1304 // Render and notify
1305 application.SendNotification();
1306 application.Render();
1308 Dali::FrameBufferImage frameBuffer = builder.GetFrameBufferImage( "fb0" );
1309 DALI_TEST_CHECK( frameBuffer );
1311 Dali::FrameBufferImage frameBuffer2 = builder.GetFrameBufferImage( "fb0" );
1312 DALI_TEST_CHECK( frameBuffer2 );
1313 DALI_TEST_CHECK( frameBuffer == frameBuffer2 );
1315 DALI_TEST_CHECK( true );
1320 int UtcDaliBuilderPathConstraintsP(void)
1322 ToolkitTestApplication application;
1324 // JSON with a quit event when the actor is touched
1329 " \"FB_WIDTH\": 200.0,\n"
1330 " \"FB_HEIGHT\": 200.0,\n"
1331 " \"FB_SIZE\": [200,200],\n"
1332 " \"FB_ASPECT_RATIO\": 1\n"
1336 " \"type\": \"ImageView\",\n"
1337 " \"name\": \"Image1\",\n"
1338 " \"size\": [200, 200, 0],\n"
1339 " \"parentOrigin\": [0.5, 0.5, 0.5],\n"
1340 " \"effect\": \"Ripple2D\",\n"
1342 " \"url\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\"\n"
1346 " \"name\": \"onStage\",\n"
1347 " \"action\": \"play\",\n"
1348 " \"animation\": \"pathAnimation\"\n"
1351 " \"name\": \"onStage\",\n"
1352 " \"action\": \"applyConstraint\",\n"
1353 " \"constrainer\": \"constrainer0\",\n"
1354 " \"properties\":\n"
1357 " \"source\": \"Image1\",\n"
1358 " \"sourceProperty\": \"positionX\",\n"
1359 " \"target\": \"Image1\",\n"
1360 " \"targetProperty\": \"colorRed\",\n"
1361 " \"range\": [-300,300]\n"
1366 " \"name\": \"onStage\",\n"
1367 " \"action\": \"applyConstraint\",\n"
1368 " \"constrainer\": \"constrainer1\",\n"
1369 " \"properties\":\n"
1372 " \"source\": \"Image1\",\n"
1373 " \"sourceProperty\": \"positionX\",\n"
1374 " \"target\": \"Image1\",\n"
1375 " \"targetProperty\": \"colorBlue\",\n"
1376 " \"range\": [-300,300]\n"
1381 " \"name\": \"offStage\",\n"
1382 " \"action\": \"removeConstraints\",\n"
1383 " \"constrainer\": \"constrainer0\",\n"
1384 " \"properties\":\n"
1387 " \"source\": \"Image1\",\n"
1388 " \"sourceProperty\": \"positionX\",\n"
1389 " \"target\": \"Image1\",\n"
1390 " \"targetProperty\": \"colorRed\",\n"
1391 " \"range\": [-300,300]\n"
1396 " \"name\": \"offStage\",\n"
1397 " \"action\": \"removeConstraints\",\n"
1398 " \"constrainer\": \"constrainer1\",\n"
1399 " \"properties\":\n"
1402 " \"source\": \"Image1\",\n"
1403 " \"sourceProperty\": \"positionX\",\n"
1404 " \"target\": \"Image1\",\n"
1405 " \"targetProperty\": \"colorBlue\",\n"
1406 " \"range\": [-300,300]\n"
1417 " \"points\":[ [-150, -50, 0], [0.0,70.0,0.0], [190.0,-150.0,0.0] ],\n"
1418 " \"curvature\":0.35\n"
1421 " \"constrainers\":\n"
1423 " \"constrainer0\":\n"
1425 " \"type\": \"PathConstrainer\",\n"
1426 " \"points\": [ [0, 0, 0], [0,0,0], [0,0,0] ],\n"
1427 " \"controlPoints\": [ [0, 0, 0], [0,0,0], [0,0,0] ]\n"
1429 " \"constrainer1\":\n"
1431 " \"type\": \"LinearConstrainer\",\n"
1432 " \"value\": [ 0, 0, 0 ]\n"
1435 " \"animations\": {\n"
1436 " \"pathAnimation\": {\n"
1437 " \"duration\": 3.0,\n"
1438 " \"properties\":\n"
1440 " \"actor\": \"Image1\",\n"
1441 " \"path\":\"path0\",\n"
1442 " \"forward\":[1,0,0],\n"
1443 " \"alphaFunction\": \"EASE_IN_OUT\",\n"
1444 " \"timePeriod\": {\n"
1446 " \"duration\": 3\n"
1450 " \"actor\": \"Image1\",\n"
1451 " \"property\": \"uTime\",\n"
1452 " \"value\": 10.0,\n"
1453 " \"alphaFunction\": \"LINEAR\",\n"
1454 " \"timePeriod\": {\n"
1456 " \"duration\": 10.0\n"
1458 " \"gui-builder-timeline-color\": \"#8dc0da\"\n"
1461 " \"Animation_1\": {\n"
1463 " \"properties\": [\n"
1465 " \"actor\": \"Image1\",\n"
1466 " \"property\": \"uTime\",\n"
1467 " \"value\": 10.0,\n"
1468 " \"alphaFunction\": \"LINEAR\",\n"
1469 " \"timePeriod\": {\n"
1471 " \"duration\": 10.0\n"
1473 " \"gui-builder-timeline-color\": \"#8dc0da\"\n"
1480 Builder builder = Builder::New();
1482 // frame buffer coverage
1483 builder.LoadFromString( json );
1485 // Render and notify
1486 application.SendNotification();
1487 application.Render();
1489 Dali::Path path = builder.GetPath( "path0" );
1490 DALI_TEST_CHECK( path );
1492 Dali::Path path2 = builder.GetPath( "path0" );
1493 DALI_TEST_CHECK( path2 );
1494 DALI_TEST_CHECK( path == path2 );
1496 Dali::PathConstrainer constrainer0 = builder.GetPathConstrainer( "constrainer0" );
1497 DALI_TEST_CHECK( constrainer0 );
1499 Dali::PathConstrainer constrainer0_2 = builder.GetPathConstrainer( "constrainer0" );
1500 DALI_TEST_CHECK( constrainer0_2 );
1501 DALI_TEST_CHECK( constrainer0 == constrainer0_2 );
1503 Dali::LinearConstrainer constrainer1 = builder.GetLinearConstrainer( "constrainer1" );
1504 DALI_TEST_CHECK( constrainer1 );
1506 Dali::LinearConstrainer constrainer1_2 = builder.GetLinearConstrainer( "constrainer1" );
1507 DALI_TEST_CHECK( constrainer1 == constrainer1_2 );
1511 Actor actor = Actor::New();
1512 Stage::GetCurrent().Add( actor );
1513 builder.AddActors( actor );
1515 // Render and notify
1516 application.SendNotification();
1517 application.Render();
1519 actor.GetChildAt( 0 ).Unparent();
1524 #define CHECK_MAP_ELEMENT( xMap, xKey, xType, xPropType, xExpected, xLocation ) \
1526 Property::Value* value = xMap->Find( xKey ); \
1527 DALI_TEST_EQUALS( value==NULL, false, xLocation); \
1528 if( value != NULL ) \
1530 DALI_TEST_EQUALS( value->GetType(), xPropType, xLocation ); \
1532 value->Get(result); \
1533 DALI_TEST_EQUALS( result, xExpected, TEST_LOCATION ); \
1534 std::ostringstream oss; \
1535 oss << "Animation element " << xKey << "= " << result << std::endl; \
1536 tet_printf( oss.str().c_str() ); \
1540 tet_printf("Can't find map element " xKey "\n"); \
1545 int UtcDaliBuilderMapping01(void)
1547 ToolkitTestApplication application;
1553 " \"buttonPressFadeOut\":{\n"
1554 " \"alphaFunction\":\"EASE_OUT\",\n"
1555 " \"timePeriod\":{\n"
1557 " \"duration\":0.4\n"
1560 " \"buttonPressFadeIn\":{\n"
1561 " \"alphaFunction\":\"EASE_IN\",\n"
1562 " \"timePeriod\":{\n"
1564 " \"duration\":0.5\n"
1567 " \"transition:buttonPressed\":\n"
1570 " \"target\": \"unselectedBackgroundRenderer\",\n"
1571 " \"property\": \"opacity\",\n"
1573 " \"animator\":\"<buttonPressFadeOut>\"\n"
1576 " \"transition:buttonReleased\":\n"
1579 " \"target\": \"unselectedBackgroundRenderer\",\n"
1580 " \"property\": \"opacity\",\n"
1582 " \"animator\":\"<buttonPressFadeIn>\"\n"
1585 " \"target\": \"unselectedForegroundRenderer\",\n"
1586 " \"property\": \"scale\",\n"
1587 " \"value\": [ 1, 1, 1 ],\n"
1588 " \"animator\":\"<buttonPressFadeIn>\"\n"
1591 " \"target\": \"selectedBackgroundRenderer\",\n"
1592 " \"property\": \"opacity\",\n"
1594 " \"animator\": \"<buttonPressFadeOut>\"\n"
1597 " \"target\": \"selectedForegroundRenderer\",\n"
1598 " \"property\": \"scale\",\n"
1599 " \"value\": [ 0, 0, 0 ],\n"
1600 " \"animator\":\"<buttonPressFadeOut>\"\n"
1606 " \"testbutton\":\n"
1608 " \"pressTransition\":\"<transition:buttonPressed>\",\n"
1609 " \"releaseTransition\":\"<transition:buttonReleased>\"\n"
1614 Builder builder = Builder::New();
1615 builder.LoadFromString( json );
1617 Test::TestButton testButton = Test::TestButton::New();
1618 Stage::GetCurrent().Add( testButton );
1620 // Render and notify
1621 application.SendNotification();
1622 application.Render();
1624 DALI_TEST_CHECK( builder.ApplyStyle( "testbutton", testButton ) );
1626 // Now check that it has loaded the transition correctly:
1627 Property::Value transition = testButton.GetProperty(Test::TestButton::Property::PRESS_TRANSITION);
1628 DALI_TEST_EQUALS( transition.GetType(), Property::ARRAY, TEST_LOCATION );
1629 Property::Array* array = transition.GetArray();
1631 DALI_TEST_EQUALS( array->Size(), 1, TEST_LOCATION );
1632 Property::Value element = array->GetElementAt(0);
1633 DALI_TEST_CHECK( element.GetType() == Property::MAP );
1634 Property::Map* map = element.GetMap();
1636 CHECK_MAP_ELEMENT(map, "target", std::string, Property::STRING, "unselectedBackgroundRenderer", TEST_LOCATION);
1637 CHECK_MAP_ELEMENT(map, "property", std::string, Property::STRING, "opacity", TEST_LOCATION);
1638 CHECK_MAP_ELEMENT(map, "alphaFunction", int, Property::INTEGER, (int)Dali::AlphaFunction::EASE_OUT, TEST_LOCATION);
1639 CHECK_MAP_ELEMENT(map, "timePeriodDelay", float, Property::FLOAT, 0.0f, TEST_LOCATION);
1640 CHECK_MAP_ELEMENT(map, "timePeriodDuration", float, Property::FLOAT, 0.4f, TEST_LOCATION);
1646 int UtcDaliBuilderMappingCycleCheck(void)
1648 ToolkitTestApplication application;
1654 " \"cyclicKey1\":\"<cyclicKey1>\",\n"
1655 " \"cyclicKey2\":\"<cyclicKey3>\",\n"
1656 " \"cyclicKey3\":\"<cyclicKey2>\",\n"
1658 " \"alphaFunction\":\"EASE_IN\",\n"
1659 " \"timePeriod\":{\n"
1660 " \"delay\":\"<cyclicKey3>\",\n"
1661 " \"duration\":0.6\n"
1664 " \"transition:buttonPressed\":\n"
1667 " \"target\": \"<cyclicKey1>\",\n"
1668 " \"property\": \"<cyclicKey2>\",\n"
1670 " \"animator\":\"<FadeOut>\"\n"
1676 " \"testbutton\":\n"
1678 " \"pressTransition\":\"<transition:buttonPressed>\",\n"
1679 " \"releaseTransition\":\"<cyclicKey2>\",\n"
1680 " \"disabledTransition\":\"<cyclicKey3>\",\n"
1681 " \"enabledTransition\":\"<unknownKey>\"\n"
1686 Builder builder = Builder::New();
1687 builder.LoadFromString( json );
1689 Test::TestButton testButton = Test::TestButton::New();
1690 Stage::GetCurrent().Add( testButton );
1692 // Render and notify
1693 application.SendNotification();
1694 application.Render();
1696 DALI_TEST_CHECK( builder.ApplyStyle( "testbutton", testButton ) );
1698 // Now check that it has loaded the transition correctly:
1699 Property::Value transition = testButton.GetProperty(Test::TestButton::Property::PRESS_TRANSITION);
1700 DALI_TEST_EQUALS( transition.GetType(), Property::ARRAY, TEST_LOCATION );
1701 Property::Array* array = transition.GetArray();
1703 DALI_TEST_EQUALS( array->Size(), 1, TEST_LOCATION );
1704 Property::Value element = array->GetElementAt(0);
1705 DALI_TEST_CHECK( element.GetType() == Property::MAP );
1706 Property::Map* map = element.GetMap();
1708 CHECK_MAP_ELEMENT(map, "target", std::string, Property::STRING, "", TEST_LOCATION);
1709 CHECK_MAP_ELEMENT(map, "property", std::string, Property::STRING, "", TEST_LOCATION);
1710 CHECK_MAP_ELEMENT(map, "timePeriodDuration", float, Property::FLOAT, 0.6f, TEST_LOCATION);
1715 int UtcDaliBuilderTypeCasts(void)
1717 ToolkitTestApplication application;
1723 "\"type\": \"Layer\","
1724 "\"maximumSize\": { \"typeCast\":\"vector2\", \"value\":[100,15] },"
1725 "\"position\": { \"typeCast\":\"vector3\", \"value\":[100,10,1] },"
1726 "\"color\": { \"typeCast\":\"vector4\", \"value\":[0.5,0.5,0.5,1] },"
1727 "\"sensitive\": { \"typeCast\":\"boolean\", \"value\":false },"
1728 "\"orientation\": { \"typeCast\":\"rotation\", \"value\":[10,10,10,10] },"
1729 "\"colorMode\": { \"typeCast\":\"string\", \"value\":\"USE_OWN_MULTIPLY_PARENT_COLOR\" },"
1730 "\"clippingBox\": { \"typeCast\":\"rect\", \"value\":[10,10,10,10] }"
1735 Actor rootActor = Actor::New();
1736 Stage::GetCurrent().Add( rootActor );
1738 Builder builder = Builder::New();
1739 builder.LoadFromString( json );
1740 builder.AddActors( rootActor );
1742 application.SendNotification();
1743 application.Render();
1745 Actor createdActor = rootActor.GetChildAt( 0 );
1746 DALI_TEST_EQUALS( createdActor.GetMaximumSize(), Vector2(100.0f,15.0f), TEST_LOCATION );
1747 DALI_TEST_EQUALS( createdActor.GetCurrentPosition(), Vector3(100.0f,10.0f,1.0f), TEST_LOCATION );
1748 DALI_TEST_EQUALS( createdActor.GetCurrentColor(), Vector4(0.5f,0.5f,0.5f,1.0f), TEST_LOCATION );
1749 DALI_TEST_EQUALS( createdActor.IsSensitive(), false, TEST_LOCATION );
1750 DALI_TEST_EQUALS( createdActor.GetColorMode(), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION );
1755 int UtcDaliBuilderBuilderControl(void)
1757 ToolkitTestApplication application;
1763 "\"type\": \"BuilderControl\","
1764 "\"integerProperty\": 10,"
1765 "\"matrix3Property\": [ 1,2,3,4,5,6,7,8,9 ],"
1766 "\"matrixProperty\": [ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 ],"
1767 "\"noneProperty\": 10"
1772 Actor rootActor = Actor::New();
1773 Stage::GetCurrent().Add( rootActor );
1775 Builder builder = Builder::New();
1776 builder.LoadFromString( json );
1777 builder.AddActors( rootActor );
1779 application.SendNotification();
1780 application.Render();
1782 DALI_TEST_EQUALS( BuilderControlProperty::gSetPropertyCalledCount, 4, TEST_LOCATION );
1787 int UtcDaliBuilderActionsWithParams(void)
1789 ToolkitTestApplication application;
1791 // JSON with a quit event when the actor is touched
1797 " \"type\": \"ImageView\",\n"
1798 " \"name\": \"image\",\n"
1799 " \"size\": [100,100,1],\n"
1800 " \"signals\": [{\n"
1801 " \"name\": \"touch\",\n"
1802 " \"action\": \"show\",\n"
1803 " \"parameters\": {\n"
1804 " \"property1\" : 10,\n"
1805 " \"property2\" : [1,2],\n"
1806 " \"property3\" : [1,2,3],\n"
1807 " \"property4\" : [1,2,3,4]\n"
1815 Builder builder = Builder::New();
1816 builder.LoadFromString( json );
1817 builder.AddActors( Stage::GetCurrent().GetRootLayer() );
1819 DALI_TEST_CHECK( true ); // For Coverage
1824 int UtcDaliBuilderConfigurationP(void)
1826 ToolkitTestApplication application;
1828 // JSON with a quit event when the actor is touched
1833 " \"alwaysShowFocus\":true\n"
1838 Builder builder = Builder::New();
1839 builder.LoadFromString( json );
1841 Property::Map map = builder.GetConfigurations();
1843 Dali::Property::Value* pValue = map.Find( "alwaysShowFocus" );
1845 DALI_TEST_CHECK( pValue );
1847 bool value = pValue->Get<bool>();
1849 DALI_TEST_CHECK( value );