END_TEST;
}
-int UtcDaliInternalLoadShaderRequest02(void)
-{
- TestApplication application;
- tet_infoline("Testing LoadShader() failure");
- 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();
- Internal::SceneGraph::UpdateManager& updateManager = Internal::ThreadLocalStorage::Get().GetUpdateManager();
-
- Integration::ShaderResourceType shaderRequest(123, "vertex src", "frag src");
- std::string shaderBinaryFile("shader.bin");
- Internal::ResourceTicketPtr ticket = resourceClient.LoadShader(shaderRequest, shaderBinaryFile);
- ticket->AddObserver(testTicketObserver);
-
- ShaderEffect::GeometryHints hints = ShaderEffect::HINT_NONE;
- Internal::SceneGraph::Shader* sceneObject = new Internal::SceneGraph::Shader( hints );
- AddShaderMessage( updateManager, *sceneObject );
-
- size_t shaderHash=0;
- SetShaderProgramMessage( updateManager, *sceneObject, GEOMETRY_TYPE_IMAGE, Internal::SHADER_DEFAULT, ticket->GetId(), shaderHash, true );
-
- DALI_TEST_CHECK( ticket );
-
- buffer.clear();
- DALI_TEST_CHECK(buffer.size() == 0);
-
- application.GetPlatform().SetLoadFileResult( true, buffer );
- application.GetGlAbstraction().ResetShaderCallStack();
- application.GetGlAbstraction().EnableShaderCallTrace( true );
- application.GetGlAbstraction().SetLinkStatus(1);
- application.GetGlAbstraction().SetProgramBinaryLength(20);
- application.GetPlatform().SetResourceSaved (ticket->GetId(), Integration::ResourceShader );
-
- application.SendNotification(); // Flush update messages
- application.Render(); // Process load shader request (immediately), add responses
- // to post process q
- application.Render(); // this update will process old post-process-q
- application.Render(); // this update will process new post-process-q
- application.SendNotification(); // Send save request to event thread
- application.Render(); // this update will process save request
- application.Render(); // this update will get SaveComplete
- application.SendNotification(); // Send save request response
-
- TraceCallStack& shaderTrace = application.GetGlAbstraction().GetShaderTrace();
- DALI_TEST_CHECK( shaderTrace.FindMethod("CompileShader") );
-
- DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::SaveResourceFunc ) );
- DALI_TEST_CHECK( testTicketObserver.SaveSucceededCalled() );
- END_TEST;
-}
-
int UtcDaliInternalAllocateBitmapImage01(void)
{
TestApplication application;