X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit-internal%2Fdali-toolkit-test-utils%2Faccessibility-test-utils.cpp;h=b654d52a8022dba975dab3491ad29f89cf1c0b3f;hp=f8eec35d451230278f97152f096e108846d25145;hb=refs%2Fchanges%2F79%2F265679%2F5;hpb=c0774753cf5e71966c4202db7ff20d382f444315 diff --git a/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/accessibility-test-utils.cpp b/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/accessibility-test-utils.cpp index f8eec35..b654d52 100644 --- a/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/accessibility-test-utils.cpp +++ b/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/accessibility-test-utils.cpp @@ -4,287 +4,312 @@ #include #include "dbus-wrapper.h" -namespace Dali { - namespace Accessibility { - - using MethodType = TestDBusWrapper::MethodType; - using MessagePtr = DBusWrapper::MessagePtr; - - 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(DBusWrapper::Installed()); - - wr->testMethods[std::tuple{"/org/a11y/bus", "org.a11y.Status", "ScreenReaderEnabled", MethodType::Getter}] = [wr](const MessagePtr &m) -> MessagePtr { - auto reply = wr->newReplyMessage(m); - wr->Encode(reply, std::tuple>{ ScreenReaderEnabled }); - return reply; - }; - wr->testMethods[std::tuple{"/org/a11y/bus", "org.a11y.Status", "IsEnabled", MethodType::Getter}] = [wr](const MessagePtr &m) -> MessagePtr { - auto reply = wr->newReplyMessage(m); - wr->Encode(reply, std::tuple>{ IsEnabled }); - return reply; - }; - wr->testMethods[std::tuple{"/org/a11y/bus", "org.a11y.Bus", "GetAddress", MethodType::Method}] = [wr](const MessagePtr &m) -> MessagePtr { - auto reply = wr->newReplyMessage(m); - wr->Encode(reply, std::tuple{ "bus" }); - return reply; - }; - wr->testMethods[std::tuple{"/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
{ {"bus", "root"} }); - return reply; - }; - wr->testMethods[std::tuple{"/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{"/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{"/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{"/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{"/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{"/org/a11y/atspi/accessible", "org.a11y.atspi.Event.Object", "TextCaretMoved", MethodType::Method}] = - [wr](const MessagePtr &m) -> MessagePtr { - return wr->newReplyMessage(m); - }; - } - auto wr = static_cast(DBusWrapper::Installed()); - wr->fromTestChangeProperty("/org/a11y/bus", "org.a11y.Status", "ScreenReaderEnabled", b); - wr->fromTestChangeProperty("/org/a11y/bus", "org.a11y.Status", "IsEnabled", b); - } - - std::vector
TestGetChildren(const Address &adr) - { - auto wr = static_cast(DBusWrapper::Installed()); - auto chs = wr->fromTestCall>(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(DBusWrapper::Installed()); - auto name = wr->fromTestGet(adr.GetPath(), "org.a11y.atspi.Accessible", "Name"); - return name; - } - - std::string TestGetDescription(const Address &adr) - { - auto wr = static_cast(DBusWrapper::Installed()); - auto description = wr->fromTestGet(adr.GetPath(), "org.a11y.atspi.Accessible", "Description"); - return description; - } - - uint32_t TestGetRole(const Address &adr) - { - auto wr = static_cast(DBusWrapper::Installed()); - auto chs = wr->fromTestCall(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(DBusWrapper::Installed()); - auto chs = wr->fromTestCall(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(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(DBusWrapper::Installed()); - auto chs = wr->fromTestCall(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(DBusWrapper::Installed()); - auto chs = wr->fromTestCall>(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(DBusWrapper::Installed()); - auto chs = wr->fromTestCall>(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(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(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(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(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(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(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(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(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) - { - auto wr = static_cast(DBusWrapper::Installed()); - auto chs = wr->fromTestCall< std::tuple< int32_t, int32_t, int32_t, int32_t > >(adr.GetPath(), "org.a11y.atspi.Component", "GetExtents", std::tuple(0)); - return std::move(std::get<0>(chs)); - } - - int TestGetMdiZOrder(const Address &adr) - { - auto wr = static_cast(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(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(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(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(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(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(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(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(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 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(DBusWrapper::Installed()); + + wr->testMethods[std::tuple{"/org/a11y/bus", "org.a11y.Status", "ScreenReaderEnabled", MethodType::Getter}] = [wr](const MessagePtr &m) -> MessagePtr { + auto reply = wr->newReplyMessage(m); + wr->Encode(reply, std::tuple>{ ScreenReaderEnabled }); + return reply; + }; + wr->testMethods[std::tuple{"/org/a11y/bus", "org.a11y.Status", "IsEnabled", MethodType::Getter}] = [wr](const MessagePtr &m) -> MessagePtr { + auto reply = wr->newReplyMessage(m); + wr->Encode(reply, std::tuple>{ IsEnabled }); + return reply; + }; + wr->testMethods[std::tuple{"/org/a11y/bus", "org.a11y.Bus", "GetAddress", MethodType::Method}] = [wr](const MessagePtr &m) -> MessagePtr { + auto reply = wr->newReplyMessage(m); + wr->Encode(reply, std::tuple{ "bus" }); + return reply; + }; + wr->testMethods[std::tuple{"/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
{ {"bus", "root"} }); + return reply; + }; + wr->testMethods[std::tuple{"/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{"/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{"/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{"/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{"/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{"/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{"/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(DBusWrapper::Installed()); + wr->fromTestChangeProperty("/org/a11y/bus", "org.a11y.Status", "ScreenReaderEnabled", b); + wr->fromTestChangeProperty("/org/a11y/bus", "org.a11y.Status", "IsEnabled", b); + } + + std::vector
TestGetChildren(const Address &adr) + { + auto wr = static_cast(DBusWrapper::Installed()); + auto chs = wr->fromTestCall>(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(DBusWrapper::Installed()); + auto name = wr->fromTestGet(adr.GetPath(), "org.a11y.atspi.Accessible", "Name"); + return name; + } + + std::string TestGetDescription(const Address &adr) + { + auto wr = static_cast(DBusWrapper::Installed()); + auto description = wr->fromTestGet(adr.GetPath(), "org.a11y.atspi.Accessible", "Description"); + return description; + } + + uint32_t TestGetRole(const Address &adr) + { + auto wr = static_cast(DBusWrapper::Installed()); + auto chs = wr->fromTestCall(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(DBusWrapper::Installed()); + auto chs = wr->fromTestCall(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(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(DBusWrapper::Installed()); + auto chs = wr->fromTestCall(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(DBusWrapper::Installed()); + auto chs = wr->fromTestCall>(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(DBusWrapper::Installed()); + auto chs = wr->fromTestCall>(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(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(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(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(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(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(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(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(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(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(coordinateType))); + return std::move(std::get<0>(chs)); + } + + int TestGetMdiZOrder(const Address &adr) + { + auto wr = static_cast(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(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(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(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(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(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(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(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(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