terminal/src/interactivity/win32
Carlos Zamora c53fe1c2bf
Fix failing UIA movement tests (#10991)
## Summary of the Pull Request
Follow-up for #10886. The new UIA movement tests found some failing cases. This PR fixes UiaTextRangeBase to have movement match that of MS Word. In total, this fixes 64 tests.

## PR Checklist
* [X] Closes #10924
* [X] Tests added/passed

## Detailed Description of the Pull Request / Additional comments
Root causes include...
1. if we were a non-degenerate range and we failed to move, we should still expand to enclose the unit
2. non-degenerate ranges are treated as if they already encompassed their given unit.
   - this one is a bit difficult to explain. Consider these examples:
      1. document movement
         - state: you have a 1-cell wide range on the buffer, and you try to move by document
         - result: move by 0 (there is no next/prev document), but the range now encompasses the entire document
      2. line movement
         - state: you have a 1-cell wide range on a line, and you try to move back by a line
         - result: you go to the previous line (not the beginning of this line)
   - conversely, a degenerate range successfully moves to the beginning/end of the current unit (i.e. document/line)
   - this (bizarre) behavior was confirmed using MS Word

As a bonus, occasionally, Narrator would get stuck when navigating by line. This issue now seems to be fixed.

## Updates to existing tests
- `CanMoveByCharacter`
   - `can't move backward from (0, 0)` --> misauthored, result should be one character wide.
   - `can't move past the last column in the last row` --> misauthored and already covered in generated tests
- `CanMoveByLine`
   - `can't move backward from top row` --> misauthored, end should be on next line. Already covered by generated tests
   - `can't move forward from bottom row` --> misauthored, end should be on next line
   - `can't move backward when part of the top row is in the range` --> misauthored, should expand
   - `can't move forward when part of the bottom row is in the range` --> misauthored, degenerate range moves to end of buffer
- `MovementAtExclusiveEnd`
   - populate the text buffer _before_ we do a move by word operation
   - update to match the now fixed behavior
2021-08-24 13:56:38 +00:00
..
lib InteractivityWin32: Add a dependency on Dx (#5851) 2020-05-11 15:09:14 -07:00
ut_interactivity_win32 Fix failing UIA movement tests (#10991) 2021-08-24 13:56:38 +00:00
AccessibilityNotifier.cpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
AccessibilityNotifier.hpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
Clipboard.cpp PICK: Move CharToKeyEvents into InteractivityBase (GH-9106) 2021-02-10 17:13:00 -08:00
clipboard.hpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
coninteractivitywin32.rcv Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
ConsoleControl.cpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
ConsoleControl.hpp Persist inbox conhost; delegate control activities to it via a pipe (#10415) 2021-06-16 19:23:37 +00:00
ConsoleInputThread.cpp Add names to threads to make debugging a slight bit easier (#9801) 2021-04-14 10:56:52 +00:00
ConsoleInputThread.hpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
consoleKeyInfo.cpp Change NULL to nullptr since they are pointers (#4960) 2020-03-20 20:35:12 +00:00
consoleKeyInfo.hpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
CustomWindowMessages.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
dirs Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
find.cpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
find.h Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
icon.cpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
icon.hpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
InputServices.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
InputServices.hpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
menu.cpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
menu.hpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
precomp.cpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
precomp.h Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
res.rc Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
resource.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
screenInfoUiaProvider.cpp Tie up some A11y loose threads (#6417) 2020-06-10 15:15:26 +00:00
screenInfoUiaProvider.hpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
sources.inc Merged PR 6176782: [Git2Git] Get rid of dead build macros/#defines FE_IME, W32_SB, etc. 2021-06-21 10:50:52 -07:00
SystemConfigurationProvider.cpp Initialize stack variables. check return code from shell lnk loading (#8712) 2021-01-06 12:03:45 +00:00
SystemConfigurationProvider.hpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
uiaTextRange.cpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
uiaTextRange.hpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
window.cpp Fix conhost UseDx mode (#10770) 2021-07-23 20:19:07 +02:00
window.hpp Fix restore window position when exiting fullscreen (#9737) 2021-04-13 16:33:00 +00:00
windowdpiapi.cpp Merged PR 5421982: Reflect OS build changes 2020-11-19 23:21:37 +00:00
windowdpiapi.hpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
WindowIme.cpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
windowime.hpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
windowio.cpp Fix the xterm and SGR mouse encodings for CTRL, ALT, SHIFT (#8379) 2020-11-30 03:45:53 +00:00
windowio.hpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
WindowMetrics.cpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
WindowMetrics.hpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
windowproc.cpp Fix building with v143 toolchain (#10727) 2021-07-20 19:00:49 +02:00
windowUiaProvider.cpp Tie up some A11y loose threads (#6417) 2020-06-10 15:15:26 +00:00
windowUiaProvider.hpp Replace std::map with std::unordered_map (#6640) 2020-06-23 20:49:07 +00:00