/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
// Check that focus manager is a singleton
DALI_TEST_CHECK(manager == newManager);
+
END_TEST;
}
manager.SetFocus( dummy3 );
DALI_TEST_CHECK( dummy3Impl.keyInputFocusGained );
- Integration::KeyEvent event( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, "", DevelDevice::Class::TOUCH, DevelDevice::Subclass::NONE );
+ Integration::KeyEvent event( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Up, "", "", Device::Class::TOUCH, Device::Subclass::NONE );
application.ProcessEvent(event);
DALI_TEST_CHECK( callback1.mIsCalled );
manager.SetFocus( dummy3 );
DALI_TEST_CHECK( dummy3Impl.keyInputFocusGained );
- Integration::KeyEvent event( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, "", DevelDevice::Class::TOUCH, DevelDevice::Subclass::NONE );
+ Integration::KeyEvent event( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Up, "", "", Device::Class::TOUCH, Device::Subclass::NONE );
application.ProcessEvent(event);
DALI_TEST_CHECK( !callback1.mIsCalled );
DALI_TEST_CHECK( lostActor == Control() );
END_TEST;
}
+
+int UtcDaliKeyInputFocusManagerSignalKeyInputFocusChangedforNewWindow(void)
+{
+ ToolkitTestApplication application;
+ KeyInputFocusManager manager = KeyInputFocusManager::Get();
+
+ tet_infoline(" UtcDaliKeyInputFocusManagerSignalKeyInputFocusChanged");
+
+ PushButton pushButton1 = PushButton::New();
+ PushButton pushButton2 = PushButton::New();
+
+ Window window = Window::New(PositionSize(0,0,0,0) ,"", false);
+ DALI_TEST_CHECK( window );
+
+ window.Add( pushButton1 );
+ window.Add( pushButton2 );
+
+ PushButton gainActor, lostActor;
+ KeyInputFocusChangedCallback callback( gainActor, lostActor );
+ manager.KeyInputFocusChangedSignal().Connect( &callback, &KeyInputFocusChangedCallback::Callback );
+
+ manager.SetFocus(pushButton1);
+
+ DALI_TEST_CHECK( gainActor == pushButton1 );
+ DALI_TEST_CHECK( lostActor == Control() );
+
+ gainActor.Reset();
+ lostActor.Reset();
+
+ manager.SetFocus(pushButton2);
+
+ DALI_TEST_CHECK( gainActor == pushButton2 );
+ DALI_TEST_CHECK( lostActor == pushButton1 );
+
+ gainActor.Reset();
+ lostActor.Reset();
+
+ // Removing the focus actor from the window would also result in signal emission.
+ window.Remove( pushButton1 );
+ window.Remove( pushButton2 );
+ DALI_TEST_CHECK( gainActor == Control() );
+ DALI_TEST_CHECK( lostActor == Control() );
+
+ window.Reset();
+ END_TEST;
+}