Merge "Merge branch 'tizen' into devel/new_mesh" into devel/new_mesh
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-internal / utc-Dali-PushButton.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 #include <iostream>
19
20 #include <stdlib.h>
21 #include <dali-toolkit/internal/controls/buttons/push-button-impl.h>
22 #include <dali-toolkit-test-suite-utils.h>
23 #include <dali-toolkit/dali-toolkit.h>
24 #include <dali/integration-api/events/touch-event-integ.h>
25
26
27 using namespace Dali;
28 using namespace Toolkit;
29
30 namespace
31 {
32
33 static bool gPushButtonSelectedState = false;
34 bool PushButtonSelected( Button button, bool selected )
35 {
36   gPushButtonSelectedState = selected && ( selected == static_cast<PushButton&>( button ).IsSelected() );
37   return true;
38 }
39
40
41 const Dali::TouchPoint pointDownInside( 0, TouchPoint::Down, 240, 400 );
42 const Dali::TouchPoint pointUpInside( 0, TouchPoint::Up, 240, 400 );
43 const Dali::TouchPoint pointLeave( 0, TouchPoint::Leave, 240, 400 );
44 const Dali::TouchPoint pointEnter( 0, TouchPoint::Motion, 240, 400 );
45 const Dali::TouchPoint pointMotionOut( 0, TouchPoint::Motion, 10, 10 );
46 const Dali::TouchPoint pointDownOutside( 0, TouchPoint::Down, 10, 10 );
47 const Dali::TouchPoint pointUpOutside( 0, TouchPoint::Up, 10, 10 );
48 } // namespace
49
50
51 //////////////////////////////////////////////////////////
52
53 namespace
54 {
55 static bool gOnTouchPointInterrupted = false;
56 } //namespace
57
58 namespace Dali
59 {
60
61 namespace Toolkit
62 {
63
64 namespace Internal
65 {
66 class TETButton;
67 }
68
69 /**
70  * Creates a PushButton to test if interrupt events are handled correctly.
71  */
72 class TETButton : public PushButton
73 {
74 public:
75   // PushButton Pressed
76   typedef Signal< bool ( PushButton ) > ButtonSignalType;
77
78   ButtonSignalType& PressedSignal();
79
80   /**
81    * Default constructor.
82    */
83   TETButton();
84
85   /**
86    * Copy constructor.
87    */
88   TETButton( const PushButton& button );
89
90   /**
91    * Assignment operator.
92    */
93   TETButton& operator=( const TETButton& button );
94
95   /**
96    * Creates and initializes a new button.
97    */
98   static TETButton New();
99
100   /**
101    * Down cast to TETButton.
102    */
103   static TETButton DownCast( BaseHandle handle );
104
105   /**
106    * Creates a handle using the Toolkit::Internal implementation.
107    * @param[in]  implementation  The Control implementation.
108    */
109   TETButton( Internal::TETButton& implementation );
110
111   /**
112    * Allows the creation of this Control from an Internal::CustomActor pointer.
113    * @param[in]  internal  A pointer to the internal CustomActor.
114    */
115   TETButton( Dali::Internal::CustomActor* internal );
116 };
117
118 namespace Internal
119 {
120
121 /**
122  * Internal implementation
123  */
124 class TETButton : public PushButton
125 {
126 public:
127   /**
128    * Construct a new Button.
129    */
130   TETButton();
131
132   /**
133    * A reference counted object may only be deleted by calling Unreference()
134    */
135   virtual ~TETButton();
136
137   /**
138    * Creates an internal button.
139    */
140   static Toolkit::TETButton New();
141
142   /**
143    * @return the pressed signal.
144    */
145   Toolkit::TETButton::ButtonSignalType& PressedSignal();
146
147   /**
148    * Callback called when an interrupt events is received.
149    */
150   void OnTouchPointInterrupted();
151
152   /**
153    * Callback received when a down event is received.
154    */
155   void OnButtonDown();
156
157   Toolkit::TETButton::ButtonSignalType mPressedSignal;   ///< Signal emitted when the button is pressed.
158 };
159
160 } // namespace Internal
161
162 TETButton::TETButton()
163 {
164 }
165
166 TETButton::TETButton( const PushButton& button )
167 : PushButton( button )
168 {
169 }
170
171 TETButton& TETButton::operator=( const TETButton& button )
172 {
173   if( &button != this )
174   {
175     PushButton::operator=( button );
176   }
177   return *this;
178 }
179
180 TETButton TETButton::New()
181 {
182   return Internal::TETButton::New();
183 }
184
185 TETButton TETButton::DownCast( BaseHandle handle )
186 {
187   return Control::DownCast<TETButton, Internal::TETButton>(handle);
188 }
189
190 TETButton::ButtonSignalType& TETButton::PressedSignal()
191 {
192   TETButton button( *this );
193   DALI_ASSERT_ALWAYS( button );
194
195   Dali::RefObject& handle = button.GetImplementation();
196
197   return static_cast<Toolkit::Internal::TETButton&>( handle ).PressedSignal();
198 }
199
200 TETButton::TETButton( Internal::TETButton& implementation )
201 : PushButton( implementation )
202 {}
203
204 TETButton::TETButton( Dali::Internal::CustomActor* internal )
205 : PushButton( internal )
206 {
207   VerifyCustomActorPointer<Internal::TETButton>(internal);
208 }
209
210 namespace Internal
211 {
212
213 TETButton::TETButton()
214 : PushButton(),
215   mPressedSignal()
216 {
217 }
218
219 TETButton::~TETButton()
220 {
221 }
222
223 Toolkit::TETButton TETButton::New()
224 {
225   // Create the implementation, temporarily owned on stack
226   IntrusivePtr< TETButton > internalTETButton = new TETButton();
227
228   // Pass ownership to CustomActor
229   Dali::Toolkit::TETButton tetButton( *internalTETButton );
230
231   // Second-phase init of the implementation
232   // This can only be done after the CustomActor connection has been made...
233   internalTETButton->Initialize();
234
235   return tetButton;
236 }
237
238 Toolkit::TETButton::ButtonSignalType& TETButton::PressedSignal()
239 {
240   return mPressedSignal;
241 }
242
243 void TETButton::OnButtonDown()
244 {
245   Toolkit::TETButton handle( GetOwner() );
246
247   //Emit signal.
248   mPressedSignal.Emit( handle );
249 }
250
251 void TETButton::OnTouchPointInterrupted()
252 {
253   gOnTouchPointInterrupted = true;
254 }
255
256 } // namespace Internal
257
258 } // namespace Toolkit
259
260 } // namespace Dali
261
262 namespace
263 {
264
265 class TETButtonPressed : public Dali::ConnectionTracker
266 {
267 public:
268   enum Test
269   {
270     SENSITIVENESS,
271     VISIBILITY
272   };
273
274   TETButtonPressed( Actor actor, Test test )
275   : mActor( actor ),
276     mTest( test )
277   {
278   }
279
280   bool Callback( PushButton button )
281   {
282     switch( mTest )
283     {
284       case SENSITIVENESS:
285       {
286         mActor.SetSensitive( false );
287         break;
288       }
289       case VISIBILITY:
290       {
291         std::cout <<"VISIBILITY false" << std::endl;
292         mActor.SetVisible( false );
293         break;
294       }
295       default:
296       {
297         break;
298       }
299     }
300     return true;
301   }
302
303   Actor mActor;
304   Test mTest;
305 };
306
307 static bool TestCallback(Actor actor, const TouchEvent& event)
308 {
309   return true;
310 }
311
312 } // namespace
313
314 //////////////////////////////////////////////////////////
315
316 int UtcDaliPushButtonDownCast(void)
317 {
318   ToolkitTestApplication application;
319   tet_infoline(" UtcDaliPushButtonDownCast");
320
321   TETButton tetButton= Toolkit::TETButton::New();
322
323   BaseHandle object(tetButton);
324
325   TETButton tetButton2 = TETButton::DownCast( object );
326   DALI_TEST_CHECK(tetButton2);
327
328   TETButton tetButton3 = DownCast< TETButton >(object);
329   DALI_TEST_CHECK(tetButton3);
330   END_TEST;
331 }
332
333 int UtcDaliPushButtonInterruptEventWhenInsensitive(void)
334 {
335   ToolkitTestApplication application;
336   tet_infoline(" UtcDaliPushButtonInterruptEventWhenInsensitive");
337
338   // * Creates an actor which contains a button.
339   // * The size of the actor is bigger than the button.
340   // * The button's boundary is contained in the actor's one.
341   Actor actor = Actor::New();
342   TETButton tetButton= Toolkit::TETButton::New();
343
344   actor.SetName( "Actor" );
345   tetButton.SetName( "TETButton" );
346
347   actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
348   actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
349   actor.SetPosition( 0, 0 );
350   actor.SetSize( 400, 800 );
351
352   tetButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
353   tetButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
354   tetButton.SetPosition( 240, 400 );
355   tetButton.SetSize( 100, 100 );
356
357   actor.Add( tetButton );
358   Stage::GetCurrent().Add( actor );
359
360   // * Actor's touch event is connected to a callback function
361   //   and this callback function consumes the event.
362   actor.TouchedSignal().Connect( &TestCallback );
363
364   // * Button's pressed signal is connected to a callback function
365   //   which also consumes the event.
366   // * Changes the sensitiveness of the button to false.
367   TETButtonPressed tetButtonPressed( actor, TETButtonPressed::SENSITIVENESS );
368   tetButton.PressedSignal().Connect( &tetButtonPressed, &TETButtonPressed::Callback );
369
370   // Initializes TET state.
371   gOnTouchPointInterrupted = false;
372   tetButton.SetSensitive( true );
373
374   Dali::Integration::TouchEvent event;
375
376   // TET starts.
377
378   // Test a down point inside the button which is also consumed by the actor, and an up point
379   // consumed only by the actor.  gOnTouchPointInterrupted should be true (Button receives an
380   // interrupt event.
381
382   application.SendNotification();
383   application.Render();
384
385   // A down event is sent inside the button's boundary.
386
387   event = Dali::Integration::TouchEvent();
388   event.AddPoint( pointDownInside );
389
390   // flush the queue and render once
391   application.SendNotification();
392   application.Render();
393   application.ProcessEvent( event );
394
395   // An up event is sent outside the button's boundary but inside the actor's one.
396
397   event = Dali::Integration::TouchEvent();
398   event.AddPoint( pointUpOutside );
399
400   // flush the queue and render once
401   application.SendNotification();
402   application.Render();
403   application.ProcessEvent( event );
404
405   DALI_TEST_CHECK( gOnTouchPointInterrupted );
406
407   // Test a down point inside the button which is also consumed by the actor, and a motion point
408   // consumed only by the actor.  gOnTouchPointInterrupted should be true (Button receives an
409   // interrupt event.
410
411   // Initializes TET state.
412   gOnTouchPointInterrupted = false;
413   actor.SetSensitive( true );
414   tetButton.SetSensitive( true );
415
416   application.SendNotification();
417   application.Render();
418
419   // A down event is sent inside the button's boundary.
420
421   event = Dali::Integration::TouchEvent();
422   event.AddPoint( pointDownInside );
423
424   // flush the queue and render once
425   application.SendNotification();
426   application.Render();
427   application.ProcessEvent( event );
428
429   // A motion event is sent outside the button's boundary but inside the actor's one.
430
431   event = Dali::Integration::TouchEvent();
432   event.AddPoint( pointMotionOut );
433
434   // flush the queue and render once
435   application.SendNotification();
436   application.Render();
437   application.ProcessEvent( event );
438
439   DALI_TEST_CHECK( gOnTouchPointInterrupted );
440
441   // Test a down point inside the button which is also consumed by the actor, and an up point
442   // also inside the button and consumed by the actor.  gOnTouchPointInterrupted should be false.
443
444   // Initializes TET state.
445   gOnTouchPointInterrupted = false;
446   actor.SetSensitive( true );
447   tetButton.SetSensitive( true );
448
449   // A down event is sent inside the button's boundary.
450
451   event = Dali::Integration::TouchEvent();
452   event.AddPoint( pointDownInside );
453
454   // flush the queue and render once
455   application.SendNotification();
456   application.Render();
457   application.ProcessEvent( event );
458
459   actor.SetSensitive( true );
460   // An up event is sent inside the button's boundary.
461
462   event = Dali::Integration::TouchEvent();
463   event.AddPoint( pointUpInside );
464
465   // flush the queue and render once
466   application.SendNotification();
467   application.Render();
468   application.ProcessEvent( event );
469
470   DALI_TEST_CHECK( !gOnTouchPointInterrupted );
471   END_TEST;
472 }
473
474 int UtcDaliPushButtonInterruptEventWhenNonVisible(void)
475 {
476   ToolkitTestApplication application;
477   tet_infoline(" UtcDaliPushButtonInterruptEventWhenNonVisible");
478
479   // Does same test as above but changing the visibility instead the sensitiveness.
480
481   // * Creates an actor which contains a button.
482   // * The size of the actor is bigger than the button.
483   // * The button's boundary is contained in the actor's one.
484   Actor actor = Actor::New();
485   TETButton tetButton = Toolkit::TETButton::New();
486
487   actor.SetName( "Actor" );
488   tetButton.SetName( "TETButton" );
489
490   actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
491   actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
492   actor.SetPosition( 0, 0 );
493   actor.SetSize( 400, 800 );
494
495   tetButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
496   tetButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
497   tetButton.SetPosition( 240, 400 );
498   tetButton.SetSize( 100, 100 );
499
500   actor.Add( tetButton );
501   Stage::GetCurrent().Add( actor );
502
503   // * Actor's touch event is connected to a callback function
504   //   and this callback function consumes the event.
505   actor.TouchedSignal().Connect( &TestCallback );
506
507   // * Button's pressed signal is connected to a callback function
508   //   which also consumes the event.
509   // * Changes the visibility of the button to false.
510   TETButtonPressed tetButtonPressed( tetButton, TETButtonPressed::VISIBILITY );
511   tetButton.PressedSignal().Connect( &tetButtonPressed, &TETButtonPressed::Callback );
512
513   // Initializes TET state.
514   gOnTouchPointInterrupted = false;
515   tetButton.SetVisible( true );
516
517   Dali::Integration::TouchEvent event;
518
519   // TET starts.
520
521   // Test a down point inside the button which is also consumed by the actor, and an up point
522   // consumed only by the actor.  gOnTouchPointInterrupted should be true (Button receives an
523   // interrupt event.
524
525   application.SendNotification();
526   application.Render();
527
528   // A down event is sent inside the button's boundary.
529
530   event = Dali::Integration::TouchEvent();
531   event.AddPoint( pointDownInside );
532
533   // flush the queue and render once
534   application.SendNotification();
535   application.Render();
536   application.ProcessEvent( event );
537
538   // More renders are needed in order to allow the node of the actor to become invisible.
539   application.SendNotification();
540   application.Render();
541   application.SendNotification();
542   application.Render();
543   application.SendNotification();
544   application.Render();
545
546   // An up event is sent outside the button's boundary but inside the actor's one.
547
548   event = Dali::Integration::TouchEvent();
549   event.AddPoint( pointUpOutside );
550
551   // flush the queue and render once
552   application.SendNotification();
553   application.Render();
554   application.ProcessEvent( event );
555
556   DALI_TEST_CHECK( gOnTouchPointInterrupted );
557
558   // Test a down point inside the button which is also consumed by the actor, and a motion point
559   // consumed only by the actor.  gOnTouchPointInterrupted should be true (Button receives an
560   // interrupt event.
561
562   // Initializes TET state.
563   gOnTouchPointInterrupted = false;
564   tetButton.SetVisible( true );
565
566   application.SendNotification();
567   application.Render();
568   application.SendNotification();
569   application.Render();
570   application.SendNotification();
571   application.Render();
572
573   // A down event is sent inside the button's boundary.
574
575   event = Dali::Integration::TouchEvent();
576   event.AddPoint( pointDownInside );
577
578   // flush the queue and render once
579   application.SendNotification();
580   application.Render();
581   application.ProcessEvent( event );
582
583   // More renders are needed in order to allow the node of the actor to become invisible.
584   application.SendNotification();
585   application.Render();
586   application.SendNotification();
587   application.Render();
588   application.SendNotification();
589   application.Render();
590
591   // A motion event is sent outside the button's boundary but inside the actor's one.
592
593   event = Dali::Integration::TouchEvent();
594   event.AddPoint( pointMotionOut );
595
596   // flush the queue and render once
597   application.SendNotification();
598   application.Render();
599   application.ProcessEvent( event );
600
601   DALI_TEST_CHECK( gOnTouchPointInterrupted );
602
603   // Test a down point inside the button which is also consumed by the actor, and an up point
604   // also inside the button and consumed by the actor.  gOnTouchPointInterrupted should be false.
605
606   // Initializes TET state.
607   gOnTouchPointInterrupted = false;
608   tetButton.SetVisible( true );
609
610   application.SendNotification();
611   application.Render();
612   application.SendNotification();
613   application.Render();
614   application.SendNotification();
615   application.Render();
616
617   // A down event is sent inside the button's boundary.
618
619   event = Dali::Integration::TouchEvent();
620   event.AddPoint( pointDownInside );
621
622   // flush the queue and render once
623   application.SendNotification();
624   application.Render();
625   application.ProcessEvent( event );
626
627   tetButton.SetVisible( true );
628
629   application.SendNotification();
630   application.Render();
631   application.SendNotification();
632   application.Render();
633   application.SendNotification();
634   application.Render();
635
636   // An up event is sent inside the button's boundary.
637
638   event = Dali::Integration::TouchEvent();
639   event.AddPoint( pointUpInside );
640
641   // flush the queue and render once
642   application.SendNotification();
643   application.Render();
644   application.ProcessEvent( event );
645
646   DALI_TEST_CHECK( !gOnTouchPointInterrupted );
647   END_TEST;
648 }
649
650 int UtcDaliPushButtonProperties(void)
651 {
652   ToolkitTestApplication application;
653
654   PushButton button = PushButton::New();
655   Stage::GetCurrent().Add( button );
656
657   // Button::PROPERTY_AUTO_REPEATING
658   button.SetAutoRepeating( false );
659   DALI_TEST_CHECK( ! button.GetProperty< bool >( Button::Property::AUTO_REPEATING ) );
660   button.SetProperty( Button::Property::AUTO_REPEATING, true );
661   DALI_TEST_CHECK( button.IsAutoRepeating() ) ;
662   DALI_TEST_CHECK( button.GetProperty< bool >( Button::Property::AUTO_REPEATING ) );
663
664   // Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY
665   button.SetInitialAutoRepeatingDelay( 10.0f );
666   DALI_TEST_EQUALS( 10.0f, button.GetProperty< float >( Button::Property::INITIAL_AUTO_REPEATING_DELAY ), TEST_LOCATION );
667   button.SetProperty( Button::Property::INITIAL_AUTO_REPEATING_DELAY, 25.0f );
668   DALI_TEST_EQUALS( 25.0f, button.GetInitialAutoRepeatingDelay(), TEST_LOCATION );
669   DALI_TEST_EQUALS( 25.0f, button.GetProperty< float >( Button::Property::INITIAL_AUTO_REPEATING_DELAY ), TEST_LOCATION );
670
671   //  Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY
672   button.SetNextAutoRepeatingDelay( 3.0f );
673   DALI_TEST_EQUALS( 3.0f, button.GetProperty< float >( Button::Property::NEXT_AUTO_REPEATING_DELAY ), TEST_LOCATION );
674   button.SetProperty( Button::Property::NEXT_AUTO_REPEATING_DELAY, 4.0f );
675   DALI_TEST_EQUALS( 4.0f, button.GetNextAutoRepeatingDelay(), TEST_LOCATION );
676   DALI_TEST_EQUALS( 4.0f, button.GetProperty< float >( Button::Property::NEXT_AUTO_REPEATING_DELAY ), TEST_LOCATION );
677
678   //  Button::PROPERTY_TOGGLABLE
679   button.SetTogglableButton( false );
680   DALI_TEST_CHECK( ! button.GetProperty< bool >( Button::Property::TOGGLABLE ) );
681   button.SetProperty( Button::Property::TOGGLABLE, true );
682   DALI_TEST_CHECK( button.IsTogglableButton() ) ;
683   DALI_TEST_CHECK( button.GetProperty< bool >( Button::Property::TOGGLABLE ) );
684
685   //  Button::PROPERTY_SELECTED
686   button.SetSelected( false );
687   DALI_TEST_CHECK( ! button.GetProperty< bool >( Button::Property::SELECTED ) );
688   button.SetProperty( Button::Property::SELECTED, true );
689   DALI_TEST_CHECK( button.IsSelected() ) ;
690   DALI_TEST_CHECK( button.GetProperty< bool >( Button::Property::SELECTED ) );
691
692   //  Button::PROPERTY_NORMAL_STATE_ACTOR
693   {
694     button.SetButtonImage( ResourceImage::New( "IMAGE_PATH_1") );
695     DALI_TEST_EQUALS( "IMAGE_PATH_1", button.GetProperty( Button::Property::NORMAL_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
696
697     Property::Map map;
698     map[ "type" ] = "ImageActor";
699
700     button.SetProperty( Button::Property::NORMAL_STATE_ACTOR, map );
701     DALI_TEST_EQUALS( "ImageActor", button.GetProperty( Button::Property::NORMAL_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
702   }
703
704   //  Button::PROPERTY_SELECTED_STATE_ACTOR
705   {
706     button.SetSelectedImage( ResourceImage::New( "IMAGE_PATH_2") );
707     DALI_TEST_EQUALS( "IMAGE_PATH_2", button.GetProperty( Button::Property::SELECTED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
708
709     Property::Map map;
710     map[ "type" ] = "Actor";
711
712     button.SetProperty( Button::Property::SELECTED_STATE_ACTOR, map );
713     DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::Property::SELECTED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
714     DALI_TEST_CHECK( "ImageActor" != button.GetProperty( Button::Property::SELECTED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >() );
715   }
716
717   //  Button::PROPERTY_DISABLED_STATE_ACTOR
718   {
719     button.SetDisabledImage( ResourceImage::New( "IMAGE_PATH_3") );
720     DALI_TEST_EQUALS( "IMAGE_PATH_3", button.GetProperty( Button::Property::DISABLED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
721
722     Property::Map map;
723     map[ "type" ] = "Actor";
724
725     button.SetProperty( Button::Property::DISABLED_STATE_ACTOR, map );
726     DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::Property::DISABLED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
727   }
728
729   //  Button::PROPERTY_LABEL_ACTOR
730   {
731     button.SetLabel( "LABEL_TEXT_CUSTOM" );
732     DALI_TEST_EQUALS( "TextLabel", button.GetProperty( Button::Property::LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
733
734     Property::Map map;
735     map[ "type" ] = "Actor";
736
737     button.SetProperty( Button::Property::LABEL_ACTOR, map );
738     DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::Property::LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
739   }
740   END_TEST;
741 }