diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk index a5e71210948d..70c0e83ac068 100644 --- a/qadevOOo/Jar_OOoRunner.mk +++ b/qadevOOo/Jar_OOoRunner.mk @@ -1146,7 +1146,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\ qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox \ qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox \ qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownComboBox \ - qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox \ qadevOOo/tests/java/mod/_toolkit/AccessibleEdit \ qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText \ qadevOOo/tests/java/mod/_toolkit/AccessibleList \ diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleDropDownListBox.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleDropDownListBox.csv deleted file mode 100644 index be66442c2e93..000000000000 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleDropDownListBox.csv +++ /dev/null @@ -1,27 +0,0 @@ -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleEventBroadcaster#optional";"addEventListener()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleEventBroadcaster#optional";"removeEventListener()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleComponent";"containsPoint()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleComponent";"getAccessibleAtPoint()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleComponent";"getBounds()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleComponent";"getLocation()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleComponent";"getLocationOnScreen()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleComponent";"getSize()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleComponent";"grabFocus()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleComponent";"getForeground()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleComponent";"getBackground()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleAction";"getAccessibleActionCount()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleAction";"doAccessibleAction()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleAction";"getAccessibleActionDescription()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleAction";"getAccessibleActionKeyBinding()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleContext";"getAccessibleChildCount()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleContext";"getAccessibleChild()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleContext";"getAccessibleParent()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleContext";"getAccessibleIndexInParent()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleContext";"getAccessibleRole()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleContext";"getAccessibleDescription()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleContext";"getAccessibleName()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleContext";"getAccessibleRelationSet()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleContext";"getAccessibleStateSet()" -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleContext";"getLocale()" diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java deleted file mode 100644 index 7adcc1c2ede3..000000000000 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -package mod._toolkit; - -import com.sun.star.accessibility.AccessibleRole; -import com.sun.star.accessibility.XAccessible; -import com.sun.star.accessibility.XAccessibleAction; -import com.sun.star.awt.XWindow; -import com.sun.star.text.XTextDocument; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; - -import java.io.PrintWriter; - -import lib.StatusException; -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; - -import util.AccessibilityTools; -import util.DesktopTools; -import util.SOfficeFactory; -import util.utils; - - -/** - * Test for object which is represented by style list box - * on toolbar of a document.

- * - * Object implements the following interfaces : - *

- * - * @see com.sun.star.accessibility.XAccessibleExtendedComponent - * @see com.sun.star.accessibility.XAccessibleEventBroadcaster - * @see com.sun.star.accessibility.XAccessibleComponent - * @see com.sun.star.accessibility.XAccessibleAction - * @see com.sun.star.accessibility.XAccessibleContext - * @see ifc.accessibility._XAccessibleExtendedComponent - * @see ifc.accessibility._XAccessibleEventBroadcaster - * @see ifc.accessibility._XAccessibleComponent - * @see ifc.accessibility._XAccessibleAction - * @see ifc.accessibility._XAccessibleContext - */ -public class AccessibleDropDownListBox extends TestCase { - private static XTextDocument xTextDoc = null; - /** - * Finds AccessibleDropDownListBox walking through the - * accessible component tree of a writer document. - */ - @Override - protected TestEnvironment createTestEnvironment(TestParameters Param, - PrintWriter log) { - XInterface oObj = null; - - util.utils.waitForEventIdle(Param.getMSF()); - - XWindow xWindow = AccessibilityTools.getCurrentWindow( - xTextDoc); - - XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); - - AccessibilityTools.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE)); - - oObj = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.COMBO_BOX, - "", "AccessibleDropDownListBox"); - - log.println("ImplementationName " + utils.getImplName(oObj)); - - TestEnvironment tEnv = new TestEnvironment(oObj); - - final XAccessibleAction acomp = UnoRuntime.queryInterface( - XAccessibleAction.class, oObj); - tEnv.addObjRelation("EventProducer", - new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { - public void fireEvent() { - try { - acomp.doAccessibleAction(0); - } catch (com.sun.star.lang.IndexOutOfBoundsException e) { - throw new StatusException("Can't perform action 0", e); - } - } - }); - - return tEnv; - } - - /** - * Creates writer document. - */ - @Override - protected void initialize(TestParameters Param, PrintWriter log) throws Exception { - SOfficeFactory SOF = SOfficeFactory.getFactory( - Param.getMSF()); - // Dock the Navigator to supply an AccessibleDropDownListBox - DesktopTools.dockNavigator(Param.getMSF()); - xTextDoc = SOF.createTextDoc(null); - } - - /** - * Disposes writer document. - */ - @Override - protected void cleanup(TestParameters Param, PrintWriter log) { - util.DesktopTools.closeDoc(xTextDoc); - } -} diff --git a/toolkit/qa/unoapi/toolkit_1.sce b/toolkit/qa/unoapi/toolkit_1.sce index 3cee05dc3e37..b3cb02981c51 100644 --- a/toolkit/qa/unoapi/toolkit_1.sce +++ b/toolkit/qa/unoapi/toolkit_1.sce @@ -20,7 +20,6 @@ #i88332 -o toolkit.AccessibleCheckBox #i86008 -o toolkit.AccessibleComboBox -o toolkit.AccessibleDropDownComboBox --o toolkit.AccessibleDropDownListBox #i86110 -o toolkit.AccessibleEdit -o toolkit.AccessibleFixedText #i86110 -o toolkit.AccessibleList diff --git a/vcl/CppunitTest_vcl_a11y.mk b/vcl/CppunitTest_vcl_a11y.mk new file mode 100644 index 000000000000..84a86eeef637 --- /dev/null +++ b/vcl/CppunitTest_vcl_a11y.mk @@ -0,0 +1,37 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_CppunitTest_CppunitTest,vcl_a11y)) + +$(eval $(call gb_CppunitTest_add_exception_objects,vcl_a11y, \ + vcl/qa/cppunit/a11y/widgetaccessibilitytest \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,vcl_a11y, \ + sal \ + cppu \ + subsequenttest \ + test \ + vcl \ +)) + +$(eval $(call gb_CppunitTest_use_api,vcl_a11y,\ + offapi \ + udkapi \ +)) + +$(eval $(call gb_CppunitTest_use_sdk_api,vcl_a11y)) +$(eval $(call gb_CppunitTest_use_rdb,vcl_a11y,services)) +$(eval $(call gb_CppunitTest_use_ure,vcl_a11y)) +$(eval $(call gb_CppunitTest_use_vcl,vcl_a11y)) + +$(eval $(call gb_CppunitTest_use_instdir_configuration,vcl_a11y)) +$(eval $(call gb_CppunitTest_use_common_configuration,vcl_a11y)) + +# vim: set noet sw=4 ts=4: diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk index 91cf27c98267..cc22693cf512 100644 --- a/vcl/Module_vcl.mk +++ b/vcl/Module_vcl.mk @@ -85,6 +85,7 @@ $(eval $(call gb_Module_add_targets,vcl,\ ifneq ($(ENABLE_ATSPI_TESTS),) $(eval $(call gb_Module_add_check_targets,vcl,\ + CppunitTest_vcl_a11y \ CppunitTest_vcl_gtk3_a11y \ )) endif diff --git a/vcl/qa/cppunit/a11y/widgetaccessibilitytest.cxx b/vcl/qa/cppunit/a11y/widgetaccessibilitytest.cxx new file mode 100644 index 000000000000..41fcf5b46f25 --- /dev/null +++ b/vcl/qa/cppunit/a11y/widgetaccessibilitytest.cxx @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#define VCL_INTERNALS + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +CPPUNIT_TEST_FIXTURE(test::AccessibleTestBase, AccessibleDropDownListBox) +{ + // create and show dialog that contains a dropdown listbox + ScopedVclPtr<::Dialog> pDialog = VclPtr<::Dialog>::Create(nullptr, WB_MOVEABLE | WB_CLOSEABLE, + ::Dialog::InitFlag::NoParent); + VclPtr pListBox = VclPtr::Create(pDialog, WB_DROPDOWN); + pListBox->InsertEntry(u"First Entry"_ustr); + pListBox->InsertEntry(u"Second Entry"_ustr); + pListBox->SetSizePixel(pListBox->get_preferred_size()); + pListBox->Show(); + pDialog->Show(); + + // perform various a11y checks on the dropdown listbox + css::uno::Reference xListBoxAcc = pListBox->GetAccessible(); + CPPUNIT_ASSERT(xListBoxAcc.is()); + css::uno::Reference xContext + = xListBoxAcc->getAccessibleContext(); + CPPUNIT_ASSERT(xContext.is()); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Drop down listbox has incorrect role", + css::accessibility::AccessibleRole::COMBO_BOX, + xContext->getAccessibleRole()); + + XAccessibleContextTester aContextTester(xContext); + aContextTester.testAll(); + + css::uno::Reference xAccessibleComponent( + xContext, css::uno::UNO_QUERY_THROW); + XAccessibleComponentTester aComponentTester(xAccessibleComponent); + aComponentTester.testAll(); + + css::uno::Reference + xAccessibleExtendedComponent(xContext, css::uno::UNO_QUERY_THROW); + XAccessibleExtendedComponentTester aExtendedComponentTester(xAccessibleExtendedComponent); + aExtendedComponentTester.testAll(); + + css::uno::Reference xAccessibleAction( + xContext, css::uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_MESSAGE("No accessible action provided", + xAccessibleAction->getAccessibleActionCount() > 0); + XAccessibleActionTester aActionTester(xAccessibleAction); + aActionTester.testAll(); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */