int UtcDaliObjectRegistrySignalImageActorCreated(void) { TestApplication application; ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry(); static const char* TestImageFilename = "icon_wrt.png"; Image image = ResourceImage::New(TestImageFilename); bool verified = false; TestImageActorCallback test(verified); Dali::RefObject* objectPointer = NULL; TestObjectDestroyedCallback test2(verified, objectPointer); registry.ObjectCreatedSignal().Connect(&application, test); registry.ObjectDestroyedSignal().Connect(&application, test2); { ImageActor actor = ImageActor::New(image); DALI_TEST_CHECK( test.mSignalVerified ); verified = false; objectPointer = actor.GetObjectPtr(); } DALI_TEST_CHECK( test.mSignalVerified ); END_TEST; }
int UtcDaliObjectRegistrySignalCameraCreated(void) { TestApplication application; ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry(); bool verified = false; TestCameraActorCallback test(verified); Dali::RefObject* objectPointer = NULL; TestObjectDestroyedCallback test2(verified, objectPointer); registry.ObjectCreatedSignal().Connect(&application, test); registry.ObjectDestroyedSignal().Connect(&application, test2); { CameraActor actor = CameraActor::New(); DALI_TEST_CHECK( test.mSignalVerified ); verified = false; objectPointer = actor.GetObjectPtr(); } DALI_TEST_CHECK( test.mSignalVerified ); END_TEST; }
int UtcDaliObjectRegistrySignalShaderEffectCreated(void) { TestApplication application; ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry(); static const char* VertexSource = "void main()\n" "{\n" " gl_Position = uProjection * uModelView * vec4(aPosition, 1.0);\n" " vTexCoord = aTexCoord;\n" "}\n"; static const char* FragmentSource = "void main()\n" "{\n" " gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;\n" "}\n"; bool verified = false; TestShaderEffectCallback test(verified); Dali::RefObject* objectPointer = NULL; TestObjectDestroyedCallback test2(verified, objectPointer); registry.ObjectCreatedSignal().Connect(&application, test); registry.ObjectDestroyedSignal().Connect(&application, test2); { ShaderEffect effect = ShaderEffect::New( VertexSource, FragmentSource ); DALI_TEST_CHECK( test.mSignalVerified ); verified = false; objectPointer = effect.GetObjectPtr(); } DALI_TEST_CHECK( test.mSignalVerified ); END_TEST; }