int UtcDaliImageActorImageProperty(void) { TestApplication application; Image image = Image::New( "MY_PATH" ); ImageActor imageActor = ImageActor::New( image ); Stage::GetCurrent().Add( imageActor ); application.SendNotification(); application.Render(); Property::Value imageMap = imageActor.GetProperty( ImageActor::IMAGE ); DALI_TEST_CHECK( imageMap.HasKey( "filename" ) ); DALI_TEST_EQUALS( imageMap.GetValue( "filename" ).Get< std::string >(), "MY_PATH", TEST_LOCATION ); END_TEST; }
int UtcDaliImageActorDefaultProperties(void) { TestApplication application; tet_infoline("Testing Dali::ImageActor DefaultProperties"); BitmapImage img = BitmapImage::New( 10, 10 ); ImageActor actor = ImageActor::New( img ); std::vector<Property::Index> indices; indices.push_back(ImageActor::PIXEL_AREA ); indices.push_back(ImageActor::FADE_IN ); indices.push_back(ImageActor::FADE_IN_DURATION); indices.push_back(ImageActor::STYLE ); indices.push_back(ImageActor::BORDER ); indices.push_back(ImageActor::IMAGE ); DALI_TEST_CHECK(actor.GetPropertyCount() == ( Actor::New().GetPropertyCount() + indices.size() ) ); for(std::vector<Property::Index>::iterator iter = indices.begin(); iter != indices.end(); ++iter) { DALI_TEST_CHECK( *iter == actor.GetPropertyIndex(actor.GetPropertyName(*iter)) ); DALI_TEST_CHECK( actor.IsPropertyWritable(*iter) ); DALI_TEST_CHECK( !actor.IsPropertyAnimatable(*iter) ); DALI_TEST_CHECK( actor.GetPropertyType(*iter) == actor.GetPropertyType(*iter) ); // just checking call succeeds } // set/get one of them actor.SetPixelArea(ImageActor::PixelArea( 0, 0, 0, 0 )); ImageActor::PixelArea area( 1, 2, 3, 4 ); actor.SetProperty(ImageActor::PIXEL_AREA, Property::Value(Rect<int>(area))); DALI_TEST_CHECK(Property::RECTANGLE == actor.GetPropertyType(ImageActor::PIXEL_AREA)); Property::Value v = actor.GetProperty(ImageActor::PIXEL_AREA); DALI_TEST_CHECK(v.Get<Rect<int> >() == area); END_TEST; }