Emit property-change:accessible-value signal 22/316222/2
authorYoungsun Suh <youngsun.suh@samsung.com>
Wed, 14 Aug 2024 07:26:25 +0000 (16:26 +0900)
committerYoungsun Suh <youngsun.suh@samsung.com>
Fri, 16 Aug 2024 05:37:56 +0000 (14:37 +0900)
Change-Id: I567db0d61a2998607443b1724fc57c63f9b2329e

automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/accessibility-test-utils.cpp
automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/accessibility-test-utils.h
automated-tests/src/dali-toolkit-internal/utc-Dali-Accessibility-Controls-BridgeUp.cpp
dali-toolkit/internal/controls/control/control-data-impl.cpp

index 32d3e3e83d314c34ee469306a16290af997ba362..9989d4e2bd2777942c1521d3ff9f87f73547636e 100644 (file)
 #include <automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/accessibility-test-utils.h>
 #include <dali-toolkit-test-suite-utils.h>
-#include <dali/devel-api/common/stage.h>
 #include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
 #include <dali/devel-api/atspi-interfaces/accessible.h>
+#include <dali/devel-api/common/stage.h>
 #include "dbus-wrapper.h"
 
 namespace Dali
 {
 namespace Accessibility
 {
-  using MethodType = TestDBusWrapper::MethodType;
-  using MessagePtr = DBusWrapper::MessagePtr;
+using MethodType = TestDBusWrapper::MethodType;
+using MessagePtr = DBusWrapper::MessagePtr;
 
-  static bool gMoveOutedCalled = false;
+static bool gMoveOutedCalled      = false;
+static bool gPropertyChangeCalled = false;
 
-  void TestEnableSC(bool b)
-  {
-    static bool firstTime = true;
-    if (b && firstTime)
-    {
-      firstTime = false;
-      auto bridge = Accessibility::Bridge::GetCurrentBridge();
-      Dali::Stage stage = Dali::Stage::GetCurrent();
-      auto accessible = Accessibility::Accessible::Get( stage.GetRootLayer() );
-      bridge->ApplicationResumed();
-      bridge->AddTopLevelWindow( accessible );
-      bridge->SetApplicationName( "TestApp" );
-      bridge->Initialize();
-
-      static bool ScreenReaderEnabled = false;
-      static bool IsEnabled = false;
-
-      auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-
-      wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/bus", "org.a11y.Status", "ScreenReaderEnabled", MethodType::Getter}] = [wr](const MessagePtr &m) -> MessagePtr {
-          auto reply = wr->newReplyMessage(m);
-          wr->Encode(reply, std::tuple<TestDBusWrapper::Variant<bool>>{ ScreenReaderEnabled });
-          return reply;
-      };
-      wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/bus", "org.a11y.Status", "IsEnabled", MethodType::Getter}] = [wr](const MessagePtr &m) -> MessagePtr {
-          auto reply = wr->newReplyMessage(m);
-          wr->Encode(reply, std::tuple<TestDBusWrapper::Variant<bool>>{ IsEnabled });
-          return reply;
-      };
-      wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/bus", "org.a11y.Bus", "GetAddress", MethodType::Method}] = [wr](const MessagePtr &m) -> MessagePtr {
-          auto reply = wr->newReplyMessage(m);
-          wr->Encode(reply, std::tuple<const char*>{ "bus" });
-          return reply;
-      };
-      wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible/root", "org.a11y.atspi.Socket", "Embed", MethodType::Method}] = [wr](const MessagePtr &m) -> MessagePtr {
-          auto reply = wr->newReplyMessage(m);
-          wr->Encode(reply, std::tuple<Address>{ {"bus", "root"} });
-          return reply;
-      };
-      wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible/root", "org.a11y.atspi.Socket", "Unembed", MethodType::Method}] = [wr](const MessagePtr &m) -> MessagePtr {
-          return wr->newReplyMessage(m);
-      };
-      wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible", "org.a11y.atspi.Event.Object", "PropertyChange", MethodType::Method}] =
-      [wr](const MessagePtr &m) -> MessagePtr {
-          return wr->newReplyMessage(m);
-      };
-      wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible", "org.a11y.atspi.Event.Object", "StateChanged", MethodType::Method}] =
-      [wr](const MessagePtr &m) -> MessagePtr {
-          return wr->newReplyMessage(m);
-      };
-      wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible", "org.a11y.atspi.Event.Object", "BoundsChanged", MethodType::Method}] =
-      [wr](const MessagePtr &m) -> MessagePtr {
-          return wr->newReplyMessage(m);
-      };
-      wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible", "org.a11y.atspi.Event.Object", "ActiveDescendantChanged", MethodType::Method}] =
-      [wr](const MessagePtr &m) -> MessagePtr {
-          return wr->newReplyMessage(m);
-      };
-      wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible", "org.a11y.atspi.Event.Object", "TextChanged", MethodType::Method}] =
-      [wr](const MessagePtr &m) -> MessagePtr {
-          return wr->newReplyMessage(m);
-      };
-      wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible", "org.a11y.atspi.Event.Object", "TextCaretMoved", MethodType::Method}] =
-      [wr](const MessagePtr &m) -> MessagePtr {
-          return wr->newReplyMessage(m);
-      };
-      wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible", "org.a11y.atspi.Event.Object", "MoveOuted", MethodType::Method}] =
-      [wr](const MessagePtr &m) -> MessagePtr {
-          gMoveOutedCalled = true;
-          return wr->newReplyMessage(m);
-      };
-
-      wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible", "org.a11y.atspi.Event.Window", "Activate", MethodType::Method}] =
-      [wr](const MessagePtr &m) -> MessagePtr {
-          return wr->newReplyMessage(m);
-      };
-      wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible", "org.a11y.atspi.Event.Window", "Deactivate", MethodType::Method}] =
-      [wr](const MessagePtr &m) -> MessagePtr {
-          return wr->newReplyMessage(m);
-      };
-    }
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    wr->fromTestChangeProperty("/org/a11y/bus", "org.a11y.Status", "ScreenReaderEnabled", b);
-    wr->fromTestChangeProperty("/org/a11y/bus", "org.a11y.Status", "IsEnabled", b);
-  }
+void TestEnableSC(bool b)
+{
+  static bool firstTime = true;
+  if(b && firstTime)
+  {
+    gPropertyChangeCalled  = false;
+    firstTime              = false;
+    auto        bridge     = Accessibility::Bridge::GetCurrentBridge();
+    Dali::Stage stage      = Dali::Stage::GetCurrent();
+    auto        accessible = Accessibility::Accessible::Get(stage.GetRootLayer());
+    bridge->ApplicationResumed();
+    bridge->AddTopLevelWindow(accessible);
+    bridge->SetApplicationName("TestApp");
+    bridge->Initialize();
+
+    static bool ScreenReaderEnabled = false;
+    static bool IsEnabled           = false;
 
-  std::vector<Address> TestGetChildren(const Address &adr)
-  {
     auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall<std::vector<Address>>(adr.GetPath(), "org.a11y.atspi.Accessible", "GetChildren", std::tuple<>());
-    return std::move(std::get<0>(chs));
-  }
 
-  std::string TestGetName(const Address &adr)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto name = wr->fromTestGet<std::string>(adr.GetPath(), "org.a11y.atspi.Accessible", "Name");
-    return name;
-  }
+    wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/bus", "org.a11y.Status", "ScreenReaderEnabled", MethodType::Getter}] = [wr](const MessagePtr& m) -> MessagePtr {
+      auto reply = wr->newReplyMessage(m);
+      wr->Encode(reply, std::tuple<TestDBusWrapper::Variant<bool>>{ScreenReaderEnabled});
+      return reply;
+    };
+    wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/bus", "org.a11y.Status", "IsEnabled", MethodType::Getter}] = [wr](const MessagePtr& m) -> MessagePtr {
+      auto reply = wr->newReplyMessage(m);
+      wr->Encode(reply, std::tuple<TestDBusWrapper::Variant<bool>>{IsEnabled});
+      return reply;
+    };
+    wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/bus", "org.a11y.Bus", "GetAddress", MethodType::Method}] = [wr](const MessagePtr& m) -> MessagePtr {
+      auto reply = wr->newReplyMessage(m);
+      wr->Encode(reply, std::tuple<const char*>{"bus"});
+      return reply;
+    };
+    wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible/root", "org.a11y.atspi.Socket", "Embed", MethodType::Method}] = [wr](const MessagePtr& m) -> MessagePtr {
+      auto reply = wr->newReplyMessage(m);
+      wr->Encode(reply, std::tuple<Address>{{"bus", "root"}});
+      return reply;
+    };
+    wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible/root", "org.a11y.atspi.Socket", "Unembed", MethodType::Method}] = [wr](const MessagePtr& m) -> MessagePtr {
+      return wr->newReplyMessage(m);
+    };
+    wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible", "org.a11y.atspi.Event.Object", "PropertyChange", MethodType::Method}] =
+      [wr](const MessagePtr& m) -> MessagePtr {
+      gPropertyChangeCalled = true;
+      return wr->newReplyMessage(m);
+    };
+    wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible", "org.a11y.atspi.Event.Object", "StateChanged", MethodType::Method}] =
+      [wr](const MessagePtr& m) -> MessagePtr {
+      return wr->newReplyMessage(m);
+    };
+    wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible", "org.a11y.atspi.Event.Object", "BoundsChanged", MethodType::Method}] =
+      [wr](const MessagePtr& m) -> MessagePtr {
+      return wr->newReplyMessage(m);
+    };
+    wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible", "org.a11y.atspi.Event.Object", "ActiveDescendantChanged", MethodType::Method}] =
+      [wr](const MessagePtr& m) -> MessagePtr {
+      return wr->newReplyMessage(m);
+    };
+    wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible", "org.a11y.atspi.Event.Object", "TextChanged", MethodType::Method}] =
+      [wr](const MessagePtr& m) -> MessagePtr {
+      return wr->newReplyMessage(m);
+    };
+    wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible", "org.a11y.atspi.Event.Object", "TextCaretMoved", MethodType::Method}] =
+      [wr](const MessagePtr& m) -> MessagePtr {
+      return wr->newReplyMessage(m);
+    };
+    wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible", "org.a11y.atspi.Event.Object", "MoveOuted", MethodType::Method}] =
+      [wr](const MessagePtr& m) -> MessagePtr {
+      gMoveOutedCalled = true;
+      return wr->newReplyMessage(m);
+    };
+
+    wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible", "org.a11y.atspi.Event.Window", "Activate", MethodType::Method}] =
+      [wr](const MessagePtr& m) -> MessagePtr {
+      return wr->newReplyMessage(m);
+    };
+    wr->testMethods[std::tuple<std::string, std::string, std::string, MethodType>{"/org/a11y/atspi/accessible", "org.a11y.atspi.Event.Window", "Deactivate", MethodType::Method}] =
+      [wr](const MessagePtr& m) -> MessagePtr {
+      return wr->newReplyMessage(m);
+    };
+  }
+  auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  wr->fromTestChangeProperty("/org/a11y/bus", "org.a11y.Status", "ScreenReaderEnabled", b);
+  wr->fromTestChangeProperty("/org/a11y/bus", "org.a11y.Status", "IsEnabled", b);
+}
+
+std::vector<Address> TestGetChildren(const Address& adr)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<std::vector<Address>>(adr.GetPath(), "org.a11y.atspi.Accessible", "GetChildren", std::tuple<>());
+  return std::move(std::get<0>(chs));
+}
 
-  std::string TestGetDescription(const Address &adr)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto description = wr->fromTestGet<std::string>(adr.GetPath(), "org.a11y.atspi.Accessible", "Description");
-    return description;
-  }
+std::string TestGetName(const Address& adr)
+{
+  auto wr   = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto name = wr->fromTestGet<std::string>(adr.GetPath(), "org.a11y.atspi.Accessible", "Name");
+  return name;
+}
 
-  uint32_t TestGetRole(const Address &adr)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall<uint32_t>(adr.GetPath(), "org.a11y.atspi.Accessible", "GetRole", std::tuple<>());
-    return std::move(std::get<0>(chs));
-  }
+std::string TestGetDescription(const Address& adr)
+{
+  auto wr          = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto description = wr->fromTestGet<std::string>(adr.GetPath(), "org.a11y.atspi.Accessible", "Description");
+  return description;
+}
 
-  std::string TestGetRoleName(const Address &adr)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall<std::string>(adr.GetPath(), "org.a11y.atspi.Accessible", "GetRoleName", std::tuple<>());
-    return std::move(std::get<0>(chs));
-  }
+uint32_t TestGetRole(const Address& adr)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<uint32_t>(adr.GetPath(), "org.a11y.atspi.Accessible", "GetRole", std::tuple<>());
+  return std::move(std::get<0>(chs));
+}
 
-  Address TestGetParent(const Address &adr)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestGet< Address >(adr.GetPath(), "org.a11y.atspi.Accessible", "Parent");
-    return chs;
-  }
+std::string TestGetRoleName(const Address& adr)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<std::string>(adr.GetPath(), "org.a11y.atspi.Accessible", "GetRoleName", std::tuple<>());
+  return std::move(std::get<0>(chs));
+}
 
-  std::string TestGetLocalizedRoleName(const Address &adr)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall<std::string>(adr.GetPath(), "org.a11y.atspi.Accessible", "GetLocalizedRoleName", std::tuple<>());
-    return std::move(std::get<0>(chs));
-  }
+Address TestGetParent(const Address& adr)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestGet<Address>(adr.GetPath(), "org.a11y.atspi.Accessible", "Parent");
+  return chs;
+}
 
-  std::array< uint32_t, 2 > TestGetStates(const Address &adr)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall<std::array< uint32_t, 2 >>(adr.GetPath(), "org.a11y.atspi.Accessible", "GetState", std::tuple<>());
-    return std::move(std::get<0>(chs));
-  }
+std::string TestGetLocalizedRoleName(const Address& adr)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<std::string>(adr.GetPath(), "org.a11y.atspi.Accessible", "GetLocalizedRoleName", std::tuple<>());
+  return std::move(std::get<0>(chs));
+}
 
-  std::unordered_map< std::string, std::string > TestGetAttributes(const Address &adr)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall<std::unordered_map< std::string, std::string >>(adr.GetPath(), "org.a11y.atspi.Accessible", "GetAttributes", std::tuple<>());
-    return std::move(std::get<0>(chs));
-  }
+std::array<uint32_t, 2> TestGetStates(const Address& adr)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<std::array<uint32_t, 2>>(adr.GetPath(), "org.a11y.atspi.Accessible", "GetState", std::tuple<>());
+  return std::move(std::get<0>(chs));
+}
 
-  bool TestDoGesture(const Address &adr, Dali::Accessibility::Gesture type, int32_t xBeg, int32_t xEnd, int32_t yBeg, int32_t yEnd, Dali::Accessibility::GestureState state, uint32_t eventTime)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall< bool >(adr.GetPath(), "org.a11y.atspi.Accessible", "DoGesture",
-        std::tuple< Dali::Accessibility::Gesture, int32_t, int32_t, int32_t, int32_t, Dali::Accessibility::GestureState, uint32_t >(type, xBeg, xEnd, yBeg, yEnd, state, eventTime ));
-    return std::move(std::get<0>(chs));
-  }
+std::unordered_map<std::string, std::string> TestGetAttributes(const Address& adr)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<std::unordered_map<std::string, std::string>>(adr.GetPath(), "org.a11y.atspi.Accessible", "GetAttributes", std::tuple<>());
+  return std::move(std::get<0>(chs));
+}
 
-  std::vector< std::tuple< uint32_t, std::vector< Dali::Accessibility::Address > > > TestGetRelationSet(const Address &adr)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall< std::vector< std::tuple< uint32_t, std::vector< Dali::Accessibility::Address > > > >(adr.GetPath(), "org.a11y.atspi.Accessible", "GetRelationSet", std::tuple<>());
-    return std::move(std::get<0>(chs));
-  }
+bool TestDoGesture(const Address& adr, Dali::Accessibility::Gesture type, int32_t xBeg, int32_t xEnd, int32_t yBeg, int32_t yEnd, Dali::Accessibility::GestureState state, uint32_t eventTime)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<bool>(adr.GetPath(), "org.a11y.atspi.Accessible", "DoGesture", std::tuple<Dali::Accessibility::Gesture, int32_t, int32_t, int32_t, int32_t, Dali::Accessibility::GestureState, uint32_t>(type, xBeg, xEnd, yBeg, yEnd, state, eventTime));
+  return std::move(std::get<0>(chs));
+}
 
-  Address TestGetChildAtIndex(const Address &adr, int index)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall< Address >(adr.GetPath(), "org.a11y.atspi.Accessible", "GetChildAtIndex", std::tuple< int >( index ));
-    return std::move(std::get<0>(chs));
-  }
+std::vector<std::tuple<uint32_t, std::vector<Dali::Accessibility::Address>>> TestGetRelationSet(const Address& adr)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<std::vector<std::tuple<uint32_t, std::vector<Dali::Accessibility::Address>>>>(adr.GetPath(), "org.a11y.atspi.Accessible", "GetRelationSet", std::tuple<>());
+  return std::move(std::get<0>(chs));
+}
 
-  ComponentLayer TestGetLayer(const Address &adr)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall< Dali::Accessibility::ComponentLayer >(adr.GetPath(), "org.a11y.atspi.Component", "GetLayer", std::tuple<>());
-    return std::move(std::get<0>(chs));
-  }
+Address TestGetChildAtIndex(const Address& adr, int index)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<Address>(adr.GetPath(), "org.a11y.atspi.Accessible", "GetChildAtIndex", std::tuple<int>(index));
+  return std::move(std::get<0>(chs));
+}
 
-  int TestGetIndexInParent(const Address &adr)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall< int >(adr.GetPath(), "org.a11y.atspi.Accessible", "GetIndexInParent", std::tuple<>());
-    return std::move(std::get<0>(chs));
-  }
+ComponentLayer TestGetLayer(const Address& adr)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<Dali::Accessibility::ComponentLayer>(adr.GetPath(), "org.a11y.atspi.Component", "GetLayer", std::tuple<>());
+  return std::move(std::get<0>(chs));
+}
 
-  bool TestGrabFocus(const Address &adr)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall< bool >(adr.GetPath(), "org.a11y.atspi.Component", "GrabFocus", std::tuple<>());
-    return std::move(std::get<0>(chs));
-  }
+int TestGetIndexInParent(const Address& adr)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<int>(adr.GetPath(), "org.a11y.atspi.Accessible", "GetIndexInParent", std::tuple<>());
+  return std::move(std::get<0>(chs));
+}
 
-  bool TestGrabHighlight(const Address &adr)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall< bool >(adr.GetPath(), "org.a11y.atspi.Component", "GrabHighlight", std::tuple<>());
-    return std::move(std::get<0>(chs));
-  }
+bool TestGrabFocus(const Address& adr)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<bool>(adr.GetPath(), "org.a11y.atspi.Component", "GrabFocus", std::tuple<>());
+  return std::move(std::get<0>(chs));
+}
 
-  bool TestClearHighlight(const Address &adr)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall< bool >(adr.GetPath(), "org.a11y.atspi.Component", "ClearHighlight", std::tuple<>());
-    return std::move(std::get<0>(chs));
-  }
+bool TestGrabHighlight(const Address& adr)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<bool>(adr.GetPath(), "org.a11y.atspi.Component", "GrabHighlight", std::tuple<>());
+  return std::move(std::get<0>(chs));
+}
 
-  std::tuple< int32_t, int32_t, int32_t, int32_t > TestGetExtents(const Address &adr, Dali::Accessibility::CoordinateType coordinateType)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall< std::tuple< int32_t, int32_t, int32_t, int32_t > >(adr.GetPath(), "org.a11y.atspi.Component", "GetExtents", std::make_tuple(static_cast<uint32_t>(coordinateType)));
-    return std::move(std::get<0>(chs));
-  }
+bool TestClearHighlight(const Address& adr)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<bool>(adr.GetPath(), "org.a11y.atspi.Component", "ClearHighlight", std::tuple<>());
+  return std::move(std::get<0>(chs));
+}
 
-  int TestGetMdiZOrder(const Address &adr)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall< int16_t >(adr.GetPath(), "org.a11y.atspi.Component", "GetMDIZOrder", std::tuple<>());
-    return std::move(std::get<0>(chs));
-  }
+std::tuple<int32_t, int32_t, int32_t, int32_t> TestGetExtents(const Address& adr, Dali::Accessibility::CoordinateType coordinateType)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<std::tuple<int32_t, int32_t, int32_t, int32_t>>(adr.GetPath(), "org.a11y.atspi.Component", "GetExtents", std::make_tuple(static_cast<uint32_t>(coordinateType)));
+  return std::move(std::get<0>(chs));
+}
 
-  double TestGetAlpha(const Address &adr)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall< double >(adr.GetPath(), "org.a11y.atspi.Component", "GetAlpha", std::tuple<>());
-    return std::move(std::get<0>(chs));
-  }
+int TestGetMdiZOrder(const Address& adr)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<int16_t>(adr.GetPath(), "org.a11y.atspi.Component", "GetMDIZOrder", std::tuple<>());
+  return std::move(std::get<0>(chs));
+}
 
-  std::string TestGetActionName(const Address &adr, size_t index)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall< std::string >(adr.GetPath(), "org.a11y.atspi.Action", "GetName", std::tuple< int32_t >( index ));
-    return std::move(std::get<0>(chs));
-  }
+double TestGetAlpha(const Address& adr)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<double>(adr.GetPath(), "org.a11y.atspi.Component", "GetAlpha", std::tuple<>());
+  return std::move(std::get<0>(chs));
+}
 
-  std::string TestGetLocalizedActionName(const Address &adr, size_t index)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall< std::string >(adr.GetPath(), "org.a11y.atspi.Action", "GetLocalizedName", std::tuple< int32_t >( index ));
-    return std::move(std::get<0>(chs));
-  }
+std::string TestGetActionName(const Address& adr, size_t index)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<std::string>(adr.GetPath(), "org.a11y.atspi.Action", "GetName", std::tuple<int32_t>(index));
+  return std::move(std::get<0>(chs));
+}
 
-  size_t TestGetActionCount(const Address &adr)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto count = wr->fromTestGet< int32_t >(adr.GetPath(), "org.a11y.atspi.Action", "NActions");
-    return count;
-  }
+std::string TestGetLocalizedActionName(const Address& adr, size_t index)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<std::string>(adr.GetPath(), "org.a11y.atspi.Action", "GetLocalizedName", std::tuple<int32_t>(index));
+  return std::move(std::get<0>(chs));
+}
 
-  bool TestDoAction(const Address &adr, size_t index)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall< bool >(adr.GetPath(), "org.a11y.atspi.Action", "DoAction", std::tuple< int32_t >( index ));
-    return std::move(std::get<0>(chs));
-  }
+size_t TestGetActionCount(const Address& adr)
+{
+  auto wr    = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto count = wr->fromTestGet<int32_t>(adr.GetPath(), "org.a11y.atspi.Action", "NActions");
+  return count;
+}
 
-  bool TestDoAction(const Address &adr, const std::string& name)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall< bool >(adr.GetPath(), "org.a11y.atspi.Action", "DoActionName", std::tuple< std::string >( name ));
-    return std::move(std::get<0>(chs));
-  }
+bool TestDoAction(const Address& adr, size_t index)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<bool>(adr.GetPath(), "org.a11y.atspi.Action", "DoAction", std::tuple<int32_t>(index));
+  return std::move(std::get<0>(chs));
+}
 
-  std::string TestGetActionKeyBinding(const Address &adr, size_t index)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall< std::string >(adr.GetPath(), "org.a11y.atspi.Action", "GetKeyBinding", std::tuple< int32_t >( index ));
-    return std::move(std::get<0>(chs));
-  }
+bool TestDoAction(const Address& adr, const std::string& name)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<bool>(adr.GetPath(), "org.a11y.atspi.Action", "DoActionName", std::tuple<std::string>(name));
+  return std::move(std::get<0>(chs));
+}
 
-  std::string TestGetActionDescription(const Address &adr, size_t index)
-  {
-    auto wr = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
-    auto chs = wr->fromTestCall< std::string >(adr.GetPath(), "org.a11y.atspi.Action", "GetDescription", std::tuple< int32_t >( index ));
-    return std::move(std::get<0>(chs));
-  }
+std::string TestGetActionKeyBinding(const Address& adr, size_t index)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<std::string>(adr.GetPath(), "org.a11y.atspi.Action", "GetKeyBinding", std::tuple<int32_t>(index));
+  return std::move(std::get<0>(chs));
+}
 
-  void TestResetMoveOutedCalled ()
-  {
-    gMoveOutedCalled = false;
-  }
+std::string TestGetActionDescription(const Address& adr, size_t index)
+{
+  auto wr  = static_cast<TestDBusWrapper*>(DBusWrapper::Installed());
+  auto chs = wr->fromTestCall<std::string>(adr.GetPath(), "org.a11y.atspi.Action", "GetDescription", std::tuple<int32_t>(index));
+  return std::move(std::get<0>(chs));
+}
 
-  bool TestGetMoveOutedCalled ()
-  {
-    return gMoveOutedCalled;
-  }
+void TestResetMoveOutedCalled()
+{
+  gMoveOutedCalled = false;
+}
 
-  void PrintTree(const Address &root, size_t depth)
+bool TestGetMoveOutedCalled()
+{
+  return gMoveOutedCalled;
+}
+
+bool TestPropertyChangeCalled()
+{
+  return gPropertyChangeCalled;
+}
+
+void PrintTree(const Address& root, size_t depth)
+{
+  auto name = TestGetName(root);
+  printf("%10s", root.GetPath().c_str());
+  for(unsigned int i = 0; i < depth; ++i) printf("  ");
+  printf("%s\n", name.c_str());
+  auto chs = TestGetChildren(root);
+  for(auto& c : chs)
   {
-    auto name = TestGetName(root);
-    printf("%10s", root.GetPath().c_str());
-    for(unsigned int i = 0; i < depth; ++i) printf("  ");
-    printf("%s\n", name.c_str());
-    auto chs = TestGetChildren(root);
-    for(auto &c : chs)
-    {
-      PrintTree(c, depth + 1);
-    }
+    PrintTree(c, depth + 1);
   }
+}
 
-  bool Find(const std::vector< std::string > &collection, const std::string &key)
+bool Find(const std::vector<std::string>& collection, const std::string& key)
+{
+  for(auto& it : collection)
   {
-    for(auto& it : collection)
+    if(it == key)
     {
-      if(it == key)
-      {
-        return true;
-      }
+      return true;
     }
-    return false;
   }
+  return false;
+}
 
 } // namespace Accessibility
 } // namespace Dali
index 92388e2cf15e6201f4092c37550a4d0d8c85040a..826ce25fe79a5e45e7f61bb67f8bfc4dd406dcc3 100644 (file)
@@ -7,38 +7,39 @@ namespace Dali
 {
 namespace Accessibility
 {
-  void TestEnableSC(bool b);
-  std::vector<Address> TestGetChildren(const Address &adr);
-  std::string TestGetName(const Address &adr);
-  std::string TestGetDescription(const Address &adr);
-  uint32_t TestGetRole(const Address &adr);
-  std::string TestGetRoleName(const Address &adr);
-  Address TestGetParent(const Address &adr);
-  std::string TestGetLocalizedRoleName(const Address &adr);
-  std::array< uint32_t, 2 > TestGetStates(const Address &adr);
-  std::unordered_map< std::string, std::string > TestGetAttributes(const Address &adr);
-  bool TestDoGesture(const Address &adr, Dali::Accessibility::Gesture type, int32_t xBeg, int32_t xEnd, int32_t yBeg, int32_t yEnd, Dali::Accessibility::GestureState state, uint32_t eventTime);
-  std::vector< std::tuple< uint32_t, std::vector< Dali::Accessibility::Address > > > TestGetRelationSet(const Address &adr);
-  Address TestGetChildAtIndex(const Address &adr, int index);
-  ComponentLayer TestGetLayer(const Address &adr);
-  int TestGetIndexInParent(const Address &adr);
-  bool TestGrabFocus(const Address &adr);
-  bool TestGrabHighlight(const Address &adr);
-  bool TestClearHighlight(const Address &adr);
-  std::tuple< int32_t, int32_t, int32_t, int32_t > TestGetExtents(const Address &adr, Dali::Accessibility::CoordinateType coordinateType );
-  int TestGetMdiZOrder(const Address &adr);
-  double TestGetAlpha(const Address &adr);
-  void PrintTree(const Address &root, size_t depth = 0);
-  bool Find( const std::vector< std::string > &collection, const std::string &key);
-  std::string TestGetActionName( const Address &adr, size_t index );
-  std::string TestGetLocalizedActionName( const Address &adr, size_t index );
-  size_t TestGetActionCount( const Address &adr );
-  bool TestDoAction ( const Address &adr, size_t index );
-  bool TestDoAction ( const Address &adr, const std::string& name );
-  std::string TestGetActionKeyBinding ( const Address &adr, size_t index );
-  std::string TestGetActionDescription ( const Address &adr, size_t index );
-  void TestResetMoveOutedCalled ();
-  bool TestGetMoveOutedCalled ();
+void                                                                           TestEnableSC(bool b);
+std::vector<Address>                                                           TestGetChildren(const Address& adr);
+std::string                                                                    TestGetName(const Address& adr);
+std::string                                                                    TestGetDescription(const Address& adr);
+uint32_t                                                                       TestGetRole(const Address& adr);
+std::string                                                                    TestGetRoleName(const Address& adr);
+Address                                                                        TestGetParent(const Address& adr);
+std::string                                                                    TestGetLocalizedRoleName(const Address& adr);
+std::array<uint32_t, 2>                                                        TestGetStates(const Address& adr);
+std::unordered_map<std::string, std::string>                                   TestGetAttributes(const Address& adr);
+bool                                                                           TestDoGesture(const Address& adr, Dali::Accessibility::Gesture type, int32_t xBeg, int32_t xEnd, int32_t yBeg, int32_t yEnd, Dali::Accessibility::GestureState state, uint32_t eventTime);
+std::vector<std::tuple<uint32_t, std::vector<Dali::Accessibility::Address> > > TestGetRelationSet(const Address& adr);
+Address                                                                        TestGetChildAtIndex(const Address& adr, int index);
+ComponentLayer                                                                 TestGetLayer(const Address& adr);
+int                                                                            TestGetIndexInParent(const Address& adr);
+bool                                                                           TestGrabFocus(const Address& adr);
+bool                                                                           TestGrabHighlight(const Address& adr);
+bool                                                                           TestClearHighlight(const Address& adr);
+std::tuple<int32_t, int32_t, int32_t, int32_t>                                 TestGetExtents(const Address& adr, Dali::Accessibility::CoordinateType coordinateType);
+int                                                                            TestGetMdiZOrder(const Address& adr);
+double                                                                         TestGetAlpha(const Address& adr);
+void                                                                           PrintTree(const Address& root, size_t depth = 0);
+bool                                                                           Find(const std::vector<std::string>& collection, const std::string& key);
+std::string                                                                    TestGetActionName(const Address& adr, size_t index);
+std::string                                                                    TestGetLocalizedActionName(const Address& adr, size_t index);
+size_t                                                                         TestGetActionCount(const Address& adr);
+bool                                                                           TestDoAction(const Address& adr, size_t index);
+bool                                                                           TestDoAction(const Address& adr, const std::string& name);
+std::string                                                                    TestGetActionKeyBinding(const Address& adr, size_t index);
+std::string                                                                    TestGetActionDescription(const Address& adr, size_t index);
+void                                                                           TestResetMoveOutedCalled();
+bool                                                                           TestGetMoveOutedCalled();
+bool                                                                           TestPropertyChangeCalled();
 } // namespace Accessibility
 } // namespace Dali
 
index 894e1a9c9130fac243d5de181d800c9ab78dd578..1818713fc0e8b2885307ca492fd68bfe3c91253d 100644 (file)
@@ -94,6 +94,7 @@ int UtcDaliControlAccessibilityName(void)
   DALI_TEST_EQUALS("Accessibility_Name_With_Callback", q->GetName(), TEST_LOCATION);
 
   Dali::Accessibility::TestEnableSC(true);
+  DALI_TEST_CHECK(!Dali::Accessibility::TestPropertyChangeCalled());
 
   DALI_TEST_EQUALS("Accessibility_Name_With_Callback", TestGetName(q->GetAddress()), TEST_LOCATION);
 
@@ -108,7 +109,9 @@ int UtcDaliControlAccessibilityName(void)
   DALI_TEST_EQUALS("Changed_Accessiblity_Name", q->GetName(), TEST_LOCATION);
   DALI_TEST_EQUALS(control.GetProperty(DevelControl::Property::ACCESSIBILITY_NAME).Get<std::string>(), "Changed_Accessiblity_Name", TEST_LOCATION);
 
-  //TODO test emission of name change signal
+  // test emission of property change signal
+  DALI_TEST_CHECK(Dali::Accessibility::TestPropertyChangeCalled());
+
   Dali::Accessibility::TestEnableSC(false);
 
   END_TEST;
@@ -138,6 +141,7 @@ int UtcDaliControlAccessibilityDescription(void)
   DALI_TEST_EQUALS("Accessibility_Description_With_Callback", q->GetDescription(), TEST_LOCATION);
 
   Dali::Accessibility::TestEnableSC(true);
+  DALI_TEST_CHECK(!Dali::Accessibility::TestPropertyChangeCalled());
 
   DALI_TEST_EQUALS("Accessibility_Description_With_Callback", TestGetDescription(q->GetAddress()), TEST_LOCATION);
 
@@ -152,7 +156,9 @@ int UtcDaliControlAccessibilityDescription(void)
   DALI_TEST_EQUALS("Changed_Accessiblity_Description", q->GetDescription(), TEST_LOCATION);
   DALI_TEST_EQUALS(control.GetProperty(DevelControl::Property::ACCESSIBILITY_DESCRIPTION).Get<std::string>(), "Changed_Accessiblity_Description", TEST_LOCATION);
 
-  //TODO test emission of description change signal
+  // test emission of property change signal
+  DALI_TEST_CHECK(Dali::Accessibility::TestPropertyChangeCalled());
+
   Dali::Accessibility::TestEnableSC(false);
 
   END_TEST;
@@ -176,17 +182,27 @@ int UtcDaliControlAccessibilityValue(void)
   DALI_TEST_EQUALS("Accessibility_Value", property, TEST_LOCATION);
 
   Dali::Accessibility::TestEnableSC(true);
-
-  auto i = dynamic_cast<Dali::Accessibility::Component*>(q);
-
-  DALI_TEST_CHECK(i);
-  i->GrabHighlight();
+  DALI_TEST_CHECK(!Dali::Accessibility::TestPropertyChangeCalled());
 
   control.SetProperty(DevelControl::Property::ACCESSIBILITY_VALUE, "Changed_Accessiblity_Value");
   DALI_TEST_EQUALS("Changed_Accessiblity_Value", q->GetValue(), TEST_LOCATION);
   DALI_TEST_EQUALS(control.GetProperty(DevelControl::Property::ACCESSIBILITY_VALUE).Get<std::string>(), "Changed_Accessiblity_Value", TEST_LOCATION);
 
-  //TODO test emission of description change signal
+  // value property change signal is not emitted if not highlighted
+  DALI_TEST_CHECK(!Dali::Accessibility::TestPropertyChangeCalled());
+
+  auto component = dynamic_cast<Dali::Accessibility::Component*>(q);
+
+  DALI_TEST_CHECK(component);
+  component->GrabHighlight();
+
+  control.SetProperty(DevelControl::Property::ACCESSIBILITY_VALUE, "Changed_Accessiblity_Value_2");
+  DALI_TEST_EQUALS("Changed_Accessiblity_Value_2", q->GetValue(), TEST_LOCATION);
+  DALI_TEST_EQUALS(control.GetProperty(DevelControl::Property::ACCESSIBILITY_VALUE).Get<std::string>(), "Changed_Accessiblity_Value_2", TEST_LOCATION);
+
+  // value property change signal is emitted if highlighted
+  DALI_TEST_CHECK(Dali::Accessibility::TestPropertyChangeCalled());
+
   Dali::Accessibility::TestEnableSC(false);
 
   END_TEST;
index 0337b9c1ac652843165a822f8f9e19de1f6aa25b..e101639376b1b8e4be87256392b9ade8ed78ac34 100644 (file)
@@ -814,6 +814,7 @@ void Control::Impl::OnAccessibilityPropertySet(Dali::Handle& handle, Dali::Prope
       if(index == DevelControl::Property::ACCESSIBILITY_NAME || (mAccessibilityProps.name.empty() && index == accessible->GetNamePropertyIndex()))
       {
         accessible->Emit(Dali::Accessibility::ObjectPropertyChangeEvent::NAME);
+        return;
       }
     }
 
@@ -822,8 +823,14 @@ void Control::Impl::OnAccessibilityPropertySet(Dali::Handle& handle, Dali::Prope
       if(index == DevelControl::Property::ACCESSIBILITY_DESCRIPTION || (mAccessibilityProps.description.empty() && index == accessible->GetDescriptionPropertyIndex()))
       {
         accessible->Emit(Dali::Accessibility::ObjectPropertyChangeEvent::DESCRIPTION);
+        return;
       }
     }
+
+    if(index == DevelControl::Property::ACCESSIBILITY_VALUE)
+    {
+      accessible->Emit(Dali::Accessibility::ObjectPropertyChangeEvent::VALUE);
+    }
   }
 }