Add EmitKeyInputFocusSignal to control-wrapper-impl 03/200003/8
authorhuiyu.eun <huiyu.eun@samsung.com>
Wed, 13 Feb 2019 08:16:03 +0000 (17:16 +0900)
committerhuiyu eun <huiyu.eun@samsung.com>
Mon, 25 Feb 2019 02:02:26 +0000 (02:02 +0000)
Fix TCT block issue

Change-Id: I97c54c89c6d9216a4a8908959d7f0d35e3029603
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
automated-tests/src/dali-toolkit/utc-Dali-ControlWrapper.cpp
dali-toolkit/devel-api/controls/control-wrapper-impl.cpp

index 8e1673e..0921d61 100644 (file)
@@ -51,6 +51,15 @@ void utc_dali_toolkit_control_wrapper_cleanup(void)
 namespace
 {
 bool gOnRelayout = false;
 namespace
 {
 bool gOnRelayout = false;
+
+static bool gKeyInputFocusCallBackCalled;
+
+static void TestKeyInputFocusCallback( Control control )
+{
+  tet_infoline(" TestKeyInputFocusCallback");
+
+  gKeyInputFocusCallBackCalled = true;
+}
 } // namespace
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 } // namespace
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -810,3 +819,23 @@ int UtcDaliControlWrapperAnimateVisual(void)
 
   END_TEST;
 }
 
   END_TEST;
 }
+
+int UtcDaliControlWrapperEmitKeyFocusSignal(void)
+{
+  ToolkitTestApplication application;
+
+  Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
+  ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+
+  gKeyInputFocusCallBackCalled = false;
+  controlWrapper.KeyInputFocusGainedSignal().Connect(&TestKeyInputFocusCallback);
+
+  application.SendNotification();
+  application.Render();
+
+  controlWrapperImpl->EmitKeyInputFocusSignal( true );
+
+  DALI_TEST_CHECK( gKeyInputFocusCallBackCalled );
+
+  END_TEST;
+}
\ No newline at end of file
index 37def2b..1a2ec4b 100755 (executable)
@@ -185,6 +185,11 @@ Dali::TypeInfo ControlWrapper::GetTypeInfo()
   return DevelCustomActor::GetTypeInfo(Self());
 }
 
   return DevelCustomActor::GetTypeInfo(Self());
 }
 
+void ControlWrapper::EmitKeyInputFocusSignal( bool focusGained )
+{
+  Control::EmitKeyInputFocusSignal( focusGained );
+}
+
 } // namespace Internal
 
 } // namespace Toolkit
 } // namespace Internal
 
 } // namespace Toolkit