Commit 2b775e7b authored by David Tseng's avatar David Tseng Committed by Commit Bot

Make KioskTest.SpokenFeedback more robust

This change makes the test robust to changes in when and where the heading for the test app appears

R=rsorokin@chromium.org

chromium-review.googlesource.com/2123310

Bug: 1085004,1083186
Test: run the test with the pending changes
Change-Id: I9e6a85dd321bde4d39e3ecb3525866820ff1a8e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2219175Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Reviewed-by: default avatarJacques Newman <janewman@microsoft.com>
Commit-Queue: David Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773143}
parent 9f737510
...@@ -1489,10 +1489,25 @@ IN_PROC_BROWSER_TEST_F(KioskTest, SpokenFeedback) { ...@@ -1489,10 +1489,25 @@ IN_PROC_BROWSER_TEST_F(KioskTest, SpokenFeedback) {
extensions::browsertest_util::ExecuteScriptInBackgroundPageNoWait( extensions::browsertest_util::ExecuteScriptInBackgroundPageNoWait(
AccessibilityManager::Get()->profile(), AccessibilityManager::Get()->profile(),
extension_misc::kChromeVoxExtensionId, extension_misc::kChromeVoxExtensionId,
R"(CommandHandler.onCommand('nextObject'); R"(
CommandHandler.onCommand('showOptionsPage'); chrome.automation.getDesktop(d => {
if (CommandHandler.isKioskSession_) function waitForHeadingThenTest() {
ChromeVox.tts.speak('done');)"); const heading =
d.find({role: chrome.automation.RoleType.HEADING});
if (!heading) {
setTimeout(waitForHeadingThenTest, 50);
return;
}
ChromeVoxState.instance.navigateToRange(
cursors.Range.fromNode(heading));
CommandHandler.onCommand('showOptionsPage');
if (CommandHandler.isKioskSession_) {
ChromeVox.tts.speak('done');
}
}
waitForHeadingThenTest();
});
)");
}); });
sm.ExpectSpeech("Test Kiosk App 3 exclamations"); sm.ExpectSpeech("Test Kiosk App 3 exclamations");
sm.ExpectSpeech("Heading 1"); sm.ExpectSpeech("Heading 1");
......
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