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=294bec2ef751f6b73c8cb88033df7a88b791e11b;hp=4374bfa4fe35e1db80a5aab5034085cf82c92e2a;hb=8269fc656ce5c08314e340932c2af762e7234628;hpb=d5e3ed5f5b1c8fdba3ae97ead8729620f54b3836 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp index 4374bfa..294bec2 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp @@ -25,6 +25,7 @@ #include #include #include +#include using namespace Dali; using namespace Toolkit; @@ -168,7 +169,7 @@ int UtcDaliPopoupSetProperty(void) //Test properties std::string testString = "Hello World"; popup.SetProperty(popup.GetPropertyIndex("title"), testString); - DALI_TEST_EQUALS( testString, popup.GetTitle().GetText(), TEST_LOCATION ); + DALI_TEST_EQUALS( testString, popup.GetTitle(), TEST_LOCATION ); END_TEST; } @@ -200,54 +201,10 @@ int UtcDaliPopupSetTitle(void) // Put in show state so it's layer is connected to popup (for ancestor check). popup.SetState(Popup::POPUP_SHOW, 0.0f); - TextView titleActor = TextView::New(); - titleActor.SetText("title"); - - DALI_TEST_CHECK( !popup.GetTitle() ); - popup.SetTitle(titleActor); - DALI_TEST_CHECK( popup.GetTitle() == titleActor ); - DALI_TEST_CHECK( (popup.GetTitle()) && (popup.GetTitle().GetText() == "title") ); - // verify titleActor is actually inside popup, and not elsewhere on stage, or off even. - DALI_TEST_CHECK( HasAncestor(titleActor, popup) ); - - TextView titleActor2 = TextView::New(); - titleActor2.SetText("anothertitle"); - popup.SetTitle(titleActor2); - DALI_TEST_CHECK( popup.GetTitle() != titleActor ); - DALI_TEST_CHECK( popup.GetTitle() == titleActor2 ); - DALI_TEST_CHECK( (popup.GetTitle()) && (popup.GetTitle().GetText() == "anothertitle") ); - // verify titleActor is actually inside popup, and not elsewhere on stage, or off even. - DALI_TEST_CHECK( HasAncestor(titleActor2, popup) ); - END_TEST; -} + popup.SetTitle("title"); -int UtcDaliPopupSetTitleText(void) -{ - ToolkitTestApplication application; // Exceptions require ToolkitTestApplication - tet_infoline(" UtcDaliPopupSetTitleText"); + DALI_TEST_CHECK( popup.GetTitle() == "title" ); - // Create the Popup actor - Popup popup = Popup::New(); - Stage::GetCurrent().Add( popup ); - // Put in show state so it's layer is connected to popup (for ancestor check). - popup.SetState(Popup::POPUP_SHOW, 0.0f); - - TextView titleActor = TextView::New(); - titleActor.SetText("title"); - - DALI_TEST_CHECK( !popup.GetTitle() ); - popup.SetTitle(titleActor); - DALI_TEST_CHECK( popup.GetTitle() == titleActor ); - DALI_TEST_CHECK( (popup.GetTitle()) && (popup.GetTitle().GetText() == "title") ); - // verify titleActor is actually inside popup, and not elsewhere on stage, or off even. - DALI_TEST_CHECK( HasAncestor(titleActor, popup) ); - - // this text should replace titleImage actor. - popup.SetTitle("newtext"); - DALI_TEST_CHECK( popup.GetTitle() != titleActor ); - DALI_TEST_CHECK( (popup.GetTitle()) && (popup.GetTitle().GetText() == "newtext") ); - // verify titleActor is no longer inside popup. (been displaced by newtext actor) - DALI_TEST_CHECK( !HasAncestor(titleActor, popup) ); END_TEST; } @@ -279,7 +236,6 @@ int UtcDaliPopupSetState(void) // Create the Popup actor Popup popup = Popup::New(); - Stage::GetCurrent().Add( popup ); ImageActor backgroundImage = CreateSolidColorActor( Color::RED ); popup.SetBackgroundImage(backgroundImage); @@ -303,7 +259,6 @@ int UtcDaliPopupSetStateSlow(void) // Create the Popup actor Popup popup = Popup::New(); - Stage::GetCurrent().Add( popup ); ImageActor backgroundImage = CreateSolidColorActor( Color::RED ); popup.SetBackgroundImage(backgroundImage); @@ -337,7 +292,6 @@ int UtcDaliPopupShowHide(void) // Create the Popup actor Popup popup = Popup::New(); - Stage::GetCurrent().Add( popup ); popup.HiddenSignal().Connect( &OnPopupHidden ); ImageActor backgroundImage = CreateSolidColorActor( Color::RED ); @@ -345,9 +299,9 @@ int UtcDaliPopupShowHide(void) PushButton button1 = PushButton::New(); PushButton button2 = PushButton::New(); - button1.SetSize(DEFAULT_BUTTON_SIZE); + button1.SetSize(DEFAULT_BUTTON_SIZE.GetVectorXY()); popup.AddButton(button1); - button2.SetSize(DEFAULT_BUTTON_SIZE); + button2.SetSize(DEFAULT_BUTTON_SIZE.GetVectorXY()); popup.AddButton(button2); // Showing/Hiding popup, results in all child Actors being