From 6185a27db46bf5cba404e669eaf3a1c78f4a8607 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Sun, 31 Jul 2022 17:20:03 +0200 Subject: [PATCH] tdf#150064 Add tests for a11y tree order Check the tree order is stable across loads and page switches. Change-Id: I8850eb8b230d9193c4f2497150a44fd555030a9b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137681 Reviewed-by: Michael Weghorn Tested-by: Michael Weghorn --- sd/CppunitTest_sd_a11y.mk | 38 ++ sd/Module_sd.mk | 1 + sd/qa/unit/a11y/data/tdf150064.fodp | 796 ++++++++++++++++++++++++++++ sd/qa/unit/a11y/layout.cxx | 154 ++++++ 4 files changed, 989 insertions(+) create mode 100644 sd/CppunitTest_sd_a11y.mk create mode 100644 sd/qa/unit/a11y/data/tdf150064.fodp create mode 100644 sd/qa/unit/a11y/layout.cxx diff --git a/sd/CppunitTest_sd_a11y.mk b/sd/CppunitTest_sd_a11y.mk new file mode 100644 index 000000000000..6b0c228607e6 --- /dev/null +++ b/sd/CppunitTest_sd_a11y.mk @@ -0,0 +1,38 @@ +# -*- 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,sd_a11y)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sd_a11y, \ + sd/qa/unit/a11y/layout \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sd_a11y, \ + sal \ + cppu \ + subsequenttest \ + test \ + unotest \ + vcl \ +)) + +$(eval $(call gb_CppunitTest_use_api,sd_a11y,\ + offapi \ + udkapi \ +)) + +$(eval $(call gb_CppunitTest_use_sdk_api,sd_a11y)) +$(eval $(call gb_CppunitTest_use_rdb,sd_a11y,services)) +$(eval $(call gb_CppunitTest_use_ure,sd_a11y)) +$(eval $(call gb_CppunitTest_use_vcl,sd_a11y)) + +$(eval $(call gb_CppunitTest_use_instdir_configuration,sd_a11y)) +$(eval $(call gb_CppunitTest_use_common_configuration,sd_a11y)) + +# vim: set noet sw=4 ts=4: diff --git a/sd/Module_sd.mk b/sd/Module_sd.mk index 0ac7b5763607..38edf0d8009d 100644 --- a/sd/Module_sd.mk +++ b/sd/Module_sd.mk @@ -49,6 +49,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sd,\ CppunitTest_sd_png_export_tests \ CppunitTest_sd_filter_eppt \ CppunitTest_sd_shape_import_export_tests \ + CppunitTest_sd_a11y \ )) endif diff --git a/sd/qa/unit/a11y/data/tdf150064.fodp b/sd/qa/unit/a11y/data/tdf150064.fodp new file mode 100644 index 000000000000..6eda6b630cce --- /dev/null +++ b/sd/qa/unit/a11y/data/tdf150064.fodp @@ -0,0 +1,796 @@ + + + 2022-07-30T14:38:24.9165100222022-07-30T15:14:00.484240506PT35M43S1LibreOfficeDev/7.5.0.0.alpha0$Linux_X86_64 LibreOffice_project/6721eddbcfefd9503a49499956e53d1a76f6712f + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <number> + + + + + + + + + + P1 title + + + + + Some text + + + + + + + + + + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + + + 6 + + + 7 + + + 8 + + + 9 + + + 10 + + + + VkNMTVRGAQAxAAAAAAAAAAEAGwAAAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAACU3AACx + DwAA4QAAAIkAAQAhAAAAAQAbAAAADQAKyv//j9T//wEAAAABAAAAAQAAAAEAAAAAlgABAAIA + AAAJAIsAAQACAAAAAwCFAAEABQAAALOzswABhAABAAUAAAAAAAAAAG8AAgAuAAAAAQAFAOo1 + AABlKwAA7UAAAGUrAADtQAAANDMAAOo1AAA0MwAA6jUAAGUrAAAAAIwAAQAAAAAAAAIBACAA + AAAWAFhURVhUX1BBSU5UU0hBUEVfQkVHSU4AAAAAAAAAAIoAAQBFAAAABAA/AAAADwBMaWJl + cmF0aW9uIFNhbnMAAAAAAAB7AgAA//8AAAIABQAAAAAAAAAMBAAAAAAAAAABAP8DAAAAAAAA + AAAAiAABAAIAAAABAIcAAQAFAAAA/////wCGAAEABAAAAAAAAABxAAIAHgAAAOQ2AAAnLgAA + AQAAADEAAAABAAEAAABfAQAAAQAxAAACAQATAAAACQBYVEVYVF9FT0MAAAAAAAAAAAACAQAT + AAAACQBYVEVYVF9FT0wAAAAAAAAAAAACAQATAAAACQBYVEVYVF9FT1AAAAAAAAAAAAACAQAe + AAAAFABYVEVYVF9QQUlOVFNIQVBFX0VORAAAAAAAAAAAiwABAAIAAAADAIUAAQAFAAAAs7Oz + AAGEAAEABQAAAAAAAAAAbwACAC4AAAABAAUA7UAAAGUrAADwSwAAZSsAAPBLAAA0MwAA7UAA + ADQzAADtQAAAZSsAAAAAjAABAAAAAAAAAgEAIAAAABYAWFRFWFRfUEFJTlRTSEFQRV9CRUdJ + TgAAAAAAAAAAigABAEUA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AAA + AAA8QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgEAHQAAABMAWFBBVEhTVFJPS0VfU0VR + X0VORAAAAAAAAAAAjAABAAAAAACLAAEAAgAAAAMAhAABAAUAAAD///8AAQACAQBuAAAAFQBY + UEFUSFNUUk9LRV9TRVFfQkVHSU4AAAAATwAAAAEASQAAAAEAEwAAAAIA3DUAADQzAAALbQAA + NDMAAAABAAIAAAAAAAEAAgAAAAAAAAAAAAAAAACO4ziO4zg8QAAAAQCO4ziO4zg8QAAAAACE + AAEABQAAAP///wABhQABAAUAAAAAAAAAAG0AAwBTAAAAAgDcNQAANDMAAAttAAA0MwAABQA6 + AAAAAQAcAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAA8QAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAgEAHQAAABMAWFBBVEhTVFJPS0VfU0VRX0VORAAAAAAAAAAAjAABAAAAAACL + AAEAAgAAAAMAhAABAAUAAAD///8AAQACAQBuAAAAFQBYUEFUSFNUUk9LRV9TRVFfQkVHSU4A + AAAATwAAAAEASQAAAAEAEwAAAAIA3DUAAAQ7AAALbQAABDsAAAABAAIAAAAAAAEAAgAAAAAA + AAAAAAAAAACO4ziO4zg8QAAAAQCO4ziO4zg8QAAAAACEAAEABQAAAP///wABhQABAAUAAAAA + AAAAAG0AAwBTAAAAAgDcNQAABDsAAAttAAAEOwAABQA6AAAAAQAcAAAAAAAAAAAAAAAAAAAA + AAAAAAQAAAAAAAAAAAA8QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgEAHQAAABMAWFBB + VEhTVFJPS0VfU0VRX0VORAAAAAAAAAAAjAABAAAAAAA= + + + + + + + + + + + + + + P2 title + + + + + + + 1 + + + + + + + + + 2 + + + + + + + + + 3 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sd/qa/unit/a11y/layout.cxx b/sd/qa/unit/a11y/layout.cxx new file mode 100644 index 000000000000..9af31dff8c80 --- /dev/null +++ b/sd/qa/unit/a11y/layout.cxx @@ -0,0 +1,154 @@ +/* -*- 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/. + */ + +#include +#include +#include + +#include + +#include +#include + +using namespace css; + +CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestImpressDefaultStructure) +{ + load(u"private:factory/simpress"); + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT_EQUAL(rtl::OUString("" + "" + "" + "Click to add Title" + "" + "" + "" + "" + "Click to add Text" + "" + ""), + collectText()); +} + +// a basic check of the content order for https://bugs.documentfoundation.org/show_bug.cgi?id=150064 +CPPUNIT_TEST_FIXTURE(test::AccessibleTestBase, TestImpressDefaultLayout) +{ + load(u"private:factory/simpress"); + Scheduler::ProcessEventsToIdle(); + + auto xDocumentContext = getDocumentAccessibleContext(); + + /* The tree inside the document is a bit awkward, as the page is not the parent of the other + * shapes, but well. It looks like this: + * document_presentation + * shape (page) + * shape (title) + * paragraph + * shape (subtitle) + * paragraph + */ + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xDocumentContext->getAccessibleChildCount()); + CPPUNIT_ASSERT_EQUAL( + OUString("PresentationTitle "), + xDocumentContext->getAccessibleChild(1)->getAccessibleContext()->getAccessibleName()); + CPPUNIT_ASSERT_EQUAL( + OUString("PresentationSubtitle "), + xDocumentContext->getAccessibleChild(2)->getAccessibleContext()->getAccessibleName()); +} + +// test a11y tree order is stable (https://bugs.documentfoundation.org/show_bug.cgi?id=150064) +CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, tdf150064) +{ + loadFromSrc(u"/sd/qa/unit/a11y/data/tdf150064.fodp"); + Scheduler::ProcessEventsToIdle(); + + uno::Reference xDrawPagesSupplier(mxDocument, + uno::UNO_QUERY_THROW); + uno::Reference xModel(mxDocument, uno::UNO_QUERY_THROW); + uno::Reference xDrawView(xModel->getCurrentController(), + uno::UNO_QUERY_THROW); + + auto xDrawPages = xDrawPagesSupplier->getDrawPages(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xDrawPages->getCount()); + + // Loop a couple times to make sure output is stable when loading and when switching pages + for (int i = 0; i < 2; i++) + { + uno::Reference xDrawPage; + + CPPUNIT_ASSERT(xDrawPages->getByIndex(0) >>= xDrawPage); + xDrawView->setCurrentPage(xDrawPage); + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT_EQUAL( + rtl::OUString("" + "" + "P1 title" + "" + "" + "Some text" + "" + "" + "" + "1" + "" + "" + "2" + "" + "" + "3" + "" + "" + "4" + "" + "" + "5" + "" + "" + "6" + "" + "" + "7" + "" + "" + "8" + "" + "" + "9" + "" + "" + "10" + "" + "
"), + collectText()); + + CPPUNIT_ASSERT(xDrawPages->getByIndex(1) >>= xDrawPage); + xDrawView->setCurrentPage(xDrawPage); + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT_EQUAL( + rtl::OUString("" + "" + "P2 title" + "" + "" + "1" + "" + "" + "2" + "" + "" + "3" + ""), + collectText()); + } +} + +CPPUNIT_PLUGIN_IMPLEMENT();