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

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

Issue 1876243002: Exhaustive selection test. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | content/browser/frame_host/render_frame_host_impl.cc » ('j') | 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 357 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 });
378
379 TEST_F('CursorsTest', 'ExhaustSelection', function() {
380 this.runWithLoadedTree(function() {/*!
381 <p style="max-width: 100px">
382 A new version of the ChromeVox screen
383 reader on Chrome OS, currently known as “ChromeVox Next,” is
384 available for beta testing.
385 </p>
386 */},
387 function(root) {
388 var node = root.firstChild.firstChild;
389 var range = new cursors.Range(
390 new cursors.Cursor(node, 0),
391 new cursors.Cursor(node, node.name.length));
392 var length = range.end.selectionIndex_;
393 var rev = function(start, end) {
394 if (start == end && end == (length - 1))
395 return;
396
397 if (start == length - 1) {
398 start = 0;
399 end++;
400 }else {
401 start++;
402 }
403
404 this.listenOnce(root, 'textSelectionChanged', function() {
405 console.log('Received selection: '+root.anchorOffset + ' ' + root.focusO ffset);
406 rev(start, end);
407 }, true);
408
409 range.start.index_ = start;
410 range.end.index_ = end;
411
412 console.log('Waiting for textSelectionChanged on: ' + start + ' ' + end);
413 range.select();
414 }.bind(this);
415
416 rev(-1, 0);
417 });
418 });
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698