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

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

Issue 1866043004: Add a nameFromNode attrib to link output rule (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. Created 4 years, 8 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/output.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 GEN_INCLUDE(['../../testing/assert_additions.js']); 5 GEN_INCLUDE(['../../testing/assert_additions.js']);
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 * Gets the braille output and asserts that it matches expected values. 9 * Gets the braille output and asserts that it matches expected values.
10 * Annotations in the output that are primitive strings are ignored. 10 * Annotations in the output that are primitive strings are ignored.
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 <option>1</option> 449 <option>1</option>
450 <option>2</option> 450 <option>2</option>
451 </select> 451 </select>
452 */}, 452 */},
453 function(root) { 453 function(root) {
454 var el = root.firstChild.firstChild.firstChild; 454 var el = root.firstChild.firstChild.firstChild;
455 var range = cursors.Range.fromNode(el); 455 var range = cursors.Range.fromNode(el);
456 var o = new Output().withSpeechAndBraille(range, null, 'navigate'); 456 var o = new Output().withSpeechAndBraille(range, null, 'navigate');
457 assertEqualsJSON({string_: '1|List item| 1 of 2 ||List box|with 2 items', 457 assertEqualsJSON({string_: '1|List item| 1 of 2 ||List box|with 2 items',
458 spans_: 458 spans_:
459 [{value: {earconId: 'LIST_ITEM'}, start: 0,end: 1}, 459 [{value: 'name', start: 0,end: 1},
460 {value: 'name', start: 21, end: 21}, 460 {value: {earconId: 'LIST_ITEM'}, start: 0,end: 1},
461 {value: {earconId: 'LISTBOX'}, start: 21, end: 21}, 461 {value: 'nameFromNode', start: 21, end: 21},
462 {value: 'role', start: 22, end: 30}]}, o.speechOutputForTest); 462 {value: 'role', start: 22, end: 30}]}, o.speechOutputForTest);
463 checkBrailleOutput( 463 checkBrailleOutput(
464 '1 lstitm 1/2 lstbx +2', 464 '1 lstitm 1/2 lstbx +2',
465 [{value: new Output.NodeSpan(el), start: 0, end: 12}, 465 [{value: new Output.NodeSpan(el), start: 0, end: 12},
466 {value: new Output.NodeSpan(el.parent), start: 13, end: 21}], 466 {value: new Output.NodeSpan(el.parent), start: 13, end: 21}],
467 o); 467 o);
468 }); 468 });
469 }); 469 });
470 470
471 SYNC_TEST_F('OutputE2ETest', 'MessageIdAndEarconValidity', function() { 471 SYNC_TEST_F('OutputE2ETest', 'MessageIdAndEarconValidity', function() {
(...skipping 29 matching lines...) Expand all
501 <div>that has content</div> 501 <div>that has content</div>
502 <div></div> 502 <div></div>
503 <div role='group'><div>nested content</div></div> 503 <div role='group'><div>nested content</div></div>
504 */}, 504 */},
505 function(root) { 505 function(root) {
506 var el = root.firstChild.firstChild; 506 var el = root.firstChild.firstChild;
507 var range = cursors.Range.fromNode(el); 507 var range = cursors.Range.fromNode(el);
508 var o = new Output().withSpeechAndBraille(range, null, 'navigate'); 508 var o = new Output().withSpeechAndBraille(range, null, 'navigate');
509 assertEqualsJSON({string_: 'that has content|', 509 assertEqualsJSON({string_: 'that has content|',
510 spans_: [ 510 spans_: [
511 {value: 'name', start: 17, end: 17} 511 {value: 'name', start: 0, end: 16},
512 {value: 'nameFromNode', start: 17, end: 17}
512 ]}, o.speechOutputForTest); 513 ]}, o.speechOutputForTest);
513 checkBrailleOutput( 514 checkBrailleOutput(
514 'that has content', 515 'that has content',
515 [{value: new Output.NodeSpan(el), start: 0, end: 16}], 516 [{value: new Output.NodeSpan(el), start: 0, end: 16}],
516 o); 517 o);
517 }); 518 });
518 }); 519 });
519 520
520 TEST_F('OutputE2ETest', 'LessVerboseAncestry', function() { 521 TEST_F('OutputE2ETest', 'LessVerboseAncestry', function() {
521 this.runWithLoadedTree(function() {/*! 522 this.runWithLoadedTree(function() {/*!
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 function(root) { 614 function(root) {
614 var unjoined = new Output().format('$descendants', root); 615 var unjoined = new Output().format('$descendants', root);
615 assertEquals('This|fragment|Should be separated|with spaces' 616 assertEquals('This|fragment|Should be separated|with spaces'
616 , unjoined.speechOutputForTest.string_); 617 , unjoined.speechOutputForTest.string_);
617 618
618 var joined = new Output().format('$joinedDescendants', root); 619 var joined = new Output().format('$joinedDescendants', root);
619 assertEquals('This fragment Should be separated with spaces' 620 assertEquals('This fragment Should be separated with spaces'
620 , joined.speechOutputForTest.string_); 621 , joined.speechOutputForTest.string_);
621 }); 622 });
622 }); 623 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698