| 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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 }); | 608 }); |
| 609 TEST_F('OutputE2ETest', 'ToggleButton', function() { | 609 TEST_F('OutputE2ETest', 'ToggleButton', function() { |
| 610 this.runWithLoadedTree(function() {/*! | 610 this.runWithLoadedTree(function() {/*! |
| 611 <div role="button" aria-pressed="true">Subscribe</div>*/}, | 611 <div role="button" aria-pressed="true">Subscribe</div>*/}, |
| 612 function(root) { | 612 function(root) { |
| 613 var el = root.firstChild; | 613 var el = root.firstChild; |
| 614 var o = new Output().withSpeech(cursors.Range.fromNode(el)); | 614 var o = new Output().withSpeech(cursors.Range.fromNode(el)); |
| 615 assertEqualsJSON({string_: '|Subscribe|Button|Pressed', spans_: [ | 615 assertEqualsJSON({string_: '|Subscribe|Button|Pressed', spans_: [ |
| 616 {value: {earconId: 'CHECK_ON'}, start: 0, end: 0}, | 616 {value: {earconId: 'CHECK_ON'}, start: 0, end: 0}, |
| 617 {value: 'name', start: 1, end:10}, | 617 {value: 'name', start: 1, end:10}, |
| 618 {value: 'role', start: 11, end: 17}, | 618 {value: 'role', start: 11, end: 17} |
| 619 {value: 'state', start: 18, end: 25} | |
| 620 ]}, o.speechOutputForTest); | 619 ]}, o.speechOutputForTest); |
| 621 }); | 620 }); |
| 622 }); | 621 }); |
| 623 | 622 |
| 624 TEST_F('OutputE2ETest', 'JoinDescendants', function() { | 623 TEST_F('OutputE2ETest', 'JoinDescendants', function() { |
| 625 this.runWithLoadedTree(function() {/*! | 624 this.runWithLoadedTree(function() {/*! |
| 626 <p>This</p> | 625 <p>This</p> |
| 627 <p>fragment</p> | 626 <p>fragment</p> |
| 628 <p>Should be separated</p> | 627 <p>Should be separated</p> |
| 629 <p>with spaces</p> | 628 <p>with spaces</p> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 656 <div role="row" tabindex=0 aria-label="start"></div> | 655 <div role="row" tabindex=0 aria-label="start"></div> |
| 657 <div role="row" tabindex=0 aria-label="end"></div> | 656 <div role="row" tabindex=0 aria-label="end"></div> |
| 658 */}, | 657 */}, |
| 659 function(root) { | 658 function(root) { |
| 660 var r1 = cursors.Range.fromNode(root.firstChild); | 659 var r1 = cursors.Range.fromNode(root.firstChild); |
| 661 var r2 = cursors.Range.fromNode(root.lastChild); | 660 var r2 = cursors.Range.fromNode(root.lastChild); |
| 662 assertEquals('start|Row', | 661 assertEquals('start|Row', |
| 663 new Output().withSpeech(r1, r2).speechOutputForTest.string_); | 662 new Output().withSpeech(r1, r2).speechOutputForTest.string_); |
| 664 }); | 663 }); |
| 665 }); | 664 }); |
| OLD | NEW |