Commit a7e32e9a authored by Akihiro Ota's avatar Akihiro Ota Committed by Commit Bot

Add ChromeVox language switching test.

This test asserts that 'button' and 'link' do not
receive a language attribute; only the contents
of these elements receive a language attribute.

Change-Id: I8a9a1d1da3256f2e963fe327a04a49872f9a9547
Bug: 923068
Reviewed-on: https://chromium-review.googlesource.com/c/1458936Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Commit-Queue: Akihiro Ota <akihiroota@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630421}
parent 95bcacf8
......@@ -66,7 +66,15 @@ ChromeVoxLanguageSwitchingTest.prototype = {
<p lang="en-gb">Spoken in GB English.</p>
<p lang="en-us">This text should also be in GB English.</p>
<p lang="en-us">So should this text.</p>
*/},
*/},
buttonAndLinkDoc: function() {/*!
<body lang="es">
<p>This is a paragraph, spoken in Spanish.</p>
<button type="submit">This is a button, spoken in Spanish.</button>
<a href="https://www.google.com">This is a link, spoken in Spanish.</a>
</body>
*/},
};
TEST_F('ChromeVoxLanguageSwitchingTest', 'MultipleLanguagesTest', function() {
......@@ -119,3 +127,20 @@ TEST_F('ChromeVoxLanguageSwitchingTest', 'DialectTest', function() {
mockFeedback.replay();
});
});
TEST_F('ChromeVoxLanguageSwitchingTest', 'ButtonAndLinkTest', function() {
var mockFeedback = this.createMockFeedback();
this.runWithLoadedTree(this.buttonAndLinkDoc, function(root) {
localStorage['languageSwitching'] = 'true';
mockFeedback.call(doCmd('jumpToTop'))
.expectSpeechWithLanguage('es', 'This is a paragraph, spoken in Spanish.')
.call(doCmd('nextObject'))
.expectSpeechWithLanguage('es', 'This is a button, spoken in Spanish.')
.expectSpeechWithLanguage(undefined, 'Button', 'Press Search+Space to activate.')
.call(doCmd('nextObject'))
.expectSpeechWithLanguage('es', 'This is a link, spoken in Spanish.')
.expectSpeechWithLanguage(undefined, 'Link');
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