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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/common/braille_util_test.js

Issue 418053004: Fix CvoxBrailleUtilUnitTest.TextFieldSelection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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_unittest_base.js']); 6 GEN_INCLUDE(['../testing/chromevox_unittest_base.js']);
7 7
8 /** 8 /**
9 * Test fixture. 9 * Test fixture.
10 * @constructor 10 * @constructor
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 /** 200 /**
201 * @export 201 * @export
202 */ 202 */
203 TEST_F('CvoxBrailleUtilUnitTest', 'TextFieldSelection', function() { 203 TEST_F('CvoxBrailleUtilUnitTest', 'TextFieldSelection', function() {
204 this.loadHtml( 204 this.loadHtml(
205 '<input id="1" type="text" value="strawberry">' 205 '<input id="1" type="text" value="strawberry">'
206 ); 206 );
207 207
208 var inputElem = $('1'); 208 var inputElem = $('1');
209 inputElem.focus();
209 var input = cvox.CursorSelection.fromNode(inputElem); 210 var input = cvox.CursorSelection.fromNode(inputElem);
210 211
211 // Selection. 212 // Selection.
212 inputElem.selectionStart = 2; 213 inputElem.selectionStart = 2;
213 inputElem.selectionEnd = 5; 214 inputElem.selectionEnd = 5;
214 this.assertBrailleEquals( 215 this.assertBrailleEquals(
215 {text: ': strawberry edtxt', 216 {text: ': strawberry edtxt',
216 startIndex: 4, 217 startIndex: 4,
217 endIndex: 7 218 endIndex: 7
218 }, this.getBraille_(input, input)); 219 }, this.getBraille_(input, input));
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 selectionSpan = s.getSpanInstanceOf(cvox.BrailleUtil.ValueSelectionSpan); 392 selectionSpan = s.getSpanInstanceOf(cvox.BrailleUtil.ValueSelectionSpan);
392 assertEquals(5, s.getSpanStart(selectionSpan)); 393 assertEquals(5, s.getSpanStart(selectionSpan));
393 assertEquals(5, s.getSpanEnd(selectionSpan)); 394 assertEquals(5, s.getSpanEnd(selectionSpan));
394 395
395 // All of the value selected selected with reversed start and end. 396 // All of the value selected selected with reversed start and end.
396 s = cvox.BrailleUtil.createValue('value', 5, 0); 397 s = cvox.BrailleUtil.createValue('value', 5, 0);
397 selectionSpan = s.getSpanInstanceOf(cvox.BrailleUtil.ValueSelectionSpan); 398 selectionSpan = s.getSpanInstanceOf(cvox.BrailleUtil.ValueSelectionSpan);
398 assertEquals(0, s.getSpanStart(selectionSpan)); 399 assertEquals(0, s.getSpanStart(selectionSpan));
399 assertEquals(5, s.getSpanEnd(selectionSpan)); 400 assertEquals(5, s.getSpanEnd(selectionSpan));
400 }); 401 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698