[3.0] Remove/move experimental features
[platform/core/uifw/dali-core.git] / automated-tests / src / dali-internal / utc-Dali-Internal-ResourceClient.cpp
index e10a999..034b341 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -23,9 +23,8 @@
 #include <test-native-image.h>
 
 // Internal headers are allowed here
-
 #include <dali/internal/event/common/thread-local-storage.h>
-#include <dali/internal/update/resources/bitmap-metadata.h>
+#include <dali/internal/update/resources/texture-metadata.h>
 #include <dali/internal/update/resources/resource-manager.h>
 #include <dali/internal/update/manager/update-manager.h>
 #include <dali/internal/event/resources/resource-client.h>
 #include <dali/internal/event/images/resource-image-impl.h>
 #include <dali/integration-api/resource-cache.h>
 #include <dali/internal/render/gl-resources/texture-declarations.h>
-#include <dali/internal/render/shaders/shader.h>
+#include <dali/internal/render/shaders/scene-graph-shader.h>
 #include <dali/internal/common/owner-pointer.h>
-#include <dali/public-api/shader-effects/shader-effect.h>
-
+#include <dali/internal/common/image-attributes.h>
 
 using namespace Dali;
+
 #include <mesh-builder.h>
 
 namespace
@@ -51,50 +50,35 @@ class TestTicketObserver : public Internal::ResourceTicketObserver
 public:
   TestTicketObserver()
   : mLoadingFailedCalled(0), mLoadingSucceededCalled(0),
-    mSavingFailedCalled(0), mSavingSucceededCalled(0),
     mUploadedCount(0)
   {}
 
   int LoadFailedCalled() {
-    tet_printf("TicketObserver: LoadingFailed() called %d times", mLoadingFailedCalled);
+    tet_printf("TicketObserver: LoadingFailed() called %d times\n", mLoadingFailedCalled);
     return mLoadingFailedCalled;
   }
   int LoadSucceededCalled() {
-    tet_printf("TicketObserver: LoadingSucceeded()  called %d times", mLoadingSucceededCalled);
+    tet_printf("TicketObserver: LoadingSucceeded()  called %d times\n", mLoadingSucceededCalled);
     return mLoadingSucceededCalled;
   }
-  int SaveFailedCalled() {
-    tet_printf("TicketObserver: SavingFailed() called %d times", mSavingFailedCalled);
-    return mSavingFailedCalled;
-  }
-  int SaveSucceededCalled() {
-    tet_printf("TicketObserver: SavingSucceeded() called %d times", mSavingSucceededCalled);
-    return mSavingSucceededCalled;
-  }
   int  UploadCalled() {
-    tet_printf("TicketObserver: Uploaded() called %d times", mUploadedCount);
+    tet_printf("TicketObserver: Uploaded() called %d times\n", mUploadedCount);
     return mUploadedCount;
   }
   void Reset() {
     mLoadingFailedCalled    = 0;
     mLoadingSucceededCalled = 0;
-    mSavingFailedCalled     = 0;
-    mSavingSucceededCalled  = 0;
     mUploadedCount           = 0;
   }
 
 public: // From ResourceTicketObserver
   virtual void ResourceLoadingFailed(const Internal::ResourceTicket& ticket) {mLoadingFailedCalled++;}
   virtual void ResourceLoadingSucceeded(const Internal::ResourceTicket& ticket) {mLoadingSucceededCalled++;}
-  virtual void ResourceSavingFailed(const Internal::ResourceTicket& ticket) {mSavingFailedCalled++;}
-  virtual void ResourceSavingSucceeded(const Internal::ResourceTicket& ticket) {mSavingSucceededCalled++;}
   virtual void ResourceUploaded(const Internal::ResourceTicket& ticket) {mUploadedCount++;}
 
 private:
   int mLoadingFailedCalled;
   int mLoadingSucceededCalled;
-  int mSavingFailedCalled;
-  int mSavingSucceededCalled;
   int mUploadedCount;
 };
 
@@ -116,11 +100,11 @@ static TestTicketLifetimeObserver testTicketLifetimeObserver;
 
 Internal::ImagePtr LoadImage(TestApplication& application, char* name)
 {
-  Internal::ResourceImagePtr image = Internal::ResourceImage::New( name, Dali::ImageAttributes::DEFAULT_ATTRIBUTES );
+  Internal::ResourceImagePtr image = Internal::ResourceImage::New( name, Internal::ImageAttributes::DEFAULT_ATTRIBUTES );
   application.SendNotification(); // Flush update messages
   application.Render();           // Process resource request
   Integration::ResourceRequest* req = application.GetPlatform().GetRequest();
-  Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::RETAIN );
+  Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
   bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 80,80,80,80 );
   Integration::ResourcePointer resourcePtr(bitmap); // reference it
   application.GetPlatform().SetResourceLoaded(req->GetId(), req->GetType()->id, resourcePtr);
@@ -136,14 +120,13 @@ Internal::ImagePtr LoadImage(TestApplication& application, char* name)
 Internal::ResourceTicketPtr CheckLoadBitmap(TestApplication& application, const char* name, int w, int h)
 {
   Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
-  ImageAttributes attr;
-  Integration::BitmapResourceType bitmapRequest(attr);
+  Integration::BitmapResourceType bitmapRequest;
   Internal::ResourceTicketPtr ticket = resourceClient.RequestResource( bitmapRequest, name );
   ticket->AddObserver(testTicketObserver);
   application.SendNotification(); // Flush update messages
   application.Render();           // Process resource request
   Integration::ResourceRequest*   req = application.GetPlatform().GetRequest();
-  Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::RETAIN );
+  Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
   bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, w, h, w, h );
   Integration::ResourcePointer resourcePtr(bitmap); // reference it
   application.GetPlatform().SetResourceLoaded(req->GetId(), req->GetType()->id, resourcePtr);
@@ -178,8 +161,7 @@ int UtcDaliInternalRequestResourceBitmapRequests01(void)
   tet_infoline("Testing bitmap requests");
 
   Internal::ResourceManager& resourceManager = Internal::ThreadLocalStorage::Get().GetResourceManager();
-  ImageAttributes attr;
-  Integration::BitmapResourceType bitmapRequest (attr);
+  Integration::BitmapResourceType bitmapRequest;
   Internal::ResourceId id(0);
 
   testTicketObserver.Reset();
@@ -210,7 +192,7 @@ int UtcDaliInternalRequestResourceBitmapRequests01(void)
 
     // Create a resource
     Integration::ResourceRequest* req = application.GetPlatform().GetRequest();
-    Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::RETAIN );
+    Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
     bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 80, 80, 80, 80 );
     Integration::ResourcePointer resourcePtr(bitmap); // reference it
 
@@ -226,9 +208,10 @@ int UtcDaliInternalRequestResourceBitmapRequests01(void)
     DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::GetResourcesFunc ) );
 
     DALI_TEST_CHECK( resourceManager.IsResourceLoaded(req->GetId()) );
-    Internal::BitmapMetadata bitmapData = resourceManager.GetBitmapMetadata(req->GetId());
-    DALI_TEST_CHECK( bitmapData.GetWidth() == 80 );
-    DALI_TEST_CHECK( bitmapData.GetHeight() == 80 );
+    Internal::TextureMetadata* bitmapData = NULL;
+    DALI_TEST_CHECK( resourceManager.GetTextureMetadata(req->GetId(), bitmapData ) );
+    DALI_TEST_CHECK( bitmapData->GetWidth() == 80 );
+    DALI_TEST_CHECK( bitmapData->GetHeight() == 80 );
 
     DALI_TEST_EQUALS( imageTicket->GetWidth(), 0, TEST_LOCATION );
     DALI_TEST_EQUALS( imageTicket->GetHeight(), 0, TEST_LOCATION );
@@ -267,8 +250,7 @@ int UtcDaliInternalRequestResourceBitmapRequests02(void)
   tet_infoline("Testing bitmap request ticket discard before load complete");
 
   Internal::ResourceManager& resourceManager = Internal::ThreadLocalStorage::Get().GetResourceManager();
-  ImageAttributes attr;
-  Integration::BitmapResourceType bitmapRequest (attr);
+  Integration::BitmapResourceType bitmapRequest;
   Internal::ResourceId id(0);
 
   testTicketObserver.Reset();
@@ -331,8 +313,7 @@ int UtcDaliInternalRequestResourceBitmapRequests03(void)
   tet_infoline("Load bitmap that doesn't exist, followed by ticket discard. Expect LoadingFailed");
 
   Internal::ResourceManager& resourceManager = Internal::ThreadLocalStorage::Get().GetResourceManager();
-  ImageAttributes attr;
-  Integration::BitmapResourceType bitmapRequest (attr);
+  Integration::BitmapResourceType bitmapRequest;
   Internal::ResourceId id(0);
 
   testTicketObserver.Reset();
@@ -425,30 +406,31 @@ int UtcDaliInternalRequestReloadBitmapRequests01(void)
 
     // Create a new resource - the image size could have changed in the meantime
     Integration::ResourceRequest* req = application.GetPlatform().GetRequest();
-    Integration::Bitmap* bitmap2 = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::RETAIN );
+    Integration::Bitmap* bitmap2 = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
     bitmap2->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 120, 120, 120, 120 );
     Integration::ResourcePointer resourcePtr2(bitmap2); // reference it
     DALI_TEST_CHECK( req->GetId() == ticket->GetId() );
     application.GetPlatform().SetResourceLoaded(id, Integration::ResourceBitmap, resourcePtr2);
 
-    application.Render(0);  // Process update messages / UpdateCache
+    application.Render(0 , TEST_LOCATION );  // Process update messages / UpdateCache
     DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::GetResourcesFunc ) );
 
     DALI_TEST_CHECK( resourceManager.IsResourceLoaded(id));
-    Internal::BitmapMetadata bitmapData = resourceManager.GetBitmapMetadata(id);
-    DALI_TEST_CHECK( bitmapData.GetWidth() == 120 );
-    DALI_TEST_CHECK( bitmapData.GetHeight() == 120 );
+    Internal::TextureMetadata* bitmapData = NULL;
+    DALI_TEST_CHECK( resourceManager.GetTextureMetadata(req->GetId(), bitmapData ) );
+    DALI_TEST_CHECK( bitmapData->GetWidth() == 120 );
+    DALI_TEST_CHECK( bitmapData->GetHeight() == 120 );
 
     // Ticket can't have been updated yet - it should still have old values
     DALI_TEST_EQUALS( imageTicket->GetWidth(), 80, TEST_LOCATION );
     DALI_TEST_EQUALS( imageTicket->GetHeight(), 80, TEST_LOCATION );
 
     application.SendNotification(); // Process event messages
-    application.Render(0);          // Process update messages / UpdateCache
+    application.Render(0, TEST_LOCATION ); // Process update messages / UpdateCache
     application.SendNotification(); // Process event messages
 
     DALI_TEST_EQUALS( testTicketObserver.LoadSucceededCalled(), 2, TEST_LOCATION );
-    DALI_TEST_EQUALS( testTicketObserver.UploadCalled(), 0, TEST_LOCATION );
+    DALI_TEST_EQUALS( testTicketObserver.UploadCalled(), 1, TEST_LOCATION );
     DALI_TEST_EQUALS( ticket->GetLoadingState(), ResourceLoadingSucceeded, TEST_LOCATION );
     DALI_TEST_EQUALS( imageTicket->GetWidth(), 120, TEST_LOCATION );
     DALI_TEST_EQUALS( imageTicket->GetHeight(), 120, TEST_LOCATION );
@@ -456,9 +438,8 @@ int UtcDaliInternalRequestReloadBitmapRequests01(void)
   } // Discard ticket
 
   application.SendNotification(); // Flush update queue (with ticket discarded message
-  application.Render(1);          // Process update messages
+  application.Render(1, TEST_LOCATION );          // Process update messages
   application.SendNotification(); // Send event notifications
-  application.Render(1);          // Process update messages
 
   // Resource should have been discarded.
   DALI_TEST_CHECK( ! application.GetPlatform().WasCalled(TestPlatformAbstraction::CancelLoadFunc ) );
@@ -466,7 +447,7 @@ int UtcDaliInternalRequestReloadBitmapRequests01(void)
 
   DALI_TEST_EQUALS( testTicketObserver.LoadSucceededCalled(), 2, TEST_LOCATION );
   DALI_TEST_EQUALS( testTicketObserver.LoadFailedCalled(), 0, TEST_LOCATION );
-  DALI_TEST_EQUALS( testTicketObserver.UploadCalled(), 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( testTicketObserver.UploadCalled(), 1, TEST_LOCATION );
   END_TEST;
 }
 
@@ -478,8 +459,7 @@ int UtcDaliInternalRequestReloadBitmapRequests02(void)
   tet_infoline("Testing bitmap reload during first load");
 
   Internal::ResourceManager& resourceManager = Internal::ThreadLocalStorage::Get().GetResourceManager();
-  ImageAttributes attr;
-  Integration::BitmapResourceType bitmapRequest (attr);
+  Integration::BitmapResourceType bitmapRequest;
   Internal::ResourceId id(0);
 
   testTicketObserver.Reset();
@@ -524,7 +504,7 @@ int UtcDaliInternalRequestReloadBitmapRequests02(void)
     DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::GetResourcesFunc ) );
     // Create a resource
     Integration::ResourceRequest* req = application.GetPlatform().GetRequest();
-    Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::RETAIN );
+    Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
     bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 80, 80, 80, 80 );
     Integration::ResourcePointer resourcePtr(bitmap); // reference it
 
@@ -540,9 +520,10 @@ int UtcDaliInternalRequestReloadBitmapRequests02(void)
     application.Render(0);
     DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::GetResourcesFunc ) );
     DALI_TEST_CHECK( resourceManager.IsResourceLoaded(id));
-    Internal::BitmapMetadata bitmapData = resourceManager.GetBitmapMetadata(id);
-    DALI_TEST_CHECK( bitmapData.GetWidth() == 80 );
-    DALI_TEST_CHECK( bitmapData.GetHeight() == 80 );
+    Internal::TextureMetadata* bitmapData = NULL;
+    DALI_TEST_CHECK( resourceManager.GetTextureMetadata(req->GetId(), bitmapData ) );
+    DALI_TEST_CHECK( bitmapData->GetWidth() == 80 );
+    DALI_TEST_CHECK( bitmapData->GetHeight() == 80 );
 
     DALI_TEST_EQUALS( imageTicket->GetWidth(), 0, TEST_LOCATION );
     DALI_TEST_EQUALS( imageTicket->GetHeight(), 0, TEST_LOCATION );
@@ -574,9 +555,9 @@ int UtcDaliInternalRequestReloadBitmapRequests02(void)
     DALI_TEST_EQUALS( testTicketObserver.UploadCalled(), 0, TEST_LOCATION );
 
     DALI_TEST_CHECK( resourceManager.IsResourceLoaded(id));
-    bitmapData = resourceManager.GetBitmapMetadata(id);
-    DALI_TEST_CHECK( bitmapData.GetWidth() == 80 );
-    DALI_TEST_CHECK( bitmapData.GetHeight() == 80 );
+    DALI_TEST_CHECK( resourceManager.GetTextureMetadata(req->GetId(), bitmapData ) );
+    DALI_TEST_CHECK( bitmapData->GetWidth() == 80 );
+    DALI_TEST_CHECK( bitmapData->GetHeight() == 80 );
     DALI_TEST_EQUALS( imageTicket->GetWidth(), 80, TEST_LOCATION );
     DALI_TEST_EQUALS( imageTicket->GetHeight(), 80, TEST_LOCATION );
 
@@ -592,8 +573,7 @@ int UtcDaliInternalRequestReloadBitmapRequests03(void)
   tet_infoline("Testing bitmap reload at end of first load");
 
   Internal::ResourceManager& resourceManager = Internal::ThreadLocalStorage::Get().GetResourceManager();
-  ImageAttributes attr;
-  Integration::BitmapResourceType bitmapRequest (attr);
+  Integration::BitmapResourceType bitmapRequest;
   Internal::ResourceId id(0);
 
   testTicketObserver.Reset();
@@ -634,7 +614,7 @@ int UtcDaliInternalRequestReloadBitmapRequests03(void)
 
     // Create a resource
     Integration::ResourceRequest* req = application.GetPlatform().GetRequest();
-    Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::RETAIN );
+    Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
     bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 80, 80, 80, 80 );
     Integration::ResourcePointer resourcePtr(bitmap); // reference it
 
@@ -655,9 +635,10 @@ int UtcDaliInternalRequestReloadBitmapRequests03(void)
     DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::GetResourcesFunc ) );
 
     DALI_TEST_CHECK( resourceManager.IsResourceLoaded(id));
-    Internal::BitmapMetadata bitmapData = resourceManager.GetBitmapMetadata(id);
-    DALI_TEST_CHECK( bitmapData.GetWidth() == 80 );
-    DALI_TEST_CHECK( bitmapData.GetHeight() == 80 );
+    Internal::TextureMetadata* bitmapData = NULL;
+    DALI_TEST_CHECK( resourceManager.GetTextureMetadata(req->GetId(), bitmapData ) );
+    DALI_TEST_CHECK( bitmapData->GetWidth() == 80 );
+    DALI_TEST_CHECK( bitmapData->GetHeight() == 80 );
 
     DALI_TEST_EQUALS( imageTicket->GetWidth(), 0, TEST_LOCATION );
     DALI_TEST_EQUALS( imageTicket->GetHeight(), 0, TEST_LOCATION );
@@ -678,7 +659,7 @@ int UtcDaliInternalRequestReloadBitmapRequests03(void)
 
     // Create a new resource - the image size could have changed in the meantime
     req = application.GetPlatform().GetRequest();
-    Integration::Bitmap* bitmap2 = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::RETAIN );
+    Integration::Bitmap* bitmap2 = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
     bitmap2->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 120, 120, 120, 120 );
     Integration::ResourcePointer resourcePtr2(bitmap2); // reference it
     DALI_TEST_CHECK( req->GetId() == id );
@@ -687,9 +668,9 @@ int UtcDaliInternalRequestReloadBitmapRequests03(void)
     application.Render(0);  // Process update messages / UpdateCache
 
     DALI_TEST_CHECK( resourceManager.IsResourceLoaded(id));
-    bitmapData = resourceManager.GetBitmapMetadata(id);
-    DALI_TEST_CHECK( bitmapData.GetWidth() == 120 );
-    DALI_TEST_CHECK( bitmapData.GetHeight() == 120 );
+    DALI_TEST_CHECK( resourceManager.GetTextureMetadata(req->GetId(), bitmapData ) );
+    DALI_TEST_CHECK( bitmapData->GetWidth() == 120 );
+    DALI_TEST_CHECK( bitmapData->GetHeight() == 120 );
     DALI_TEST_EQUALS( imageTicket->GetWidth(), 80, TEST_LOCATION );
     DALI_TEST_EQUALS( imageTicket->GetHeight(), 80, TEST_LOCATION );
 
@@ -708,69 +689,6 @@ int UtcDaliInternalRequestReloadBitmapRequests03(void)
   END_TEST;
 }
 
-/**
-//int UtcDaliInternalSaveResource01(void)//
-{
-  TestApplication application;
-  tet_infoline("Testing SaveResource() with valid id, and valid filename");
-  testTicketObserver.Reset();
-
-  DALI_TEST_CHECK(0);
-  END_TEST;
-}
-
-
-//int UtcDaliInternalSaveResource02(void)//
-{
-  TestApplication application;
-  tet_infoline("Testing SaveResource() with invalid id");
-  testTicketObserver.Reset();
-
-  DALI_TEST_CHECK(0);
-  END_TEST;
-}
-
-//int UtcDaliInternalSaveResource03(void)//
-{
-  TestApplication application;
-  tet_infoline("Testing SaveResource() with invalid id");
-  testTicketObserver.Reset();
-
-  DALI_TEST_CHECK ( 0 );
-  END_TEST;
-}
-
-
-//int UtcDaliInternalSaveResource04(void)//
-{
-  TestApplication application;
-  tet_infoline("Testing SaveResource() with valid id, but invalid filename");
-  testTicketObserver.Reset();
-  DALI_TEST_CHECK( 0 );
-  END_TEST;
-}
-*/
-
-int UtcDaliInternalSaveResource05(void)
-{
-  TestApplication application;
-  tet_infoline("Testing SaveResource() with valid id, but invalid resource type");
-  testTicketObserver.Reset();
-
-  Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
-
-  // First, load a bitmap resource
-  Internal::ResourceTicketPtr ticket = CheckLoadBitmap(application, "bitmap.jpg", 80, 80);
-
-  // Try saving it
-  resourceClient.SaveResource( ticket, "bitmap.png" );
-  application.SendNotification(); // Flush update messages
-  application.Render();           // Process save resource request
-
-  DALI_TEST_CHECK( ! application.GetPlatform().WasCalled(TestPlatformAbstraction::SaveResourceFunc ) );
-  END_TEST;
-}
-
 int UtcDaliInternalRequestResourceTicket01(void)
 {
   TestApplication application;
@@ -807,98 +725,13 @@ int UtcDaliInternalRequestResourceTicket02(void)
   END_TEST;
 }
 
-int UtcDaliInternalLoadShaderRequest01(void)
-{
-  TestApplication application;
-  tet_infoline("Testing LoadShader() success");
-  testTicketObserver.Reset();
-
-  // Clear through all of the outstanding shader load requests from the default shader effect
-  std::vector< unsigned char > buffer;
-  for( int i=0; i<10; i++ )
-  {
-    buffer.push_back((unsigned char)i);
-  }
-  application.GetPlatform().SetLoadFileResult( true, buffer );
-  application.GetGlAbstraction().SetLinkStatus(1);
-  application.SendNotification(); // Flush update messages
-  application.Render();           // Process load shader request (immediately)
-  application.SendNotification();
-  application.Render();
-  application.SendNotification();
-  application.Render();
-  application.SendNotification();
-
-  Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
-
-  Integration::ShaderResourceType shaderRequest(123, "vertex src", "frag src");
-  std::string shaderBinaryFile("shader.bin");
-  Internal::ResourceTicketPtr ticket = resourceClient.LoadShader(shaderRequest, shaderBinaryFile);
-  DALI_TEST_CHECK( ticket );
-
-  application.GetPlatform().SetLoadFileResult( true, buffer );
-  application.GetGlAbstraction().EnableShaderCallTrace( true );
-  application.GetGlAbstraction().SetLinkStatus(1);
-
-  application.SendNotification(); // Flush update messages
-  application.Render();           // Process load shader request (immediately)
-
-  application.SendNotification();
-  application.Render();
-
-  application.SendNotification();
-  application.Render();
-
-  // If shader program loads OK, we shouldn't see any calls to CompileShader or SaveResource
-  TraceCallStack& shaderTrace = application.GetGlAbstraction().GetShaderTrace();
-  DALI_TEST_CHECK( ! shaderTrace.FindMethod("CompileShader") );
-
-  // Ensure no request sent to platform abstraction
-  DALI_TEST_CHECK( ! application.GetPlatform().WasCalled(TestPlatformAbstraction::SaveResourceFunc ) );
-  END_TEST;
-}
-
-int UtcDaliInternalAllocateBitmapImage01(void)
-{
-  TestApplication application;
-  tet_infoline("Testing AllocateBitmapImage()");
-  testTicketObserver.Reset();
-
-  Internal::ResourceClient& resourceClient  = Internal::ThreadLocalStorage::Get().GetResourceClient();
-  Internal::ImageTicketPtr imageTicket = resourceClient.AllocateBitmapImage(80, 80, 80, 80, Pixel::RGB565);
-  imageTicket->AddObserver( testTicketObserver );
-
-  DALI_TEST_CHECK( imageTicket );
-  DALI_TEST_EQUALS ( imageTicket->GetLoadingState(), ResourceLoadingSucceeded, TEST_LOCATION );
-  DALI_TEST_EQUALS ( imageTicket->GetWidth(), 80, TEST_LOCATION );
-  DALI_TEST_EQUALS ( imageTicket->GetHeight(), 80, TEST_LOCATION );
-
-  application.SendNotification(); // Flush update queue
-  application.Render(0); // Process message
-  application.SendNotification(); // Send message to tickets
-
-  DALI_TEST_CHECK ( 0 == testTicketObserver.LoadSucceededCalled() ); // Check no message was sent
-  DALI_TEST_EQUALS ( imageTicket->GetLoadingState(), ResourceLoadingSucceeded, TEST_LOCATION );
-  DALI_TEST_EQUALS ( imageTicket->GetWidth(), 80, TEST_LOCATION );
-  DALI_TEST_EQUALS ( imageTicket->GetHeight(), 80, TEST_LOCATION );
-
-  Integration::Bitmap* bitmap = resourceClient.GetBitmap(imageTicket);
-  DALI_TEST_CHECK ( bitmap != NULL );
-  DALI_TEST_EQUALS ( bitmap->GetImageWidth(), 80u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetImageHeight(), 80u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetPackedPixelsProfile()->GetBufferWidth(), 80u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetPackedPixelsProfile()->GetBufferHeight(), 80u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetPixelFormat(), Pixel::RGB565, TEST_LOCATION );
-  END_TEST;
-}
-
 int UtcDaliInternalAddBitmapImage01(void)
 {
   TestApplication application;
   tet_infoline("Testing AddBitmap with reserved buffer()");
   testTicketObserver.Reset();
   Internal::ResourceClient& resourceClient  = Internal::ThreadLocalStorage::Get().GetResourceClient();
-  Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS,  ResourcePolicy::RETAIN  );
+  Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS,  ResourcePolicy::OWNED_RETAIN  );
   bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGB565, 80, 80, 80, 80 );
 
   Internal::ImageTicketPtr imageTicket = resourceClient.AddBitmapImage( bitmap );
@@ -917,15 +750,6 @@ int UtcDaliInternalAddBitmapImage01(void)
   DALI_TEST_EQUALS ( imageTicket->GetLoadingState(), ResourceLoadingSucceeded, TEST_LOCATION );
   DALI_TEST_EQUALS ( imageTicket->GetWidth(), 80, TEST_LOCATION );
   DALI_TEST_EQUALS ( imageTicket->GetHeight(), 80, TEST_LOCATION );
-
-  Integration::Bitmap* theBitmap = resourceClient.GetBitmap(imageTicket);
-  DALI_TEST_CHECK ( theBitmap != NULL );
-  DALI_TEST_CHECK ( bitmap == theBitmap );
-  DALI_TEST_EQUALS ( bitmap->GetImageWidth(), 80u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetImageHeight(), 80u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetPackedPixelsProfile()->GetBufferWidth(), 80u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetPackedPixelsProfile()->GetBufferHeight(), 80u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetPixelFormat(), Pixel::RGB565, TEST_LOCATION );
   END_TEST;
 }
 
@@ -935,7 +759,7 @@ int UtcDaliInternalAddBitmapImage02(void)
   tet_infoline("Testing AddBitmap without reserved buffer()");
   testTicketObserver.Reset();
   Internal::ResourceClient& resourceClient  = Internal::ThreadLocalStorage::Get().GetResourceClient();
-  Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS,  ResourcePolicy::RETAIN  );
+  Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS,  ResourcePolicy::OWNED_RETAIN  );
 
   Internal::ImageTicketPtr imageTicket = resourceClient.AddBitmapImage( bitmap );
   DALI_TEST_CHECK( imageTicket );
@@ -954,19 +778,6 @@ int UtcDaliInternalAddBitmapImage02(void)
   DALI_TEST_EQUALS ( imageTicket->GetWidth(), 0, TEST_LOCATION );
   DALI_TEST_EQUALS ( imageTicket->GetHeight(), 0, TEST_LOCATION );
   DALI_TEST_CHECK ( 0 == testTicketObserver.LoadSucceededCalled() ); // Check no message was sent
-
-  Integration::Bitmap* theBitmap = resourceClient.GetBitmap(imageTicket);
-  DALI_TEST_CHECK ( theBitmap != NULL );
-  DALI_TEST_CHECK ( bitmap == theBitmap );
-  DALI_TEST_EQUALS ( bitmap->GetImageWidth(), 0u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetImageHeight(), 0u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetPackedPixelsProfile()->GetBufferWidth(), 0u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetPackedPixelsProfile()->GetBufferHeight(), 0u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION );
-
-  // There is no way for the ticket's image attributes to be updated if the bitmap
-  // reserves a buffer after ticket generation.
-  // Probably not an issue - there is no public API in BufferImage to change the image size.
   END_TEST;
 }
 
@@ -993,77 +804,6 @@ int UtcDaliInternalAddBitmapImage03(void)
   END_TEST;
 }
 
-int UtcDaliInternalGetBitmapImage01(void)
-{
-  TestApplication application;
-  tet_infoline("Testing GetBitmap() with valid ticket");
-  testTicketObserver.Reset();
-
-  Internal::ResourceClient& resourceClient  = Internal::ThreadLocalStorage::Get().GetResourceClient();
-  Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS,  ResourcePolicy::RETAIN  );
-  bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 20, 20, 80, 80 );
-  Internal::ImageTicketPtr imageTicket = resourceClient.AddBitmapImage( bitmap );
-
-  Integration::Bitmap* theBitmap = resourceClient.GetBitmap(imageTicket);
-  DALI_TEST_CHECK ( theBitmap != NULL );
-  DALI_TEST_CHECK ( bitmap == theBitmap );
-  DALI_TEST_EQUALS ( bitmap->GetImageWidth(),   20u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetImageHeight(),  20u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetPackedPixelsProfile()->GetBufferWidth(),  80u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetPackedPixelsProfile()->GetBufferHeight(), 80u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION );
-
-  imageTicket->AddObserver( testTicketObserver );
-  application.SendNotification(); // Flush update queue
-  application.Render(0);          // Process message
-  application.SendNotification(); // Send message to tickets
-
-  theBitmap = resourceClient.GetBitmap(imageTicket);
-  DALI_TEST_CHECK ( theBitmap != NULL );
-  DALI_TEST_CHECK ( bitmap == theBitmap );
-  DALI_TEST_EQUALS ( bitmap->GetImageWidth(),   20u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetImageHeight(),  20u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetPackedPixelsProfile()->GetBufferWidth(),  80u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetPackedPixelsProfile()->GetBufferHeight(), 80u, TEST_LOCATION );
-  DALI_TEST_EQUALS ( bitmap->GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliInternalGetBitmapImage02(void)
-{
-  TestApplication application;
-  tet_infoline("Testing GetBitmap() with invalid ticket");
-
-  Internal::ResourceClient& resourceClient  = Internal::ThreadLocalStorage::Get().GetResourceClient();
-  Internal::ImageTicketPtr imageTicket;
-  Integration::Bitmap* theBitmap = NULL;
-  bool exceptionRaised = false;
-  try
-  {
-    theBitmap = resourceClient.GetBitmap(imageTicket);
-  } catch (DaliException& e)
-  {
-    exceptionRaised = true;
-  }
-  DALI_TEST_CHECK( exceptionRaised );
-  DALI_TEST_CHECK( ! theBitmap );
-  END_TEST;
-}
-
-int UtcDaliInternalGetBitmapImage03(void)
-{
-  TestApplication application;
-  tet_infoline("Testing GetBitmap() with valid ticket for incorrect type");
-
-  Internal::ResourceClient& resourceClient  = Internal::ThreadLocalStorage::Get().GetResourceClient();  Internal::ResourceTicketPtr imageTicket = CheckLoadBitmap( application, "Stuff.png", 100, 100 );
-
-  Integration::Bitmap* theBitmap = NULL;
-  theBitmap = resourceClient.GetBitmap(imageTicket);
-  DALI_TEST_CHECK( ! theBitmap );
-
-  END_TEST;
-}
-
 int UtcDaliInternalAllocateTexture01(void)
 {
   TestApplication application;
@@ -1117,11 +857,6 @@ int UtcDaliInternalAddNativeImage(void)
   DALI_TEST_EQUALS ( imageTicket->GetWidth(),  80, TEST_LOCATION );
   DALI_TEST_EQUALS ( imageTicket->GetHeight(), 80, TEST_LOCATION );
   DALI_TEST_CHECK ( 0 == testTicketObserver.LoadSucceededCalled() ); // Check no message was sent
-
-  Integration::Bitmap* theBitmap = NULL;
-  theBitmap = resourceClient.GetBitmap(imageTicket);
-
-  DALI_TEST_CHECK ( theBitmap == NULL );
   END_TEST;
 }
 
@@ -1132,7 +867,7 @@ int UtcDaliInternalAddFrameBufferImage(void)
 
   testTicketObserver.Reset();
   Internal::ResourceClient& resourceClient  = Internal::ThreadLocalStorage::Get().GetResourceClient();
-  Internal::ImageTicketPtr imageTicket = resourceClient.AddFrameBufferImage(80, 80, Pixel::A8 );
+  Internal::ImageTicketPtr imageTicket = resourceClient.AddFrameBufferImage(80, 80, Pixel::A8, RenderBuffer::COLOR );
   DALI_TEST_CHECK( imageTicket );
   imageTicket->AddObserver( testTicketObserver );
 
@@ -1149,42 +884,5 @@ int UtcDaliInternalAddFrameBufferImage(void)
   DALI_TEST_EQUALS ( imageTicket->GetWidth(), 80, TEST_LOCATION );
   DALI_TEST_EQUALS ( imageTicket->GetHeight(), 80, TEST_LOCATION );
   DALI_TEST_CHECK ( 0 == testTicketObserver.LoadSucceededCalled() ); // Check no message was sent
-
-  Integration::Bitmap* theBitmap = NULL;
-  theBitmap = resourceClient.GetBitmap(imageTicket);
-  DALI_TEST_CHECK ( theBitmap == NULL );
-  END_TEST;
-}
-
-int UtcDaliInternalAllocateMesh01(void)
-{
-  TestApplication application;
-  tet_infoline("Testing AllocateMesh() with vald mesh data");
-
-  MeshData publicMeshData;
-  MeshData::VertexContainer    vertices;
-  MeshData::FaceIndices        faces;
-  BoneContainer                bones;
-  ConstructVertices(vertices, 60);
-  ConstructFaces(vertices, faces);
-  Material customMaterial = ConstructMaterial();
-  publicMeshData.SetData(vertices, faces, bones, customMaterial);
-  publicMeshData.SetHasNormals(true);
-  publicMeshData.SetHasTextureCoords(true);
-
-  testTicketObserver.Reset();
-  Internal::ResourceClient& resourceClient  = Internal::ThreadLocalStorage::Get().GetResourceClient();
-  Internal::OwnerPointer<Internal::MeshData> meshDataPtr( new Internal::MeshData( publicMeshData, ResourcePolicy::DISCARD, true ) );
-  Internal::ResourceTicketPtr meshTicket = resourceClient.AllocateMesh(meshDataPtr);
-  DALI_TEST_CHECK( meshTicket );
-  meshTicket->AddObserver( testTicketObserver );
-
-  DALI_TEST_EQUALS ( meshTicket->GetLoadingState(), ResourceLoading, TEST_LOCATION );
-
-  application.SendNotification(); // Flush update queue
-  application.Render(0); // Process message
-  application.SendNotification(); // Send message to tickets
-
-  DALI_TEST_EQUALS ( meshTicket->GetLoadingState(), ResourceLoadingSucceeded, TEST_LOCATION );
   END_TEST;
 }