Fix several issues in speech manager#11245
Merged
Merged
Conversation
Adds a speechManager test harness
Improve repr for cancellable speech command Include devInfo for _CancellableSpeechCommand
Broken in "Fix double speaking error"
Speech is valid if ancestor of current focus. Only ask speechManager to remove cancelled speech after the isValidDeps are updated, specifically lastQueuedFocusObject
Contributor
Author
|
Note: Most of the unit tests use the speechManager class (and it’s current behavior) as an “oracle” to define the expected result. They probably don't need careful review. They will help us preserve the existing behavior and only alter it with purpose. |
lukaszgo1
reviewed
Jun 10, 2020
lukaszgo1
reviewed
Jun 10, 2020
lukaszgo1
reviewed
Jun 10, 2020
Contributor
Author
|
Thanks @lukaszgo1, I have fixed those typos. If anyone wishes to test this build here is a link to the PR build on appveyor |
Contributor
Author
|
Since this is blocking the release, and the changes to the speech manager are fairly minor (the majority of the changes are added unit tests) I will go ahead and merge this. I will address further review actions in a subsequent PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please note, this is a large change, though most of the changes are unit tests. I have tried structure the commits in a logical order and keep changes separate. Please consider looking at the commits first to get an overview of the changes. The tests and extra debug logging is added first and the bugs are then fixed.
Note that this is blocking the 2020.2 release.
Link to issue number:
fixes #11132 - Say-all repeats some lines
fixes #11144 - Attempt to cancel speech for expired focus events: dialog title discarded when finding text in browse mode
Summary of the issue:
For #11132 - Say-all repeats some lines:
During say-all, after hitting an index,
speechManager._handleIndexcalls back tosayallHandlerresults in callingspeechManager.speakand thus_pushNextSpeech,speechManager._handleIndexthen goes on to call_pushNextSpeechitself.For #11144 - Attempt to cancel speech for expired focus events: dialog title discarded when finding text in browse mode:
Titles were being dropped because they once had focus but when focus moves to the active control (automatically) they are considered previous focus and cancelled. In addition to this, removing cancelled speech was happening before all dependencies of the
isValidcallback were updated.Wrapped indexes
During investigation I noticed that indexes were being compared naively, despite the fact that they are wrapped at a value of 10000. The indexes are not reset, it is feasible that this limit could be hit within a day and would cause some weird results.
Description of how this pull request fixes the issue:
This PR adds a lot of unit tests:
To support the unit tests, which could become hard to read and understand very quickly, a specific test harness was developed. There are a number of outputs to monitor, and it is useful to be able to assert the pre/post conditions for each step. To achieve this the test harness uses a context manager (see unit.test_speechManager.speechManagerTestHarness.SpeechManagerInteractions.expectation) which allows several post conditions to be added during the scope of a
withblock. These conditions are saved and used as the preconditions for the nextwithblock.Testing performed:
Known issues with pull request:
None.
Change log entry:
None