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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 this.runWithLoadedTree(function() {/*! | 443 this.runWithLoadedTree(function() {/*! |
444 <div role="menu"> | 444 <div role="menu"> |
445 <div role="menuitem">a</div> | 445 <div role="menuitem">a</div> |
446 </div> | 446 </div> |
447 */}, | 447 */}, |
448 function(root) { | 448 function(root) { |
449 var el = root.firstChild.firstChild; | 449 var el = root.firstChild.firstChild; |
450 var range = cursors.Range.fromNode(el); | 450 var range = cursors.Range.fromNode(el); |
451 var o = new Output().withSpeechAndBraille(range, null, 'navigate'); | 451 var o = new Output().withSpeechAndBraille(range, null, 'navigate'); |
452 assertEqualsJSON({string_: | 452 assertEqualsJSON({string_: |
453 '|Menu|with 1 item|a|Menu item| 1 of 1 ', spans_: [ | 453 '|Menu|a|Menu item| 1 of 1 ', spans_: [ |
454 {value: 'name', start: 18, end: 19}, | 454 {value: {earconId: 'LISTBOX'}, start:0, end:0}, |
455 {value: {earconId: 'BUTTON'}, start:18, end:19}, | 455 {value: 'name', start: 6, end: 7}, |
456 {value: 'role', start:20, end: 29} | 456 {value: {earconId: 'BUTTON'}, start:6, end:7}, |
| 457 {value: 'role', start:8, end: 17} |
457 ]}, o.speechOutputForTest); | 458 ]}, o.speechOutputForTest); |
458 checkBrailleOutput( | 459 checkBrailleOutput( |
459 'mnu +1 a mnuitm 1/1', | 460 'mnu a mnuitm 1/1', |
460 [{value: new Output.NodeSpan(el.parent), start: 0, end: 6}, | 461 [{value: new Output.NodeSpan(el.parent), start: 0, end: 3}, |
461 {value: new Output.NodeSpan(el), start: 7, end: 19}], | 462 {value: new Output.NodeSpan(el), start: 4, end: 16}], |
462 o); | 463 o); |
463 }); | 464 }); |
464 }); | 465 }); |
465 | 466 |
466 TEST_F('OutputE2ETest', 'ListBox', function() { | 467 TEST_F('OutputE2ETest', 'ListBox', function() { |
467 this.runWithLoadedTree(function() {/*! | 468 this.runWithLoadedTree(function() {/*! |
468 <select multiple> | 469 <select multiple> |
469 <option>1</option> | 470 <option>1</option> |
470 <option>2</option> | 471 <option>2</option> |
471 </select> | 472 </select> |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 */}, | 581 */}, |
581 function(root) { | 582 function(root) { |
582 var node = root.children[0].firstChild; | 583 var node = root.children[0].firstChild; |
583 var range = cursors.Range.fromNode(node); | 584 var range = cursors.Range.fromNode(node); |
584 | 585 |
585 localStorage['useVerboseMode'] = 'false'; | 586 localStorage['useVerboseMode'] = 'false'; |
586 var oWithoutPrev = new Output().withSpeech(range, null, 'navigate'); | 587 var oWithoutPrev = new Output().withSpeech(range, null, 'navigate'); |
587 assertEquals('|inside', oWithoutPrev.speechOutputForTest.string_); | 588 assertEquals('|inside', oWithoutPrev.speechOutputForTest.string_); |
588 }); | 589 }); |
589 }); | 590 }); |
OLD | NEW |