X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-KeyInputFocusManager.cpp;h=4686512bd70404a17efed722a240a220e29c6729;hb=4af8225dd04de11ab0085f2cab0e55f43eddf275;hp=b208a35af231079a0fa79b01e1e6a90a582796bb;hpb=aa906fd49430568986b95c51bd29f3a58c33272f;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/utc-Dali-KeyInputFocusManager.cpp b/automated-tests/src/dali-toolkit/utc-Dali-KeyInputFocusManager.cpp old mode 100644 new mode 100755 index b208a35..4686512 --- a/automated-tests/src/dali-toolkit/utc-Dali-KeyInputFocusManager.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-KeyInputFocusManager.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -139,6 +139,7 @@ int UtcDaliKeyInputFocusManagerGet(void) // Check that focus manager is a singleton DALI_TEST_CHECK(manager == newManager); + END_TEST; } @@ -250,7 +251,7 @@ int UtcDaliKeyInputFocusManagerKeyEventPropagation01(void) manager.SetFocus( dummy3 ); DALI_TEST_CHECK( dummy3Impl.keyInputFocusGained ); - Integration::KeyEvent event("a", "a", 0, 0, 0, Integration::KeyEvent::Up); + 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 ); @@ -296,7 +297,7 @@ int UtcDaliKeyInputFocusManagerKeyEventPropagation02(void) manager.SetFocus( dummy3 ); DALI_TEST_CHECK( dummy3Impl.keyInputFocusGained ); - Integration::KeyEvent event("a", "a", 0, 0, 0, Integration::KeyEvent::Up); + 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 ); @@ -430,3 +431,49 @@ int UtcDaliKeyInputFocusManagerSignalKeyInputFocusChanged(void) 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; +}