Merge "[ATSPI] Update accessibility-test-utils files" into devel/master
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Wed, 10 Nov 2021 07:17:09 +0000 (07:17 +0000)
committerGerrit Code Review <gerrit@review>
Wed, 10 Nov 2021 07:17:09 +0000 (07:17 +0000)
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/devel-api/controls/accessible-impl.cpp
dali-toolkit/devel-api/controls/accessible-impl.h
dali-toolkit/internal/controls/control/control-data-impl.cpp

index a9d9f03..b654d52 100644 (file)
 #include <dali/devel-api/adaptor-framework/accessibility-impl.h>
 #include "dbus-wrapper.h"
 
-namespace Dali {
-    namespace Accessibility {
-
-        using MethodType = TestDBusWrapper::MethodType;
-        using MessagePtr = DBusWrapper::MessagePtr;
-
-        static bool MoveOutedCalled = 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->SetApplicationChild( accessible ); // BART
-                bridge->AddTopLevelWindow( accessible ); // BART
-                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", "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 {
-                    MoveOutedCalled = true;
-                    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 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;
-        }
-
-        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;
-        }
-
-        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 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));
-        }
-
-        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 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::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::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));
-        }
-
-        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::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));
-        }
-
-        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));
-        }
-
-        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));
-        }
-
-        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 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 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 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));
-        }
-
-        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));
-        }
-
-        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));
-        }
-
-        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 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));
-        }
-
-        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));
-        }
-
-        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, 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));
-        }
-
-        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 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));
-        }
-
-        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));
-        }
-
-        void TestResetMoveOutedCalled ()
-        {
-          MoveOutedCalled = false;
-        }
-
-        bool TestGetMoveOutedCalled ()
-        {
-          return MoveOutedCalled;
-        }
-
-        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)
-                printTree(c, depth + 1);
-        }
-
-        bool Find( const std::vector< std::string > &collection, const std::string &key)
-        {
-            for ( auto& it : collection)
-                if( it == key )
-                    return true;
-            return false;
-        }
+namespace Dali
+{
+namespace Accessibility
+{
+  using MethodType = TestDBusWrapper::MethodType;
+  using MessagePtr = DBusWrapper::MessagePtr;
+
+  static bool gMoveOutedCalled = 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(), true );
+      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", "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);
+      };
     }
-}
+    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 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;
+  }
+
+  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;
+  }
+
+  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 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));
+  }
+
+  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 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::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::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));
+  }
+
+  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::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));
+  }
+
+  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));
+  }
+
+  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));
+  }
+
+  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 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 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 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));
+  }
+
+  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));
+  }
+
+  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));
+  }
+
+  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 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));
+  }
+
+  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));
+  }
+
+  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, 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));
+  }
+
+  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 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));
+  }
+
+  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));
+  }
+
+  void TestResetMoveOutedCalled ()
+  {
+    gMoveOutedCalled = false;
+  }
+
+  bool TestGetMoveOutedCalled ()
+  {
+    return gMoveOutedCalled;
+  }
+
+  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)
+    {
+      PrintTree(c, depth + 1);
+    }
+  }
+
+  bool Find(const std::vector< std::string > &collection, const std::string &key)
+  {
+    for(auto& it : collection)
+    {
+      if(it == key)
+      {
+        return true;
+      }
+    }
+    return false;
+  }
+
+} // namespace Accessibility
+} // namespace Dali
index 6c172fd..92388e2 100644 (file)
@@ -3,42 +3,43 @@
 
 #include <dali/devel-api/adaptor-framework/accessibility.h>
 
-
-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 ();
-    }
-}
+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 ();
+} // namespace Accessibility
+} // namespace Dali
 
 #endif //__DALI_TOOLKIT_ACCESSIBILITY_TEST_UTILS__
index 0b1ec0e..047018d 100644 (file)
@@ -1157,6 +1157,7 @@ int UtcDaliAccessibilityScrollToChildNonScrollable(void)
 
   DALI_TEST_EQUALS(accessible->IsScrollable(), false, TEST_LOCATION);
   DALI_TEST_EQUALS(accessible->ScrollToChild({}), false, TEST_LOCATION);
+  DALI_TEST_EQUALS(accessible->GetInternalActor(), Dali::Actor{}, TEST_LOCATION);
 
   Dali::Accessibility::TestEnableSC( false );
   END_TEST;
index 9f1c78e..bd4a649 100644 (file)
@@ -542,6 +542,11 @@ std::vector<Dali::Accessibility::Relation> AccessibleImpl::GetRelationSet()
   return ret;
 }
 
+Dali::Actor AccessibleImpl::GetInternalActor()
+{
+  return Dali::Actor{};
+}
+
 bool AccessibleImpl::ScrollToChild(Actor child)
 {
   return false;
index aa5084a..18b77f5 100644 (file)
@@ -226,6 +226,11 @@ public:
   std::vector<Dali::Accessibility::Relation> GetRelationSet() override;
 
   /**
+   * @copydoc Dali::Accessibility::Accessible::GetInternalActor()
+   */
+  Dali::Actor GetInternalActor() override;
+
+  /**
    * @copydoc Dali::Accessibility::Accessible::GetStates()
    */
   virtual Dali::Accessibility::States CalculateStates();
index b81149c..d9a554e 100644 (file)
@@ -507,7 +507,7 @@ Control::Impl::Impl(Control& controlImpl)
   mNeedToEmitResourceReady(false),
   mDispatchKeyEvents(true)
 {
-  Dali::Accessibility::Accessible::RegisterControlAccessibilityGetter(
+  Dali::Accessibility::Accessible::RegisterExternalAccessibleGetter(
     [](Dali::Actor actor) -> Dali::Accessibility::Accessible* {
       return Control::Impl::GetAccessibilityObject(actor);
     });