/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
{
// emulate load success
Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
- Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::DISCARD );
+ Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD );
Integration::ResourcePointer resource( bitmap );
bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, width, height, width, height );
if( request )
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
+ DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceSynchronouslyFunc ) );
application.GetPlatform().ResetTrace();
Image image2 = ResourceImage::New( gTestImageFilename );
application.SendNotification();
application.Render();
- // check resource is not loaded twice
- DALI_TEST_CHECK( !application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
+ // Resource is loaded twice
+ DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceSynchronouslyFunc ) );
application.GetPlatform().ResetTrace();
Image image3 = ResourceImage::New( gTestImageFilename );
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( !application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
+ DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceSynchronouslyFunc ) );
END_TEST;
}
// testing resource deletion when taken off stage
tet_infoline( "UtcDaliImageFactoryCachedRequest02 - Discard previously requested resource" );
- Image image = ResourceImage::New( gTestImageFilename, ResourceImage::IMMEDIATE, Image::UNUSED );
- ImageActor actor = ImageActor::New( image );
+ Image image = ResourceImage::New( gTestImageFilename );
+ Actor actor = CreateRenderableActor( image );
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
+ DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceSynchronouslyFunc ) );
application.GetPlatform().ResetTrace();
// Add actor to stage
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceFunc ) );
+ DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::LoadResourceSynchronouslyFunc ) );
application.GetPlatform().ResetTrace();
// Resource is reloaded
application.GetPlatform().ResetTrace();
ticket = imageFactory.Reload( *req.Get() );
+ DALI_TEST_CHECK( ticket );
application.SendNotification();
application.Render();
EmulateImageLoaded( application, 80, 80 );
ticket = imageFactory.Reload( *req.Get() );
+ DALI_TEST_CHECK( ticket );
application.SendNotification();
application.Render();