Fix an errornous test case and corresponding wrong implementation in popup 85/96085/1
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Mon, 7 Nov 2016 18:44:07 +0000 (18:44 +0000)
committerKimmo Hoikka <kimmo.hoikka@samsung.com>
Mon, 7 Nov 2016 18:45:17 +0000 (18:45 +0000)
- test was assuming POPUP_BACKGROUND_IMAGE returns different URL in Get than what was set in Set

Change-Id: I1ad8046e1d10da1f3336cf0bb0c0b14563bca5c5

automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp
dali-toolkit/internal/controls/popup/popup-impl.cpp

index c3eaa4b..1cd8ad6 100644 (file)
@@ -1014,11 +1014,11 @@ int UtcDaliPopupPropertyBackgroundImage(void)
   Popup popup = Popup::New();
   Stage::GetCurrent().Add( popup );
 
-  // Check setting an invalid image.
+  // Check setting an image
   popup.SetProperty( Toolkit::Popup::Property::POPUP_BACKGROUND_IMAGE, "invalid-image.png" );
   std::string resultString;
   popup.GetProperty( Toolkit::Popup::Property::POPUP_BACKGROUND_IMAGE ).Get( resultString );
-  DALI_TEST_EQUALS( resultString, std::string(""), TEST_LOCATION );
+  DALI_TEST_EQUALS( resultString, "invalid-image.png", TEST_LOCATION );
 
   END_TEST;
 }
index f1fea71..7ac2a28 100755 (executable)
@@ -28,7 +28,6 @@
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/events/key-event.h>
 #include <dali/public-api/events/touch-data.h>
-#include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/public-api/size-negotiation/relayout-container.h>
@@ -1382,10 +1381,10 @@ Property::Value Popup::GetProperty( BaseObject* object, Property::Index property
       }
       case Toolkit::Popup::Property::POPUP_BACKGROUND_IMAGE:
       {
-        ResourceImage image = ResourceImage::DownCast( popupImpl.GetPopupBackgroundImage() );
-        if( image )
+        Toolkit::ImageView imageView = Toolkit::ImageView::DownCast( popupImpl.GetPopupBackgroundImage() );
+        if( imageView )
         {
-          value = image.GetUrl();
+          value = imageView.GetProperty( Toolkit::ImageView::Property::IMAGE );
         }
         break;
       }