Skip to content

Commit

Permalink
[NUI] Make View.TooltipText return valid value
Browse files Browse the repository at this point in the history
Let we remove useless error message + Make getter return valid setting value
for View.TooltipText property.

Signed-off-by: Eunki, Hong <[email protected]>
  • Loading branch information
Eunki, Hong committed Oct 18, 2023
1 parent 9ee2950 commit 2a3ec42
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/Tizen.NUI/src/public/BaseComponents/View.cs
Original file line number Diff line number Diff line change
Expand Up @@ -856,12 +856,24 @@ private string InternalTooltipText
{
using (var propertyValue = GetProperty(Property.TOOLTIP))
{
if (propertyValue != null && propertyValue.Get(out string retrivedValue))
using var propertyMap = new PropertyMap();
if (propertyValue != null && propertyValue.Get(propertyMap))
{
return retrivedValue;
using var retrivedContentValue = propertyMap?.Find(NDalic.TooltipContent);
if (retrivedContentValue != null)
{
using var contextPropertyMap = new PropertyMap();
if (retrivedContentValue.Get(contextPropertyMap))
{
using var retrivedTextValue = contextPropertyMap?.Find(NDalic.TextVisualText);
if (retrivedTextValue != null && retrivedTextValue.Get(out string retrivedValue))
{
return retrivedValue;
}
}
}
}
NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
return "error to get TooltipText";
return "";
}
}
set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,24 @@ public void ColorBlue_GET_SET_VALUE()

testView.Dispose();
}


[Test]
[Category("P1")]
[Description("Get value test for View.ToolTipText")]
[Property("SPEC", "Tizen.NUI.BaseComponents.View.ToolTipText")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRW")]
[Property("AUTHOR", "[email protected]")]
public void ToolTipText_GET_SET_VALUE()
{
/* TEST CODE */
View testView = new View();

testView.TooltipText = "tooltipText";
Assert.AreEqual("tooltipText", testView.TooltipText, "Should get equal string value what we set before");

testView.Dispose();
}
}
}

0 comments on commit 2a3ec42

Please sign in to comment.