| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 function OutputE2ETest() { | 93 function OutputE2ETest() { |
| 94 ChromeVoxNextE2ETest.call(this); | 94 ChromeVoxNextE2ETest.call(this); |
| 95 } | 95 } |
| 96 | 96 |
| 97 OutputE2ETest.prototype = { | 97 OutputE2ETest.prototype = { |
| 98 __proto__: ChromeVoxNextE2ETest.prototype, | 98 __proto__: ChromeVoxNextE2ETest.prototype, |
| 99 | 99 |
| 100 /** @override */ | 100 /** @override */ |
| 101 setUp: function() { | 101 setUp: function() { |
| 102 window.Dir = AutomationUtil.Dir; | 102 window.Dir = AutomationUtil.Dir; |
| 103 this.forceContextualLastOutput(); |
| 103 } | 104 } |
| 104 }; | 105 }; |
| 105 | 106 |
| 106 TEST_F('OutputE2ETest', 'Links', function() { | 107 TEST_F('OutputE2ETest', 'Links', function() { |
| 107 this.runWithLoadedTree('<a href="#">Click here</a>', | 108 this.runWithLoadedTree('<a href="#">Click here</a>', |
| 108 function(root) { | 109 function(root) { |
| 109 var el = root.firstChild.firstChild; | 110 var el = root.firstChild.firstChild; |
| 110 var range = cursors.Range.fromNode(el); | 111 var range = cursors.Range.fromNode(el); |
| 111 var o = new Output().withSpeechAndBraille(range, null, 'navigate'); | 112 var o = new Output().withSpeechAndBraille(range, null, 'navigate'); |
| 112 assertEqualsJSON({string_: 'Click here|Link', 'spans_': [ | 113 assertEqualsJSON({string_: 'Click here|Link', 'spans_': [ |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 '1 lstitm 1/2 lstbx +2', | 485 '1 lstitm 1/2 lstbx +2', |
| 485 [{value: new Output.NodeSpan(el), start: 0, end: 12}, | 486 [{value: new Output.NodeSpan(el), start: 0, end: 12}, |
| 486 {value: new Output.NodeSpan(el.parent), start: 13, end: 21}], | 487 {value: new Output.NodeSpan(el.parent), start: 13, end: 21}], |
| 487 o); | 488 o); |
| 488 }); | 489 }); |
| 489 }); | 490 }); |
| 490 | 491 |
| 491 SYNC_TEST_F('OutputE2ETest', 'MessageIdAndEarconValidity', function() { | 492 SYNC_TEST_F('OutputE2ETest', 'MessageIdAndEarconValidity', function() { |
| 492 for (var key in Output.ROLE_INFO_) { | 493 for (var key in Output.ROLE_INFO_) { |
| 493 var value = Output.ROLE_INFO_[key]; | 494 var value = Output.ROLE_INFO_[key]; |
| 494 Msgs.getMsg(value.msgId); | 495 if (value.msgId) { |
| 495 Msgs.getMsg(value.msgId + '_brl'); | 496 Msgs.getMsg(value.msgId); |
| 496 assertFalse(/[A-Z]+/.test(value.msgId)); | 497 Msgs.getMsg(value.msgId + '_brl'); |
| 498 assertFalse(/[A-Z]+/.test(value.msgId)); |
| 499 } |
| 497 if (value.earconId) | 500 if (value.earconId) |
| 498 assertNotNullNorUndefined(cvox.Earcon[value.earconId]); | 501 assertNotNullNorUndefined(cvox.Earcon[value.earconId]); |
| 499 } | 502 } |
| 500 for (var key in Output.STATE_INFO_) { | 503 for (var key in Output.STATE_INFO_) { |
| 501 var value = Output.STATE_INFO_[key]; | 504 var value = Output.STATE_INFO_[key]; |
| 502 for (innerKey in value) { | 505 for (innerKey in value) { |
| 503 var innerValue = value[innerKey]; | 506 var innerValue = value[innerKey]; |
| 504 Msgs.getMsg(innerValue.msgId); | 507 Msgs.getMsg(innerValue.msgId); |
| 505 Msgs.getMsg(innerValue.msgId + '_brl'); | 508 Msgs.getMsg(innerValue.msgId + '_brl'); |
| 506 assertFalse(/[A-Z]+/.test(innerValue.msgId)); | 509 assertFalse(/[A-Z]+/.test(innerValue.msgId)); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 <div role="row" tabindex=0 aria-label="start"></div> | 658 <div role="row" tabindex=0 aria-label="start"></div> |
| 656 <div role="row" tabindex=0 aria-label="end"></div> | 659 <div role="row" tabindex=0 aria-label="end"></div> |
| 657 */}, | 660 */}, |
| 658 function(root) { | 661 function(root) { |
| 659 var r1 = cursors.Range.fromNode(root.firstChild); | 662 var r1 = cursors.Range.fromNode(root.firstChild); |
| 660 var r2 = cursors.Range.fromNode(root.lastChild); | 663 var r2 = cursors.Range.fromNode(root.lastChild); |
| 661 assertEquals('start|Row', | 664 assertEquals('start|Row', |
| 662 new Output().withSpeech(r1, r2).speechOutputForTest.string_); | 665 new Output().withSpeech(r1, r2).speechOutputForTest.string_); |
| 663 }); | 666 }); |
| 664 }); | 667 }); |
| OLD | NEW |