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