X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-VisualFactory.cpp;h=2eb62623b79ba11b8228d6338569703662970a77;hp=48de1ca3b9b412d3a60db258d21e96f67c4bdf75;hb=0a98cc9159a2b5868987ec7f0b31b76f3dc10259;hpb=f7b1e17d935be0ca40c3529484a4784243e5f709 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp b/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp index 48de1ca..2eb6262 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp @@ -1976,142 +1976,6 @@ int UtcDaliVisualFactoryGetPrimitiveVisualN1(void) END_TEST; } -int UtcDaliVisualFactoryGetBatchImageVisual1(void) -{ - ToolkitTestApplication application; - tet_infoline( "UtcDaliVisualFactoryGetBatchImageVisual1: Request a Batch Image visual with a Property::Map" ); - - VisualFactory factory = VisualFactory::Get(); - DALI_TEST_CHECK( factory ); - - Property::Map propertyMap; - propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE ); - propertyMap.Insert( ImageVisual::Property::BATCHING_ENABLED, true ); - propertyMap.Insert( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME ); - - Visual::Base visual = factory.CreateVisual( propertyMap ); - DALI_TEST_CHECK( visual ); - - DummyControl actor = DummyControl::New(); - DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); - dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); - - actor.SetSize( 200.0f, 200.0f ); - Stage::GetCurrent().Add( actor ); - visual.SetTransformAndSize(DefaultTransform(), Vector2( 200.0f, 200.0f ) ); - - // Test SetOnStage(). - DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); - - application.SendNotification(); - application.Render(); - - // Test SetOffStage(). - actor.Unparent(); - DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); - - END_TEST; -} - -int UtcDaliVisualFactoryGetBatchImageVisual2(void) -{ - ToolkitTestApplication application; - tet_infoline( "UtcDaliVisualFactoryGetBatchImageVisual2: Request Batch Image visual from an Image Visual with batchingEnabled set" ); - - VisualFactory factory = VisualFactory::Get(); - DALI_TEST_CHECK( factory ); - - Property::Map propertyMap; - // Create a normal Image Visual. - propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE ); - // Instruct the factory to change Image Visuals to Batch-Image Visuals. - propertyMap.Insert( ImageVisual::Property::BATCHING_ENABLED, true ); - - // Properties for the Batch-Image Visual. - propertyMap.Insert( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME ); - - Visual::Base visual = factory.CreateVisual( propertyMap ); - DALI_TEST_CHECK( visual ); - - // Check that a Batch-Image visual was created instead of an Image visual. - Property::Map resultMap; - visual.CreatePropertyMap( resultMap ); - - Property::Value* value = resultMap.Find( Visual::Property::TYPE, Property::INTEGER ); - DALI_TEST_CHECK( value ); - DALI_TEST_EQUALS( value->Get(), (int)Visual::IMAGE, TEST_LOCATION ); - - DummyControl actor = DummyControl::New(); - DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); - dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); - - actor.SetSize( 200.0f, 200.0f ); - Stage::GetCurrent().Add( actor ); - visual.SetTransformAndSize(DefaultTransform(), Vector2( 200.0f, 200.0f ) ); - - // Test SetOnStage(). - DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); - - application.SendNotification(); - application.Render(); - - // Test SetOffStage(). - actor.Unparent(); - DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); - - END_TEST; -} - -int UtcDaliVisualFactoryGetBatchImageVisual3(void) -{ - ToolkitTestApplication application; - tet_infoline( "UtcDaliVisualFactoryGetBatchImageVisual3: Create an ImageView that uses a batched visual internally" ); - - VisualFactory factory = VisualFactory::Get(); - DALI_TEST_CHECK( factory ); - - // Create a property-map that enables batching. - Property::Map propertyMap; - propertyMap[ Dali::Toolkit::ImageVisual::Property::URL ] = TEST_IMAGE_FILE_NAME ; - propertyMap[ "desiredHeight" ] = 200; - propertyMap[ "desiredWidth" ] = 200; - propertyMap[ "batchingEnabled" ] = true; - - // Create an ImageView, passing the property-map in to instruct it to use batching. - Toolkit::ImageView imageView = Toolkit::ImageView::New(); - imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, propertyMap ); - - imageView.SetSize( 200.0f, 200.0f ); - Stage::GetCurrent().Add( imageView ); - - END_TEST; -} - -int UtcDaliVisualFactoryGetBatchImageVisual4N(void) -{ - ToolkitTestApplication application; - tet_infoline( "UtcDaliVisualFactoryGetBatchImageVisual4: Create an ImageView that uses a batched visual, with desired properties of the wrong type" ); - - VisualFactory factory = VisualFactory::Get(); - DALI_TEST_CHECK( factory ); - - // Create a property-map that enables batching. - Property::Map propertyMap; - propertyMap[ Dali::Toolkit::ImageVisual::Property::URL ] = TEST_IMAGE_FILE_NAME ; - propertyMap[ "desiredHeight" ] = Vector2(100, 100); - propertyMap[ "desiredWidth" ] = Vector3(1, 1, 1); - propertyMap[ "batchingEnabled" ] = true; - - // Create an ImageView, passing the property-map in to instruct it to use batching. - Toolkit::ImageView imageView = Toolkit::ImageView::New(); - imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, propertyMap ); - - imageView.SetSize( 200.0f, 200.0f ); - Stage::GetCurrent().Add( imageView ); - - END_TEST; -} - int UtcDaliVisualFactoryGetAnimatedImageVisual1(void) { ToolkitTestApplication application;