+ DALI_TEST_EQUALS(parentAccessible->GetChildCount(), 0u, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int utcDaliAutomationId(void)
+{
+ ToolkitTestApplication application;
+ Dali::Property::Index automationIdIndex = Toolkit::DevelControl::Property::AUTOMATION_ID;
+ std::string automationIdKey = "automationId";
+ std::string automationIdValue = "test123";
+
+ auto control = Toolkit::Control::New();
+ auto* controlAccessible = Accessibility::Accessible::Get(control);
+
+ // Check that there is no automationId initially
+ DALI_TEST_CHECK(control.GetProperty<std::string>(automationIdIndex).empty());
+ auto attributes = controlAccessible->GetAttributes();
+ DALI_TEST_CHECK(attributes.find(automationIdKey) == attributes.end());
+
+ // Set automationId
+ control.SetProperty(automationIdIndex, automationIdValue);
+
+ // Check that automationId is set
+ DALI_TEST_EQUALS(control.GetProperty<std::string>(automationIdIndex), automationIdValue, TEST_LOCATION);
+ attributes = controlAccessible->GetAttributes();
+ DALI_TEST_CHECK(attributes.find(automationIdKey) != attributes.end());
+ DALI_TEST_EQUALS(attributes[automationIdKey], automationIdValue, TEST_LOCATION);
+
+ // Unset automationId
+ control.SetProperty(automationIdIndex, "");
+
+ // Check that there is no automationId
+ DALI_TEST_CHECK(control.GetProperty<std::string>(automationIdIndex).empty());
+ attributes = controlAccessible->GetAttributes();
+ DALI_TEST_CHECK(attributes.find(automationIdKey) == attributes.end());
+
+ END_TEST;
+}
+
+int utcDaliImgSrc(void)
+{
+ ToolkitTestApplication application;
+ const std::string imageSrcKey = "imgSrc";
+ // Check that imgSrc is NOT added for non-image view w/ no additional property
+ {
+ const auto checkBoxButton = Toolkit::CheckBoxButton::New();
+ const auto controlAccessible = Dali::Accessibility::Accessible::Get(checkBoxButton);
+ auto attributes = controlAccessible->GetAttributes();
+ DALI_TEST_CHECK(attributes.find(imageSrcKey) == attributes.end());
+ }
+
+ // Check that imgSrc is NOT added for non-image view w/ additional properties
+ {
+ const auto textLabel = Toolkit::TextLabel::New("Hello");
+ const auto controlAccessible = Dali::Accessibility::Accessible::Get(textLabel);
+ auto attributes = controlAccessible->GetAttributes();
+ DALI_TEST_CHECK(attributes.find(imageSrcKey) == attributes.end());
+ }
+
+ // Check that imgSrc is added for image view w/ Url
+ {
+ const std::string imagePath = "gallery-small-1.jpg";
+ const auto imageView = Toolkit::ImageView::New(imagePath);
+ const auto controlAccessible = Dali::Accessibility::Accessible::Get(imageView);
+ auto attributes = controlAccessible->GetAttributes();
+ DALI_TEST_CHECK(attributes.find(imageSrcKey) != attributes.end());
+ DALI_TEST_EQUALS(attributes[imageSrcKey], imagePath, TEST_LOCATION);
+ }
+
+ // Check that imgSrc is added for image view w/ imageMap; single url case
+ {
+ const std::string imagePathForImageMap = "icon-edit.png";
+ Property::Map imageMap;
+ imageMap[Toolkit::ImageVisual::Property::URL] = imagePathForImageMap;
+ imageMap[Toolkit::ImageVisual::Property::RELEASE_POLICY] = Toolkit::ImageVisual::ReleasePolicy::DETACHED;
+
+ auto imageView = Toolkit::ImageView::New();
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap);
+
+ const auto controlAccessible = Dali::Accessibility::Accessible::Get(imageView);
+ auto attributes = controlAccessible->GetAttributes();
+ DALI_TEST_CHECK(attributes.find(imageSrcKey) != attributes.end());
+ DALI_TEST_EQUALS(attributes[imageSrcKey], imagePathForImageMap, TEST_LOCATION);
+ }
+
+ // Check that imgSrc is added for image view w/ imageMap; url array returns first element
+ {
+ const std::string image1 = "application-icon-20.png";
+ const std::string image2 = "application-icon-21.png";
+ Property::Map imageMap;
+ Property::Array urls{image1, image2};
+ imageMap[Toolkit::ImageVisual::Property::URL] = urls;
+ imageMap[Toolkit::ImageVisual::Property::RELEASE_POLICY] = Toolkit::ImageVisual::ReleasePolicy::DETACHED;
+
+ auto imageView = Toolkit::ImageView::New();
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap);
+
+ const auto controlAccessible = Dali::Accessibility::Accessible::Get(imageView);
+ auto attributes = controlAccessible->GetAttributes();
+ DALI_TEST_CHECK(attributes.find(imageSrcKey) != attributes.end());
+ DALI_TEST_EQUALS(attributes[imageSrcKey], image1, TEST_LOCATION);
+ }