Commit 49084bde authored by Akihiro Ota's avatar Akihiro Ota Committed by Commit Bot

ChromeVox Exit Tutorial Test

This change adds a test that confirms the behavior of the
'Exit tutorial' button in the interactive tutorial. Clicking this
button should close the tutorial and return ChromeVox to the web
content.

Bug: 1127047
Change-Id: I12e348fed7e01cc73b54e204cc9447a95b73e86d
AX-Relnotes: N/A
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2416818
Commit-Queue: Akihiro Ota <akihiroota@chromium.org>
Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810012}
parent f2b4b596
...@@ -92,7 +92,7 @@ ChromeVoxTutorialTest = class extends ChromeVoxNextE2ETest { ...@@ -92,7 +92,7 @@ ChromeVoxTutorialTest = class extends ChromeVoxNextE2ETest {
get simpleDoc() { get simpleDoc() {
return ` return `
<p>Simple</p> <p>Some web content</p>
`; `;
} }
}; };
...@@ -265,4 +265,44 @@ TEST_F('ChromeVoxTutorialTest', 'PracticeAreaNudgesTest', function() { ...@@ -265,4 +265,44 @@ TEST_F('ChromeVoxTutorialTest', 'PracticeAreaNudgesTest', function() {
.expectSpeech('Press Search + Space to activate the current item.') .expectSpeech('Press Search + Space to activate the current item.')
.replay(); .replay();
}); });
}); });
\ No newline at end of file
// Tests that the tutorial closes when the 'Exit tutorial' button is clicked.
TEST_F('ChromeVoxTutorialTest', 'ExitButtonTest', function() {
const mockFeedback = this.createMockFeedback();
this.runWithLoadedTree(this.simpleDoc, async function(root) {
const Panel = this.getPanel();
assertTrue(Panel.iTutorialEnabled_);
new PanelCommand(PanelCommandType.TUTORIAL).send();
await this.waitForTutorial();
mockFeedback.expectSpeech('Choose your tutorial experience')
.call(doCmd('previousButton'))
.expectSpeech('Exit tutorial')
.call(doCmd('forceClickOnCurrentItem'))
.expectSpeech('Some web content')
.replay();
});
});
// Tests that the tutorial closes when Escape is pressed.
TEST_F('ChromeVoxTutorialTest', 'EscapeTest', function() {
const mockFeedback = this.createMockFeedback();
this.runWithLoadedTree(this.simpleDoc, async function(root) {
const Panel = this.getPanel();
assertTrue(Panel.iTutorialEnabled_);
new PanelCommand(PanelCommandType.TUTORIAL).send();
await this.waitForTutorial();
const tutorial = Panel.iTutorial;
mockFeedback.expectSpeech('Choose your tutorial experience')
.call(() => {
// Press Escape.
tutorial.onKeyDown({
key: 'Escape',
preventDefault: () => {},
stopPropagation: () => {}
});
})
.expectSpeech('Some web content')
.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