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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Include test fixture. 5 // Include test fixture.
6 GEN_INCLUDE(['../../testing/chromevox_next_e2e_test_base.js', 6 GEN_INCLUDE(['../../testing/chromevox_next_e2e_test_base.js',
7 '../../testing/assert_additions.js']); 7 '../../testing/assert_additions.js']);
8 8
9 GEN_INCLUDE(['../../testing/mock_feedback.js']); 9 GEN_INCLUDE(['../../testing/mock_feedback.js']);
10 10
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 .call(doCmd('nextCharacter')) 985 .call(doCmd('nextCharacter'))
986 .expectSpeech('i', 'selected') 986 .expectSpeech('i', 'selected')
987 .call(doCmd('previousCharacter')) 987 .call(doCmd('previousCharacter'))
988 .expectSpeech('i', 'unselected') 988 .expectSpeech('i', 'unselected')
989 .call(doCmd('nextCharacter')) 989 .call(doCmd('nextCharacter'))
990 .call(doCmd('nextCharacter')) 990 .call(doCmd('nextCharacter'))
991 .expectSpeech('End selection', 'sim') 991 .expectSpeech('End selection', 'sim')
992 .replay(); 992 .replay();
993 }); 993 });
994 }); 994 });
995
996 TEST_F('BackgroundTest', 'BasicTableCommands', function() {
997 var mockFeedback = this.createMockFeedback();
998 this.runWithLoadedTree(function(root) {/*!
999 <table border=1>
1000 <tr><td>name</td><td>title</td><td>address</td><td>phone</td></tr>
1001 <tr><td>Dan</td><td>Mr</td><td>666 Elm Street</td><td>212 222 5555</td></tr>
1002 </table>
1003 */}, function(root) {
1004 mockFeedback.call(doCmd('nextRow'))
1005 .expectSpeech('Dan', 'row 2 column 1')
1006 .call(doCmd('previousRow'))
1007 .expectSpeech('name', 'row 1 column 1')
1008 .call(doCmd('previousRow'))
1009 .expectSpeech('No cell above.')
1010 .call(doCmd('nextCol'))
1011 .expectSpeech('title', 'row 1 column 2')
1012 .call(doCmd('nextRow'))
1013 .expectSpeech('Mr', 'row 2 column 2')
1014 .call(doCmd('previousRow'))
1015 .expectSpeech('title', 'row 1 column 2')
1016 .call(doCmd('nextCol'))
1017 .expectSpeech('address', 'row 1 column 3')
1018 .call(doCmd('nextCol'))
1019 .expectSpeech('phone', 'row 1 column 4')
1020 .call(doCmd('nextCol'))
1021 .expectSpeech('No cell right.')
1022 .call(doCmd('previousRow'))
1023 .expectSpeech('No cell above.')
1024 .call(doCmd('nextRow'))
1025 .expectSpeech('212 222 5555', 'row 2 column 4')
1026 .call(doCmd('nextRow'))
1027 .expectSpeech('No cell below.')
1028 .call(doCmd('nextCol'))
1029 .expectSpeech('No cell right.')
1030 .call(doCmd('previousCol'))
1031 .expectSpeech('666 Elm Street', 'row 2 column 3')
1032 .call(doCmd('previousCol'))
1033 .expectSpeech('Mr', 'row 2 column 2')
1034
1035 .call(doCmd('goToRowLastCell'))
1036 .expectSpeech('212 222 5555', 'row 2 column 4')
1037 .call(doCmd('goToRowLastCell'))
1038 .expectSpeech('212 222 5555')
1039 .call(doCmd('goToRowFirstCell'))
1040 .expectSpeech('Dan', 'row 2 column 1')
1041 .call(doCmd('goToRowFirstCell'))
1042 .expectSpeech('Dan')
1043
1044 .call(doCmd('goToColFirstCell'))
1045 .expectSpeech('name', 'row 1 column 1')
1046 .call(doCmd('goToColFirstCell'))
1047 .expectSpeech('name')
1048 .call(doCmd('goToColLastCell'))
1049 .expectSpeech('Dan', 'row 2 column 1')
1050 .call(doCmd('goToColLastCell'))
1051 .expectSpeech('Dan')
1052
1053 .call(doCmd('goToLastCell'))
1054 .expectSpeech('212 222 5555', 'row 2 column 4')
1055 .call(doCmd('goToLastCell'))
1056 .expectSpeech('212 222 5555')
1057 .call(doCmd('goToFirstCell'))
1058 .expectSpeech('name', 'row 1 column 1')
1059 .call(doCmd('goToFirstCell'))
1060 .expectSpeech('name')
1061
1062 .replay();
1063 });
1064 });
1065
1066 TEST_F('BackgroundTest', 'MissingTableCells', function() {
1067 var mockFeedback = this.createMockFeedback();
1068 this.runWithLoadedTree(function(root) {/*!
1069 <table border=1>
1070 <tr><td>a</td><td>b</td><td>c</td></tr>
1071 <tr><td>d</td><td>e</td></tr>
1072 <tr><td>f</td></tr>
1073 </table>
1074 */}, function(root) {
1075 mockFeedback.call(doCmd('goToRowLastCell'))
1076 .expectSpeech('c', 'row 1 column 3')
1077 .call(doCmd('goToRowLastCell'))
1078 .expectSpeech('c')
1079 .call(doCmd('goToRowFirstCell'))
1080 .expectSpeech('a', 'row 1 column 1')
1081 .call(doCmd('goToRowFirstCell'))
1082 .expectSpeech('a')
1083
1084 .call(doCmd('nextCol'))
1085 .expectSpeech('b', 'row 1 column 2')
1086
1087 .call(doCmd('goToColLastCell'))
1088 .expectSpeech('e', 'row 2 column 2')
1089 .call(doCmd('goToColLastCell'))
1090 .expectSpeech('e')
1091 .call(doCmd('goToColFirstCell'))
1092 .expectSpeech('b', 'row 1 column 2')
1093 .call(doCmd('goToColFirstCell'))
1094 .expectSpeech('b')
1095
1096 .call(doCmd('goToFirstCell'))
1097 .expectSpeech('a', 'row 1 column 1')
1098 .call(doCmd('goToFirstCell'))
1099 .expectSpeech('a')
1100 .call(doCmd('goToLastCell'))
1101 .expectSpeech('f', 'row 3 column 1')
1102 .call(doCmd('goToLastCell'))
1103 .expectSpeech('f')
1104 .replay();
1105 });
1106 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698