+
+int UtcDaliDebugRenderingGetVisualObject01(void)
+{
+ EnvironmentVariable::SetTestingEnvironmentVariable( true );
+ ToolkitTestApplication application;
+
+ VisualFactory factory = VisualFactory::Get();
+ DALI_TEST_CHECK( factory );
+
+ tet_infoline( "Create a TextVisual when debugging is enabled, thus creating a proxy Wireframe Visual" );
+
+ Dali::Property::Map map;
+ map[ Toolkit::Visual::Property::TYPE ] = Visual::TEXT;
+ map[ TextVisual::Property::TEXT ] = "Hello";
+
+ Visual::Base textVisual = factory.CreateVisual( map);
+ DALI_TEST_CHECK( textVisual );
+
+ tet_infoline( "Check that GetVisualObject returns the actual TextVisual" );
+ Toolkit::Internal::Visual::Base& visualImpl = GetImplementation( textVisual ).GetVisualObject();
+ DALI_TEST_CHECK( dynamic_cast< Toolkit::Internal::TextVisual* >( &visualImpl ) );
+
+ tet_infoline( "Compare the returned TextVisual with the visual implementation, should differ" );
+ DALI_TEST_CHECK( textVisual.GetObjectPtr() != &visualImpl );
+
+ END_TEST;
+}
+
+int UtcDaliDebugRenderingGetVisualObject02(void)
+{
+ ToolkitTestApplication application;
+
+ VisualFactory factory = VisualFactory::Get();
+ DALI_TEST_CHECK( factory );
+
+ tet_infoline( "Create a TextVisual without debugging enabled, thus no proxy Wireframe Visual" );
+
+ Dali::Property::Map map;
+ map[ Toolkit::Visual::Property::TYPE ] = Visual::TEXT;
+ map[ TextVisual::Property::TEXT ] = "Hello";
+
+ Visual::Base textVisual = factory.CreateVisual( map);
+ DALI_TEST_CHECK( textVisual );
+
+ tet_infoline( "Check that GetVisualObject returns the actual TextVisual" );
+ Toolkit::Internal::Visual::Base& visualImpl = GetImplementation( textVisual ).GetVisualObject();
+ DALI_TEST_CHECK( dynamic_cast< Toolkit::Internal::TextVisual* >( &visualImpl ) );
+
+ tet_infoline( "Compare the returned TextVisual with the visual implementation, should be the same" );
+ DALI_TEST_CHECK( textVisual.GetObjectPtr() == &visualImpl );
+
+ END_TEST;
+}
+
+int UtcDaliDebugRenderingGetVisualObject03(void)
+{
+ ToolkitTestApplication application;
+
+ VisualFactory factory = VisualFactory::Get();
+ DALI_TEST_CHECK( factory );
+
+ tet_infoline( "Create a WireframeVisual without debugging enabled, thus no proxy Wireframe Visual either" );
+
+ Dali::Property::Map map;
+ map[ Toolkit::Visual::Property::TYPE ] = Visual::WIREFRAME;
+
+ Visual::Base textVisual = factory.CreateVisual( map);
+ DALI_TEST_CHECK( textVisual );
+
+ tet_infoline( "Check that GetVisualObject returns the WireframeVisual" );
+ Toolkit::Internal::Visual::Base& visualImpl = GetImplementation( textVisual ).GetVisualObject();
+ DALI_TEST_CHECK( dynamic_cast< Toolkit::Internal::WireframeVisual* >( &visualImpl ) );
+
+ tet_infoline( "Compare the returned Visual with the visual implementation, should be the same" );
+ DALI_TEST_CHECK( textVisual.GetObjectPtr() == &visualImpl );
+
+ END_TEST;
+}
+
+int UtcDaliDebugRenderingRenderText(void)
+{
+ EnvironmentVariable::SetTestingEnvironmentVariable( true );
+ ToolkitTestApplication application;
+ tet_infoline( "Ensure we can render text when in debug mode" );
+
+ try
+ {
+ Toolkit::TextLabel label = TextLabel::New( "Hello" );
+ Stage::GetCurrent().Add( label );
+ DALI_TEST_CHECK( true );
+ } catch( ... )
+ {
+ DALI_TEST_CHECK( false );
+ }
+
+ END_TEST;
+}