Commit 58fefab5 authored by Hiroki Sato's avatar Hiroki Sato Committed by Commit Bot

Fix ChromeVoxBackgroundTest.NoFocusTalkBackEnabled

Without this change, ChromeVoxBackgroundTest.NoFocusTalkBackEnabled was
passing regardless of TalkBack toggled status. This is because
MockFeedback runs all of the callbacks when replay() is called, and
when utteranceInQueue is called in the test, any action has not been
invoked yet.

This change moves the utterance check after executing replay().

AX-Relnotes: n/a.
Bug: none.
Test: ChromeVoxBackgroundTest.NoFocusTalkBackEnabled, fails if TalkBack is disabled, and passes if TalkBack is enabled.
Change-Id: Ide42b8811a7cb91d82d7dfb242ae318c4cf0c760
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2362488
Commit-Queue: Hiroki Sato <hirokisato@chromium.org>
Reviewed-by: default avatarAkihiro Ota <akihiroota@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799465}
parent 9006090c
......@@ -2389,14 +2389,16 @@ TEST_F('ChromeVoxBackgroundTest', 'NoFocusTalkBackEnabled', function() {
const mockFeedback = this.createMockFeedback();
this.runWithLoadedTree('<p>Start here</p>', function() {
ChromeVoxState.instance.setCurrentRange(null);
mockFeedback.call(doCmd('nextObject'));
assertFalse(mockFeedback.utteranceInQueue(
'No current ChromeVox focus. ' +
'Press Alt+Shift+L to go to the launcher.'));
mockFeedback.call(doCmd('previousObject'));
assertFalse(mockFeedback.utteranceInQueue(
'No current ChromeVox focus. ' +
'Press Alt+Shift+L to go to the launcher.'));
mockFeedback.call(doCmd('nextObject'))
.call(
() => assertFalse(mockFeedback.utteranceInQueue(
'No current ChromeVox focus. ' +
'Press Alt+Shift+L to go to the launcher.')))
.call(doCmd('previousObject'))
.call(
() => assertFalse(mockFeedback.utteranceInQueue(
'No current ChromeVox focus. ' +
'Press Alt+Shift+L to go to the launcher.')));
mockFeedback.replay();
});
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment