OLD | NEW |
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 Loading... |
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 }); |
OLD | NEW |