X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-VisualFactory.cpp;h=c1f7d0094e922255524cb12a459c689b998d6b1a;hb=98de7da7b7768f266b3e9579ede04ec421bfe596;hp=2eb62623b79ba11b8228d6338569703662970a77;hpb=c57e053b5795783ad92b0fd7f8fbaba6b6d9322a;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp b/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp index 2eb6262..c1f7d00 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,7 +61,8 @@ Property::Map DefaultTransform() .Add( Toolkit::DevelVisual::Transform::Property::SIZE, Vector2(1.0f, 1.0f) ) .Add( Toolkit::DevelVisual::Transform::Property::ORIGIN, Toolkit::Align::CENTER ) .Add( Toolkit::DevelVisual::Transform::Property::ANCHOR_POINT, Toolkit::Align::CENTER ) - .Add( Toolkit::DevelVisual::Transform::Property::OFFSET_SIZE_MODE, Vector4::ZERO ); + .Add( Toolkit::DevelVisual::Transform::Property::OFFSET_POLICY, Vector2( Toolkit::DevelVisual::Transform::Policy::RELATIVE, Toolkit::DevelVisual::Transform::Policy::RELATIVE ) ) + .Add( Toolkit::DevelVisual::Transform::Property::SIZE_POLICY, Vector2( Toolkit::DevelVisual::Transform::Policy::RELATIVE, Toolkit::DevelVisual::Transform::Policy::RELATIVE ) ); return transformMap; } @@ -223,22 +224,12 @@ void TestVisualRender( ToolkitTestApplication& application, application.SendNotification(); application.Render(); - if( resourcePtr ) - { - Integration::ResourceRequest* request = application.GetPlatform().GetRequest(); - if(request) - { - application.GetPlatform().SetResourceLoaded(request->GetId(), request->GetType()->id, resourcePtr ); - } - } - application.Render(); application.SendNotification(); if( resourcePtr ) { - DALI_TEST_EQUALS( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) || - application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceSynchronouslyFunc ), true, TEST_LOCATION); + DALI_TEST_EQUALS( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceSynchronouslyFunc ), true, TEST_LOCATION); } DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION ); @@ -330,10 +321,13 @@ int UtcDaliVisualFactoryGetColorVisual1(void) DummyControl actor = DummyControl::New(); TestVisualRender( application, actor, visual ); - Vector4 actualValue(Vector4::ZERO); + Vector3 actualValue(Vector4::ZERO); + float opacity=0.0f; TestGlAbstraction& gl = application.GetGlAbstraction(); - DALI_TEST_CHECK( gl.GetUniformValue( "mixColor", actualValue ) ); - DALI_TEST_EQUALS( actualValue, testColor, TEST_LOCATION ); + DALI_TEST_CHECK( gl.GetUniformValue( "mixColor", actualValue ) ); + DALI_TEST_CHECK( gl.GetUniformValue( "opacity", opacity ) ); + DALI_TEST_EQUALS( actualValue, Vector3(testColor), TEST_LOCATION ); + DALI_TEST_EQUALS( opacity, testColor.a, TEST_LOCATION ); END_TEST; } @@ -356,10 +350,13 @@ int UtcDaliVisualFactoryGetColorVisual2(void) DummyControl actor = DummyControl::New(); TestVisualRender( application, actor, visual ); - Vector4 actualValue(Vector4::ZERO); + Vector3 actualValue; + float opacity; TestGlAbstraction& gl = application.GetGlAbstraction(); - DALI_TEST_CHECK( gl.GetUniformValue( "mixColor", actualValue ) ); - DALI_TEST_EQUALS( actualValue, testColor, TEST_LOCATION ); + DALI_TEST_CHECK( gl.GetUniformValue( "mixColor", actualValue ) ); + DALI_TEST_CHECK( gl.GetUniformValue( "opacity", opacity ) ); + DALI_TEST_EQUALS( actualValue, Vector3(testColor), TEST_LOCATION ); + DALI_TEST_EQUALS( opacity, testColor.a, TEST_LOCATION ); Stage::GetCurrent().Remove(actor); DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); @@ -1228,10 +1225,6 @@ void MeshVisualLoadsCorrectlyTest( Property::Map& propertyMap, ToolkitTestApplic application.SendNotification(); application.Render( 0 ); - //Tell the platform abstraction that the required resources have been loaded. - TestPlatformAbstraction& platform = application.GetPlatform(); - platform.SetAllResourceRequestsAsLoaded(); - //Render again to upload the now-loaded textures. application.SendNotification(); application.Render( 0 ); @@ -1275,10 +1268,6 @@ void MeshVisualDoesNotLoadCorrectlyTest( Property::Map& propertyMap, ToolkitTest application.SendNotification(); application.Render( 0 ); - //Tell the platform abstraction that the required resources have been loaded. - TestPlatformAbstraction& platform = application.GetPlatform(); - platform.SetAllResourceRequestsAsLoaded(); - //Render again to upload the now-loaded textures. application.SendNotification(); application.Render( 0 );