X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-Popup.cpp;h=08f601eb1d6298d738bbddae38a978c6e1156e0d;hp=31faabbaa721dabcb8e96083298326cdc3b52e0e;hb=refs%2Fchanges%2F40%2F234640%2F2;hpb=c01f2590ed7bb00d9b3600511d08dc420261ed46 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp index 31faabb..08f601e 100755 --- a/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -467,6 +467,44 @@ int UtcDaliPopupSetControlFooterMultiple(void) END_TEST; } +int UtcDaliPopupSetTitleAndFooter(void) +{ + ToolkitTestApplication application; // Exceptions require ToolkitTestApplication + tet_infoline( " UtcDaliPopupSetTitleAndFooter" ); + + // Create the Popup actor + Popup popup = Popup::New(); + + // Put in show state so it's layer is connected to popup (for ancestor check). + popup.SetDisplayState( Popup::SHOWN ); + + // Add the title + TextLabel titleActor = TextLabel::New(); + titleActor.SetProperty( Toolkit::TextLabel::Property::TEXT, "title" ); + + DALI_TEST_CHECK( !popup.GetTitle() ); + popup.SetTitle( titleActor ); + TextLabel textActor = TextLabel::DownCast( popup.GetTitle() ); + DALI_TEST_CHECK( textActor == titleActor ); + + std::string resultText; + DALI_TEST_CHECK( textActor.GetProperty( Toolkit::TextLabel::Property::TEXT ).Get( resultText ) ); + DALI_TEST_CHECK( ( popup.GetTitle() ) && ( resultText == "title" ) ); + // verify titleActor is actually inside popup, and not elsewhere on stage, or off even. + DALI_TEST_CHECK( HasAncestor( titleActor, popup ) ); + + // Add the footer + PushButton button = PushButton::New(); + DALI_TEST_CHECK( !HasAncestor(button, popup) ); + popup.SetFooter( button ); + // Hide and then re-show popup to cause button to be rearranged and added to popup. + popup.SetDisplayState( Popup::HIDDEN ); + popup.SetDisplayState( Popup::SHOWN ); + DALI_TEST_CHECK( HasAncestor( button, popup ) ); + + END_TEST; +} + int UtcDaliPopupSetStateP(void) { ToolkitTestApplication application; // Exceptions require ToolkitTestApplication