cthulhu/test/keystrokes/firefox/html_struct_nav_large_obj.py
2024-12-18 10:05:44 -05:00

261 lines
11 KiB
Python

#!/usr/bin/env python3
#
# Copyright (c) 2024 Stormux
# Copyright (c) 2010-2012 The Orca Team
# Copyright (c) 2012 Igalia, S.L.
# Copyright (c) 2005-2010 Sun Microsystems Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
# Boston MA 02110-1301 USA.
#
# Fork of Orca Screen Reader (GNOME)
# Original source: https://gitlab.gnome.org/GNOME/orca
"""Test of structural navigation amongst 'large objects'."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
#sequence.append(WaitForDocLoad())
sequence.append(PauseAction(5000))
sequence.append(KeyComboAction("<Control>Home"))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("o"))
sequence.append(utils.AssertPresentationAction(
"1. o to first large chunk",
["BRAILLE LINE: 'I have of late but",
"wherefore I know not lost all my mirth,",
"forgone all custom of exercises;",
"and indeed, it goes so heavily with",
"my disposition that this goodly frame,",
"the earth, seems to me a sterile promontory;",
"this most excellent canopy, the air, look you,",
"this brave o'erhanging firmament,",
"this majestical roof fretted with golden fire",
"why, it appeareth no other thing to me than a foul",
"and pestilent congregation of vapours.",
"What a piece of work is a man!",
"how noble in reason! how infinite in faculties!",
"in form and moving how express and admirable!",
"in action how like an angel!",
"in apprehension how like a god!",
"the beauty of the world, the paragon of animals!'",
" VISIBLE: 'I have of late but",
"wherefore I k', cursor=1",
"SPEECH OUTPUT: 'I have of late but",
"wherefore I know not lost all my mirth,",
"forgone all custom of exercises;",
"and indeed, it goes so heavily with",
"my disposition that this goodly frame,",
"the earth, seems to me a sterile promontory;",
"this most excellent canopy, the air, look you,",
"this brave o'erhanging firmament,",
"this majestical roof fretted with golden fire",
"why, it appeareth no other thing to me than a foul",
"and pestilent congregation of vapours.",
"What a piece of work is a man!",
"how noble in reason! how infinite in faculties!",
"in form and moving how express and admirable!",
"in action how like an angel!",
"in apprehension how like a god!",
"the beauty of the world, the paragon of animals!'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("o"))
sequence.append(utils.AssertPresentationAction(
"2. o to second large chunk",
["BRAILLE LINE: 'I have of late but",
"wherefore I know not lost all my mirth,",
"forgone all custom of exercises;",
"and indeed, it goes so heavily with",
"my disposition that this goodly frame,",
"the earth, seems to me a sterile promontory;",
"this most excellent canopy, the air, look you,",
"this brave o'erhanging firmament,",
"this majestical roof fretted with golden fire",
"why, it appeareth no other thing to me than a foul",
"and pestilent congregation of vapours.",
"What a piece of work is a man!",
"how noble in reason! how infinite in faculties!",
"in form and moving how express and admirable!",
"in action how like an angel!",
"in apprehension how like a god!",
"the beauty of the world, the paragon of animals!'",
" VISIBLE: 'I have of late but",
"wherefore I k', cursor=1",
"SPEECH OUTPUT: 'I have of late but",
"wherefore I know not lost all my mirth,",
"forgone all custom of exercises;",
"and indeed, it goes so heavily with",
"my disposition that this goodly frame,",
"the earth, seems to me a sterile promontory;",
"this most excellent canopy, the air, look you,",
"this brave o'erhanging firmament,",
"this majestical roof fretted with golden fire",
"why, it appeareth no other thing to me than a foul",
"and pestilent congregation of vapours.",
"What a piece of work is a man!",
"how noble in reason! how infinite in faculties!",
"in form and moving how express and admirable!",
"in action how like an angel!",
"in apprehension how like a god!",
"the beauty of the world, the paragon of animals!'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("o"))
sequence.append(utils.AssertPresentationAction(
"3. o to third large chunk",
["BRAILLE LINE: 'I have of late but",
"wherefore I know not lost all my mirth,",
"forgone all custom of exercises;",
"and indeed, it goes so heavily with",
"my disposition that this goodly frame,",
"the earth, seems to me a sterile promontory;",
"this most excellent canopy, the air, look you,",
"this brave o'erhanging firmament,",
"this majestical roof fretted with golden fire",
"why, it appeareth no other thing to me than a foul",
"and pestilent congregation of vapours.",
"What a piece of work is a man!",
"how noble in reason! how infinite in faculties!",
"in form and moving how express and admirable!",
"in action how like an angel!",
"in apprehension how like a god!",
"the beauty of the world, the paragon of animals!'",
" VISIBLE: 'I have of late but",
"wherefore I k', cursor=1",
"SPEECH OUTPUT: 'I have of late but",
"wherefore I know not lost all my mirth,",
"forgone all custom of exercises;",
"and indeed, it goes so heavily with",
"my disposition that this goodly frame,",
"the earth, seems to me a sterile promontory;",
"this most excellent canopy, the air, look you,",
"this brave o'erhanging firmament,",
"this majestical roof fretted with golden fire",
"why, it appeareth no other thing to me than a foul",
"and pestilent congregation of vapours.",
"What a piece of work is a man!",
"how noble in reason! how infinite in faculties!",
"in form and moving how express and admirable!",
"in action how like an angel!",
"in apprehension how like a god!",
"the beauty of the world, the paragon of animals!'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("o"))
sequence.append(utils.AssertPresentationAction(
"4. o to fourth large chunk",
["BRAILLE LINE: 'I am a tranquilizer. ",
"I am effective at home, ",
"I work well at the office, ",
"I take exams, ",
"I appear in court, ",
"I carefully mend broken crockery - ",
"all you need do is take me, ",
"dissolve me under the tongue, ",
"all you need do is swallow me, ",
"just wash me down with water. I know how to cope with misfortune, ",
"how to endure bad news, ",
"take the edge of injustice, ",
"make up for the absence of God, ",
"help pick out your widow's weeds. ",
"What are you waiting for - ",
"have faith in chemistry's compassion. You're still a young man/woman, ",
"you really should settle down somehow. ",
"Who said ",
"life must be lived courageously? Hand your abyss over to me - ",
"I will line it up with soft sleep, ",
"you'll be grateful for ",
"the four-footed landing. Sell me your soul. ",
"There's no other buyer likely to turn up.'",
" VISIBLE: 'I am a tranquilizer. ",
"I am effec', cursor=1",
"SPEECH OUTPUT: 'block quote.'",
"SPEECH OUTPUT: 'I am a tranquilizer. ",
"I am effective at home, ",
"I work well at the office, ",
"I take exams, ",
"I appear in court, ",
"I carefully mend broken crockery - ",
"all you need do is take me, ",
"dissolve me under the tongue, ",
"all you need do is swallow me, ",
"just wash me down with water.'",
"SPEECH OUTPUT: 'I know how to cope with misfortune, ",
"how to endure bad news, ",
"take the edge of injustice, ",
"make up for the absence of God, ",
"help pick out your widow's weeds. ",
"What are you waiting for - ",
"have faith in chemistry's compassion.'",
"SPEECH OUTPUT: 'You're still a young man/woman, ",
"you really should settle down somehow. ",
"Who said ",
"life must be lived courageously?'",
"SPEECH OUTPUT: 'Hand your abyss over to me - ",
"I will line it up with soft sleep, ",
"you'll be grateful for ",
"the four-footed landing.'",
"SPEECH OUTPUT: 'Sell me your soul. ",
"There's no other buyer likely to turn up.'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("<Shift>o"))
sequence.append(utils.AssertPresentationAction(
"5. Shift + o to third large chunk",
["BRAILLE LINE: 'I have of late but",
"wherefore I know not lost all my mirth,",
"forgone all custom of exercises;",
"and indeed, it goes so heavily with",
"my disposition that this goodly frame,",
"the earth, seems to me a sterile promontory;",
"this most excellent canopy, the air, look you,",
"this brave o'erhanging firmament,",
"this majestical roof fretted with golden fire",
"why, it appeareth no other thing to me than a foul",
"and pestilent congregation of vapours.",
"What a piece of work is a man!",
"how noble in reason! how infinite in faculties!",
"in form and moving how express and admirable!",
"in action how like an angel!",
"in apprehension how like a god!",
"the beauty of the world, the paragon of animals!'",
" VISIBLE: 'I have of late but",
"wherefore I k', cursor=1",
"SPEECH OUTPUT: 'I have of late but",
"wherefore I know not lost all my mirth,",
"forgone all custom of exercises;",
"and indeed, it goes so heavily with",
"my disposition that this goodly frame,",
"the earth, seems to me a sterile promontory;",
"this most excellent canopy, the air, look you,",
"this brave o'erhanging firmament,",
"this majestical roof fretted with golden fire",
"why, it appeareth no other thing to me than a foul",
"and pestilent congregation of vapours.",
"What a piece of work is a man!",
"how noble in reason! how infinite in faculties!",
"in form and moving how express and admirable!",
"in action how like an angel!",
"in apprehension how like a god!",
"the beauty of the world, the paragon of animals!'"]))
sequence.append(utils.AssertionSummaryAction())
sequence.start()