LibreOffice Module test (master) 1
|
#include <accessibletestbase.hxx>
Classes | |
class | Dialog |
class | DialogWaiter |
Public Member Functions | |
virtual void | setUp () override |
virtual void | tearDown () override |
Public Member Functions inherited from test::BootstrapFixture | |
DECL_DLLPRIVATE_STATIC_LINK (BootstrapFixture, ImplInitFilterHdl, ConvertData &, bool) | |
BootstrapFixture (bool bAssertOnDialog=true, bool bNeedUCB=true) | |
virtual | ~BootstrapFixture () override |
virtual void | setUp () override |
void | validate (const OUString &rURL, ValidationFormat) const |
Public Member Functions inherited from test::BootstrapFixtureBase | |
BootstrapFixtureBase () | |
virtual | ~BootstrapFixtureBase () override |
const css::uno::Reference< css::uno::XComponentContext > & | getComponentContext () const |
const css::uno::Reference< css::lang::XMultiServiceFactory > & | getMultiServiceFactory () const |
virtual void | setUp () override |
virtual void | tearDown () override |
Protected Member Functions | |
virtual void | load (const rtl::OUString &sURL) |
virtual void | loadFromSrc (const rtl::OUString &sSrcPath) |
void | close () |
css::uno::Reference< css::accessibility::XAccessibleContext > | getWindowAccessibleContext () |
virtual css::uno::Reference< css::accessibility::XAccessibleContext > | getDocumentAccessibleContext () |
void | documentPostKeyEvent (int nType, int nCharCode, int nKeyCode) |
virtual std::deque< css::uno::Reference< css::accessibility::XAccessibleContext > > | getAllChildren (const css::uno::Reference< css::accessibility::XAccessibleContext > &xContext) |
Tries to list all children of an accessible. More... | |
void | dumpA11YTree (const css::uno::Reference< css::accessibility::XAccessibleContext > &xContext, const int depth=0) |
Prints the tree of accessible objects starting at xContext to stdout. More... | |
css::uno::Reference< css::accessibility::XAccessibleContext > | getItemFromName (const css::uno::Reference< css::accessibility::XAccessibleContext > &xMenuCtx, std::u16string_view name) |
bool | activateMenuItem (const css::uno::Reference< css::accessibility::XAccessibleAction > &xAction) |
bool | activateMenuItem (const css::uno::Reference< css::accessibility::XAccessibleContext > &xCtx) |
template<typename... Ts> | |
css::uno::Reference< css::accessibility::XAccessibleContext > | getItemFromName (const css::uno::Reference< css::accessibility::XAccessibleContext > &xMenuCtx, std::u16string_view name, Ts... names) |
template<typename... Ts> | |
bool | activateMenuItem (const css::uno::Reference< css::accessibility::XAccessibleContext > &xMenuCtx, Ts... names) |
template<typename... Ts> | |
bool | activateMenuItem (Ts... names) |
Static Protected Member Functions | |
static bool | isDocumentRole (const sal_Int16 role) |
static css::uno::Reference< css::accessibility::XAccessibleContext > | getFirstRelationTargetOfType (const css::uno::Reference< css::accessibility::XAccessibleContext > &xContext, sal_Int16 relationType) |
static css::uno::Reference< css::accessibility::XAccessibleContext > | getFocusedObject (const css::uno::Reference< css::accessibility::XAccessibleContext > &xCtx) |
Gets the focused accessible object at xAcc level or below. More... | |
static css::uno::Reference< css::accessibility::XAccessibleContext > | getFocusedObject (const css::uno::Reference< css::accessibility::XAccessible > &xAcc) |
static css::uno::Reference< css::accessibility::XAccessibleContext > | tabTo (const css::uno::Reference< css::accessibility::XAccessible > &xRoot, const sal_Int16 role, const std::u16string_view name, const EventPosterHelperBase *pEventPosterHelper=nullptr) |
Navigates through focusable elements using the Tab keyboard shortcut. More... | |
static bool | tabTo (const css::uno::Reference< css::accessibility::XAccessible > &xRoot, const css::uno::Reference< css::accessibility::XAccessibleContext > &xChild, const EventPosterHelperBase *pEventPosterHelper=nullptr) |
static std::shared_ptr< DialogWaiter > | awaitDialog (const std::u16string_view name, std::function< void(Dialog &)> callback, bool bAutoClose=true) |
Helper to call user code when a given dialog opens. More... | |
Static Protected Member Functions inherited from test::BootstrapFixture | |
static bool | IsDefaultDPI () |
static std::pair< double, double > | getDPIScaling () |
Protected Attributes | |
css::uno::Reference< css::frame::XDesktop2 > | mxDesktop |
css::uno::Reference< css::lang::XComponent > | mxDocument |
css::uno::Reference< css::awt::XWindow > | mxWindow |
Protected Attributes inherited from test::BootstrapFixture | |
css::uno::Reference< css::uno::XComponentContext > | mxComponentContext |
Protected Attributes inherited from test::BootstrapFixtureBase | |
Directories | m_directories |
css::uno::Reference< css::uno::XComponentContext > | m_xContext |
css::uno::Reference< css::lang::XMultiServiceFactory > | m_xSFactory |
css::uno::Reference< css::lang::XMultiComponentFactory > | m_xFactory |
Additional Inherited Members | |
Static Public Member Functions inherited from test::BootstrapFixture | |
static sal_uInt16 | getDefaultDeviceBitCount () |
Definition at line 38 of file accessibletestbase.hxx.
|
protected |
|
inlineprotected |
Definition at line 91 of file accessibletestbase.hxx.
|
inlineprotected |
Definition at line 117 of file accessibletestbase.hxx.
|
inlineprotected |
Definition at line 127 of file accessibletestbase.hxx.
References AccessibilityTools::getAccessibleObjectForRole().
|
staticprotected |
Helper to call user code when a given dialog opens.
name | The title of the dialog window to wait for |
callback | The user code to run when the given dialog opens |
bAutoClose | Whether to automatically cancel the dialog after the user code finished, if the dialog is still there. You should leave this to true unless you know exactly what you are doing, see below. |
DialogWaiter
wrapper on which call waitEndDialog() after having triggered the dialog in some way.This function makes it fairly easy and safe to execute code once a dialog pops up:
bAutoClose
to true
. If it is set to false
, you have to take extreme care:Definition at line 393 of file accessibletestbase.cxx.
References Timer::ClearInvokeHandler(), Application::GetDialogCancelMode(), Application::GetVCLToolkit(), Task::IsActive(), LINK, msName, name, Application::SetDialogCancelMode(), Timer::SetInvokeHandler(), Task::SetPriority(), Timer::SetTimeout(), Timer::Start(), Task::Stop(), windowActivated(), windowClosed(), windowClosing(), windowDeactivated(), windowMinimized(), windowNormalized(), windowOpened(), and Application::Yield().
|
protected |
Definition at line 49 of file accessibletestbase.cxx.
Referenced by test::AccessibleTestBase::Dialog::~Dialog().
|
inlineprotected |
Definition at line 54 of file accessibletestbase.hxx.
References nType.
|
protected |
Prints the tree of accessible objects starting at xContext
to stdout.
Definition at line 155 of file accessibletestbase.cxx.
References AccessibilityTools::debugString(), AccessibilityTools::getRelationTypeName(), i, and Scheduler::ProcessEventsToIdle().
|
protectedvirtual |
Tries to list all children of an accessible.
xContext | An XAccessibleContext object |
AccessibilityTools::MAX_CHILDREN
)This fetches children of xContext
. This would ideally just be the same than iterating over children the regular way up to AccessibilityTools::MAX_CHILDREN
, but unfortunately some components (Writer, Impress, ...) do not provide all their children the regular way and require specifics to include them.
There is no guarantee on which children are returned if there are more than AccessibilityTools::MAX_CHILDREN
– yet they will always be the same in a given context.
Reimplemented in test::SwAccessibleTestBase.
Definition at line 139 of file accessibletestbase.cxx.
References i, and AccessibilityTools::MAX_CHILDREN.
Referenced by test::SwAccessibleTestBase::getAllChildren().
|
protectedvirtual |
Definition at line 97 of file accessibletestbase.cxx.
References AccessibilityTools::getAccessibleObjectForPredicate(), and xModel.
|
staticprotected |
Definition at line 112 of file accessibletestbase.cxx.
References i.
Referenced by test::SwAccessibleTestBase::getPreviousFlowingSibling().
|
inlinestaticprotected |
Definition at line 150 of file accessibletestbase.hxx.
|
staticprotected |
Gets the focused accessible object at xAcc
level or below.
xAcc | An accessible object |
nullptr
Finds the accessible object context at or under xAcc
that has the focused state (and is showing). Normally only one such object should exist in a given hierarchy, but in all cases this function will return the first one found.
|
protected |
|
inlineprotected |
Definition at line 104 of file accessibletestbase.hxx.
References name.
|
protected |
Definition at line 81 of file accessibletestbase.cxx.
|
staticprotected |
Definition at line 88 of file accessibletestbase.cxx.
|
protectedvirtual |
Definition at line 61 of file accessibletestbase.cxx.
|
protectedvirtual |
Definition at line 75 of file accessibletestbase.cxx.
|
overridevirtual |
Reimplemented from test::BootstrapFixture.
Definition at line 42 of file accessibletestbase.cxx.
References test::BootstrapFixture::mxComponentContext, mxDesktop, and test::BootstrapFixture::setUp().
|
staticprotected |
|
staticprotected |
Navigates through focusable elements using the Tab keyboard shortcut.
xRoot | The root element to look for focused elements in. |
role | The accessible role of the element to tab to. |
name | The accessible name of the element to tab to. |
pEventPosterHelper | Pointer to a EventPosterHelper instance, or nullptr to obtain it from xRoot . |
nullptr
if not found.Navigates through focusable elements in the top level containing xRoot
using the Tab keyboard key until the focused elements matches role
and name
.
Note that usually xRoot
should be the toplevel accessible, or at least contain all focusable elements within that window. It is however not a requirement, but only elements actually inside it will be candidate for a match, and thus if focus goes outside it, it might lead to not finding the target element.
If pEventPosterHelper
is nullptr
, this function will try to construct one from xRoot
.
Referenced by test::AccessibleTestBase::Dialog::tabTo().
|
overridevirtual |
Reimplemented from test::BootstrapFixtureBase.
Definition at line 59 of file accessibletestbase.cxx.
References close.
|
protected |
Definition at line 41 of file accessibletestbase.hxx.
Referenced by setUp().
|
protected |
Definition at line 42 of file accessibletestbase.hxx.
|
protected |
Definition at line 43 of file accessibletestbase.hxx.