@@ -1652,3 +1652,78 @@ def test_focusTargetReporting():
16521652 ]),
16531653 message = "focus mode - focus with Report Articles enabled"
16541654 )
1655+
1656+
1657+ def test_focus_mode_on_focusable_read_only_lists ():
1658+ """
1659+ If a list is read-only, but is focusable, and a list element receives focus, switch to focus mode.
1660+ """
1661+ _chrome .prepareChrome (
1662+ """
1663+ <a href="#">before Target</a>
1664+ <div role="list" aria-label="Messages" tabindex="-1">
1665+ <div role="listitem" tabindex="0" aria-label="Todd Kloots Hello all. At 1:30 PM">
1666+ <div role="document" aria-roledescription="message">
1667+ <a href="/kloots" class="sender">Todd Kloots</a> <a href="/time" class="time">1:30 PM</a>
1668+ <p>Hello all.</p>
1669+ </div>
1670+ </div>
1671+ </div>
1672+ """
1673+ )
1674+ # Set focus
1675+ actualSpeech = _chrome .getSpeechAfterKey ("tab" )
1676+ _asserts .strings_match (
1677+ actualSpeech ,
1678+ SPEECH_SEP .join ([
1679+ "before Target" ,
1680+ "link" ,
1681+ ])
1682+ )
1683+
1684+ # focus the list item
1685+ actualSpeech = _chrome .getSpeechAfterKey ("tab" )
1686+ _asserts .strings_match (
1687+ actualSpeech ,
1688+ SPEECH_CALL_SEP .join ([
1689+ SPEECH_SEP .join ([
1690+ "messages" , # name for list container
1691+ "list" , # role for list container
1692+ ]),
1693+ SPEECH_SEP .join ([
1694+ "Todd Kloots Hello all.At 1:30 PM" , # list element name, should read first
1695+ "1 of 1" , # item count, no role expected here
1696+ ]),
1697+ "Focus mode" , # Focus mode should be enabled automatically and be indicated
1698+ ]),
1699+ message = "focus mode - focus list item and turn on focus mode"
1700+ )
1701+
1702+ # Tab into the document, which should turn on browse mode
1703+ actualSpeech = _chrome .getSpeechAfterKey ("tab" )
1704+ _asserts .strings_match (
1705+ actualSpeech ,
1706+ SPEECH_CALL_SEP .join ([
1707+ "message" , # role description for document container
1708+ SPEECH_SEP .join ([
1709+ "Todd Kloots" , # name for link
1710+ "link" , # role for link
1711+ ]),
1712+ "Browse mode" , # Focus mode should be disabled automatically and be indicated
1713+ ]),
1714+ message = "focus mode - focus link in document and turn off focus mode"
1715+ )
1716+
1717+ # shift+tab back to the focusable list item
1718+ actualSpeech = _chrome .getSpeechAfterKey ("shift+tab" )
1719+ _asserts .strings_match (
1720+ actualSpeech ,
1721+ SPEECH_CALL_SEP .join ([
1722+ SPEECH_SEP .join ([
1723+ "Todd Kloots Hello all. At 1:30 PM" , # list element name, should read first
1724+ "1 of 1" , # item count, no role expected here
1725+ ]),
1726+ "Focus mode" , # Focus mode should be enabled automatically and be indicated
1727+ ]),
1728+ message = "focus mode - focus list item and turn on focus mode"
1729+ )
0 commit comments