Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5852)

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs

Issue 637223006: Initial support for Ranges over automation nodes (used to track ChromeVox focus). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add tests for range. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
index 74f4125241348e73040e1237b6533d2128054689..c847e03f7f7a1564da19a4d18945267e621bab77 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
@@ -71,3 +71,53 @@ TEST_F('BackgroundTest', 'InitialFeedback', function() {
cvox.ChromeVox.tts.expectSpeech('end', testDone);
}.bind(this));
});
+
+/** Tests consistency of navigating forward and backward. */
+TEST_F('BackgroundTest', 'ForwardBackwardNavigation', function() {
+ this.runWithDocument(function() {/*!
+ <p>start</p>
+ <a href='#a'>alpha</a>
+ <a href='#b'>beta</a>
+ <p>
+ <h1>charlie</h1>
+ <a href='foo'>delta</a>
+ </p>
+ <a href='#bar'>echo</a>
+ <h2>foxtraut</h2>
+ <p>end<span>of test</span></p>
+ */},
+ function() {
+ var doCmd = function(cmd) {
+ return function() {
+ global.backgroundObj.onGotCommand(cmd);
+ };
+ };
+
+ var expectAfter =
+ cvox.ChromeVox.tts.expectSpeechAfter.bind(cvox.ChromeVox.tts);
+
+ cvox.ChromeVox.tts.expectSpeech('start');
+ expectAfter('alpha', doCmd('nextLink'));
+ expectAfter('beta', doCmd('nextLink'));
+ expectAfter('delta', doCmd('nextLink'));
+ expectAfter('beta', doCmd('previousLink'));
+
+ expectAfter('charlie', doCmd('nextHeading'));
+ expectAfter('foxtraut', doCmd('nextHeading'));
+ expectAfter('charlie', doCmd('previousHeading'));
+
+ expectAfter('delta', doCmd('nextElement'));
+ expectAfter('echo', doCmd('nextElement'));
+ expectAfter('foxtraut', doCmd('nextElement'));
+ expectAfter('end', doCmd('nextElement'));
+ expectAfter('foxtraut', doCmd('previousElement'));
+
+ // TODO(dtseng): cleanup these utterances.
+ expectAfter(', end, paragraph, of test, paragraph', doCmd('nextLine'));
+
+ expectAfter('start', doCmd('goToBeginning'));
+ expectAfter('of test', doCmd('goToEnd'));
+
+ cvox.ChromeVox.tts.finishExpectations();
+ }.bind(this));
+});

Powered by Google App Engine
This is Rietveld 408576698