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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 TEST_F('OutputE2ETest', 'Menu', function() { | 444 TEST_F('OutputE2ETest', 'Menu', function() { |
445 this.runWithLoadedTree(function() {/*! | 445 this.runWithLoadedTree(function() {/*! |
446 <div role="menu"> | 446 <div role="menu"> |
447 <div role="menuitem">a</div> | 447 <div role="menuitem">a</div> |
448 </div> | 448 </div> |
449 */}, | 449 */}, |
450 function(root) { | 450 function(root) { |
451 var el = root.firstChild.firstChild; | 451 var el = root.firstChild.firstChild; |
452 var range = cursors.Range.fromNode(el); | 452 var range = cursors.Range.fromNode(el); |
453 var o = new Output().withSpeechAndBraille(range, null, 'navigate'); | 453 var o = new Output().withSpeechAndBraille(range, null, 'navigate'); |
454 checkSpeechOutput('a|Menu item| 1 of 1 ', [ | 454 checkSpeechOutput('a|Menu item| 1 of 1 |Menu', [ |
455 {value: 'name', start: 0, end: 1}, | 455 {value: 'name', start: 0, end: 1}, |
456 {value: 'role', start: 2, end: 11}], o); | 456 {value: 'role', start: 21, end: 25}], o); |
457 checkBrailleOutput( | 457 checkBrailleOutput( |
458 'a mnuitm 1/1', | 458 'a mnuitm 1/1 mnu', |
459 [{value: new Output.NodeSpan(el), start: 0, end: 12}], | 459 [{value: new Output.NodeSpan(el), start: 0, end: 12}, |
| 460 {value: new Output.NodeSpan(el.parent), start: 13, end: 16}], |
460 o); | 461 o); |
461 }); | 462 }); |
462 }); | 463 }); |
463 | 464 |
464 TEST_F('OutputE2ETest', 'ListBox', function() { | 465 TEST_F('OutputE2ETest', 'ListBox', function() { |
465 this.runWithLoadedTree(function() {/*! | 466 this.runWithLoadedTree(function() {/*! |
466 <select multiple> | 467 <select multiple> |
467 <option>1</option> | 468 <option>1</option> |
468 <option>2</option> | 469 <option>2</option> |
469 </select> | 470 </select> |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 this.runWithLoadedTree(function() {/*! | 643 this.runWithLoadedTree(function() {/*! |
643 <div><button>ok</button></div> | 644 <div><button>ok</button></div> |
644 */}, | 645 */}, |
645 function(root) { | 646 function(root) { |
646 var div = root.find({role: 'div'}); | 647 var div = root.find({role: 'div'}); |
647 var o = new Output().withSpeech(cursors.Range.fromNode(div)); | 648 var o = new Output().withSpeech(cursors.Range.fromNode(div)); |
648 assertEquals('ok|Button' | 649 assertEquals('ok|Button' |
649 , o.speechOutputForTest.string_); | 650 , o.speechOutputForTest.string_); |
650 }); | 651 }); |
651 }); | 652 }); |
OLD | NEW |