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

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

Issue 2132123002: Complete table support in ChromeVox Next. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 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 367ef13bced681773e8e893719974da568f6ea70..66769a2b4b66a595d8019e9ccc82ac16dc7cff02 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
@@ -992,3 +992,115 @@ TEST_F('BackgroundTest', 'Selection', function() {
.replay();
});
});
+
+TEST_F('BackgroundTest', 'BasicTableCommands', function() {
+ var mockFeedback = this.createMockFeedback();
+ this.runWithLoadedTree(function(root) {/*!
+ <table border=1>
+ <tr><td>name</td><td>title</td><td>address</td><td>phone</td></tr>
+ <tr><td>Dan</td><td>Mr</td><td>666 Elm Street</td><td>212 222 5555</td></tr>
+ </table>
+ */}, function(root) {
+ mockFeedback.call(doCmd('nextRow'))
+ .expectSpeech('Dan', 'row 2 column 1')
+ .call(doCmd('previousRow'))
+ .expectSpeech('name', 'row 1 column 1')
+ .call(doCmd('previousRow'))
+ .expectSpeech('No cell above.')
+ .call(doCmd('nextCol'))
+ .expectSpeech('title', 'row 1 column 2')
+ .call(doCmd('nextRow'))
+ .expectSpeech('Mr', 'row 2 column 2')
+ .call(doCmd('previousRow'))
+ .expectSpeech('title', 'row 1 column 2')
+ .call(doCmd('nextCol'))
+ .expectSpeech('address', 'row 1 column 3')
+ .call(doCmd('nextCol'))
+ .expectSpeech('phone', 'row 1 column 4')
+ .call(doCmd('nextCol'))
+ .expectSpeech('No cell right.')
+ .call(doCmd('previousRow'))
+ .expectSpeech('No cell above.')
+ .call(doCmd('nextRow'))
+ .expectSpeech('212 222 5555', 'row 2 column 4')
+ .call(doCmd('nextRow'))
+ .expectSpeech('No cell below.')
+ .call(doCmd('nextCol'))
+ .expectSpeech('No cell right.')
+ .call(doCmd('previousCol'))
+ .expectSpeech('666 Elm Street', 'row 2 column 3')
+ .call(doCmd('previousCol'))
+ .expectSpeech('Mr', 'row 2 column 2')
+
+ .call(doCmd('goToRowLastCell'))
+ .expectSpeech('212 222 5555', 'row 2 column 4')
+ .call(doCmd('goToRowLastCell'))
+ .expectSpeech('212 222 5555')
+ .call(doCmd('goToRowFirstCell'))
+ .expectSpeech('Dan', 'row 2 column 1')
+ .call(doCmd('goToRowFirstCell'))
+ .expectSpeech('Dan')
+
+ .call(doCmd('goToColFirstCell'))
+ .expectSpeech('name', 'row 1 column 1')
+ .call(doCmd('goToColFirstCell'))
+ .expectSpeech('name')
+ .call(doCmd('goToColLastCell'))
+ .expectSpeech('Dan', 'row 2 column 1')
+ .call(doCmd('goToColLastCell'))
+ .expectSpeech('Dan')
+
+ .call(doCmd('goToLastCell'))
+ .expectSpeech('212 222 5555', 'row 2 column 4')
+ .call(doCmd('goToLastCell'))
+ .expectSpeech('212 222 5555')
+ .call(doCmd('goToFirstCell'))
+ .expectSpeech('name', 'row 1 column 1')
+ .call(doCmd('goToFirstCell'))
+ .expectSpeech('name')
+
+ .replay();
+ });
+});
+
+TEST_F('BackgroundTest', 'MissingTableCells', function() {
+ var mockFeedback = this.createMockFeedback();
+ this.runWithLoadedTree(function(root) {/*!
+ <table border=1>
+ <tr><td>a</td><td>b</td><td>c</td></tr>
+ <tr><td>d</td><td>e</td></tr>
+ <tr><td>f</td></tr>
+ </table>
+ */}, function(root) {
+ mockFeedback.call(doCmd('goToRowLastCell'))
+ .expectSpeech('c', 'row 1 column 3')
+ .call(doCmd('goToRowLastCell'))
+ .expectSpeech('c')
+ .call(doCmd('goToRowFirstCell'))
+ .expectSpeech('a', 'row 1 column 1')
+ .call(doCmd('goToRowFirstCell'))
+ .expectSpeech('a')
+
+ .call(doCmd('nextCol'))
+ .expectSpeech('b', 'row 1 column 2')
+
+ .call(doCmd('goToColLastCell'))
+ .expectSpeech('e', 'row 2 column 2')
+ .call(doCmd('goToColLastCell'))
+ .expectSpeech('e')
+ .call(doCmd('goToColFirstCell'))
+ .expectSpeech('b', 'row 1 column 2')
+ .call(doCmd('goToColFirstCell'))
+ .expectSpeech('b')
+
+ .call(doCmd('goToFirstCell'))
+ .expectSpeech('a', 'row 1 column 1')
+ .call(doCmd('goToFirstCell'))
+ .expectSpeech('a')
+ .call(doCmd('goToLastCell'))
+ .expectSpeech('f', 'row 3 column 1')
+ .call(doCmd('goToLastCell'))
+ .expectSpeech('f')
+ .replay();
+ });
+});

Powered by Google App Engine
This is Rietveld 408576698