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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs

Issue 2028173003: Refine ChromeVox's treatment of containers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7
8 /** 8 /**
9 * Test fixture for cvox2.cursors. 9 * Test fixture for cvox2.cursors.
10 * @constructor 10 * @constructor
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 multiInlineDoc: function() {/*! 125 multiInlineDoc: function() {/*!
126 <p style='max-width: 5px'>start diff line</p> 126 <p style='max-width: 5px'>start diff line</p>
127 <p>end 127 <p>end
128 */} 128 */}
129 }; 129 };
130 130
131 TEST_F('CursorsTest', 'CharacterCursor', function() { 131 TEST_F('CursorsTest', 'CharacterCursor', function() {
132 this.runCursorMovesOnDocument(this.simpleDoc, [ 132 this.runCursorMovesOnDocument(this.simpleDoc, [
133 [CHARACTER, DIRECTIONAL, FORWARD, {index: 1, value: 'start '}], 133 [CHARACTER, DIRECTIONAL, FORWARD, {index: 1, value: 'start '}],
134 [CHARACTER, DIRECTIONAL, BACKWARD, {index: 0, value: 'start '}], 134 [CHARACTER, DIRECTIONAL, BACKWARD, {index: 0, value: 'start '}],
135 [CHARACTER, DIRECTIONAL, BACKWARD, {index: 0, value: undefined}], 135 // Bumps up against edge.
136 [CHARACTER, DIRECTIONAL, BACKWARD, {index: 0, value: 'start '}],
136 137
137 [CHARACTER, DIRECTIONAL, FORWARD, {index: 0, value: 'start '}],
138 [CHARACTER, DIRECTIONAL, FORWARD, {index: 1, value: 'start '}], 138 [CHARACTER, DIRECTIONAL, FORWARD, {index: 1, value: 'start '}],
139 [CHARACTER, DIRECTIONAL, FORWARD, {index: 2, value: 'start '}], 139 [CHARACTER, DIRECTIONAL, FORWARD, {index: 2, value: 'start '}],
140 [CHARACTER, DIRECTIONAL, FORWARD, {index: 3, value: 'start '}], 140 [CHARACTER, DIRECTIONAL, FORWARD, {index: 3, value: 'start '}],
141 [CHARACTER, DIRECTIONAL, FORWARD, {index: 4, value: 'start '}], 141 [CHARACTER, DIRECTIONAL, FORWARD, {index: 4, value: 'start '}],
142 [CHARACTER, DIRECTIONAL, FORWARD, {index: 5, value: 'start '}], 142 [CHARACTER, DIRECTIONAL, FORWARD, {index: 5, value: 'start '}],
143 143
144 [CHARACTER, DIRECTIONAL, FORWARD, {index: 0, value: 'same line'}], 144 [CHARACTER, DIRECTIONAL, FORWARD, {index: 0, value: 'same line'}],
145 [CHARACTER, DIRECTIONAL, FORWARD, {index: 1, value: 'same line'}], 145 [CHARACTER, DIRECTIONAL, FORWARD, {index: 1, value: 'same line'}],
146 [CHARACTER, DIRECTIONAL, BACKWARD, {index: 0, value: 'same line'}], 146 [CHARACTER, DIRECTIONAL, BACKWARD, {index: 0, value: 'same line'}],
147 147
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 // Line (BOUND). 191 // Line (BOUND).
192 [LINE, BOUND, FORWARD, {value: 'same line'}], 192 [LINE, BOUND, FORWARD, {value: 'same line'}],
193 [LINE, BOUND, FORWARD, {value: 'same line'}], 193 [LINE, BOUND, FORWARD, {value: 'same line'}],
194 [LINE, BOUND, BACKWARD, {value: 'start '}], 194 [LINE, BOUND, BACKWARD, {value: 'start '}],
195 [LINE, BOUND, BACKWARD, {value: 'start '}], 195 [LINE, BOUND, BACKWARD, {value: 'start '}],
196 196
197 // Line (DIRECTIONAL). 197 // Line (DIRECTIONAL).
198 [LINE, DIRECTIONAL, FORWARD, {value: 'end'}], 198 [LINE, DIRECTIONAL, FORWARD, {value: 'end'}],
199 [LINE, DIRECTIONAL, FORWARD, {value: 'end'}], 199 [LINE, DIRECTIONAL, FORWARD, {value: 'end'}],
200 [LINE, DIRECTIONAL, BACKWARD, {value: 'same line'}], 200 [LINE, DIRECTIONAL, BACKWARD, {value: 'same line'}],
201 [LINE, DIRECTIONAL, BACKWARD, {value: undefined}], 201 // Bump against an edge.
202 [LINE, BOUND, BACKWARD, {value: undefined}], 202 [LINE, DIRECTIONAL, BACKWARD, {value: 'same line'}],
203 [LINE, DIRECTIONAL, FORWARD, {value: 'start '}]]); 203 [LINE, BOUND, BACKWARD, {value: 'start '}]]);
204 }); 204 });
205 205
206 TEST_F('CursorsTest', 'CharacterRange', function() { 206 TEST_F('CursorsTest', 'CharacterRange', function() {
207 this.runCursorMovesOnDocument(this.simpleDoc, [ 207 this.runCursorMovesOnDocument(this.simpleDoc, [
208 [CHARACTER, FORWARD, 208 [CHARACTER, FORWARD,
209 {value: 'start ', index: 1}, {value: 'start ', index: 2}], 209 {value: 'start ', index: 1}, {value: 'start ', index: 2}],
210 [CHARACTER, FORWARD, 210 [CHARACTER, FORWARD,
211 {value: 'start ', index: 2}, {value: 'start ', index: 3}], 211 {value: 'start ', index: 2}, {value: 'start ', index: 3}],
212 [CHARACTER, FORWARD, 212 [CHARACTER, FORWARD,
213 {value: 'start ', index: 3}, {value: 'start ', index: 4}], 213 {value: 'start ', index: 3}, {value: 'start ', index: 4}],
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 this.runCursorMovesOnDocument(this.simpleDoc, [ 265 this.runCursorMovesOnDocument(this.simpleDoc, [
266 [LINE, FORWARD, {value: 'end', index: 0}, {value: 'end', index: 3}], 266 [LINE, FORWARD, {value: 'end', index: 0}, {value: 'end', index: 3}],
267 [LINE, FORWARD, {value: 'end', index: 0}, {value: 'end', index: 3}], 267 [LINE, FORWARD, {value: 'end', index: 0}, {value: 'end', index: 3}],
268 [LINE, FORWARD, {value: 'end', index: 0}, {value: 'end', index: 3}], 268 [LINE, FORWARD, {value: 'end', index: 0}, {value: 'end', index: 3}],
269 [LINE, FORWARD, {value: 'end', index: 0}, {value: 'end', index: 3}], 269 [LINE, FORWARD, {value: 'end', index: 0}, {value: 'end', index: 3}],
270 270
271 [LINE, BACKWARD, 271 [LINE, BACKWARD,
272 {value: 'start ', index: 0}, {value: 'same line', index: 9}], 272 {value: 'start ', index: 0}, {value: 'same line', index: 9}],
273 273
274 [LINE, BACKWARD, 274 [LINE, BACKWARD,
275 {value: undefined, index: 0}, {value: undefined, index: 0}], 275 {value: 'start ', index: 0}, {value: 'same line', index: 9}]
276 ], this.RANGE); 276 ], this.RANGE);
277 }); 277 });
278 278
279 TEST_F('CursorsTest', 'DontSplitOnNodeNavigation', function() { 279 TEST_F('CursorsTest', 'DontSplitOnNodeNavigation', function() {
280 this.runWithLoadedTree(this.multiInlineDoc, function(root) { 280 this.runWithLoadedTree(this.multiInlineDoc, function(root) {
281 var para = root.firstChild; 281 var para = root.firstChild;
282 assertEquals('paragraph', para.role); 282 assertEquals('paragraph', para.role);
283 var cursor = new cursors.Cursor(para.firstChild, 0); 283 var cursor = new cursors.Cursor(para.firstChild, 0);
284 cursor = cursor.move(DOM_NODE, DIRECTIONAL, FORWARD); 284 cursor = cursor.move(DOM_NODE, DIRECTIONAL, FORWARD);
285 assertEquals('staticText', cursor.node.role); 285 assertEquals('staticText', cursor.node.role);
286 assertEquals('end', cursor.node.name); 286 assertEquals('end', cursor.node.name);
287 287
288 cursor = cursor.move(DOM_NODE, DIRECTIONAL, BACKWARD); 288 cursor = cursor.move(DOM_NODE, DIRECTIONAL, BACKWARD);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 assertEquals('inlineTextBox', secondLine.role); 368 assertEquals('inlineTextBox', secondLine.role);
369 assertEquals('diff ', secondLine.name); 369 assertEquals('diff ', secondLine.name);
370 370
371 var secondLineCursor = new cursors.Cursor(secondLine, -1); 371 var secondLineCursor = new cursors.Cursor(secondLine, -1);
372 assertEquals(-1, secondLineCursor.selectionIndex_); 372 assertEquals(-1, secondLineCursor.selectionIndex_);
373 secondLineCursor = new cursors.Cursor(secondLine, 0); 373 secondLineCursor = new cursors.Cursor(secondLine, 0);
374 secondLineCursor.index = 0; 374 secondLineCursor.index = 0;
375 assertEquals(6, secondLineCursor.selectionIndex_); 375 assertEquals(6, secondLineCursor.selectionIndex_);
376 }); 376 });
377 }); 377 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698