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

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

Issue 1801363003: Add a $joinedDescendants output specifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests Created 4 years, 9 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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 var el = root.firstChild; 602 var el = root.firstChild;
603 var o = new Output().withSpeech(cursors.Range.fromNode(el)); 603 var o = new Output().withSpeech(cursors.Range.fromNode(el));
604 assertEqualsJSON({string_: '|Subscribe|Check box|not checked', spans_: [ 604 assertEqualsJSON({string_: '|Subscribe|Check box|not checked', spans_: [
605 {value: {earconId: 'CHECK_OFF'}, start: 0, end: 0}, 605 {value: {earconId: 'CHECK_OFF'}, start: 0, end: 0},
606 {value: 'name', start: 1, end:10}, 606 {value: 'name', start: 1, end:10},
607 {value: 'role', start: 11, end: 20}, 607 {value: 'role', start: 11, end: 20},
608 {value: 'state', start: 21, end: 32} 608 {value: 'state', start: 21, end: 32}
609 ]}, o.speechOutputForTest); 609 ]}, o.speechOutputForTest);
610 }); 610 });
611 }); 611 });
612
613 TEST_F('OutputE2ETest', 'JoinDescendants', function() {
614 this.runWithLoadedTree(function() {/*!
615 <p>This</p>
616 <p>fragment</p>
617 <p>Should be separated</p>
618 <p>with spaces</p>
619 */},
620 function(root) {
621 var unjoined = new Output().format('$descendants', root);
622 assertEquals('This|fragment|Should be separated|with spaces'
623 , unjoined.speechOutputForTest.string_);
624
625 var joined = new Output().format('$joinedDescendants', root);
626 assertEquals('This fragment Should be separated with spaces'
627 , joined.speechOutputForTest.string_);
628 });
629 });
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