Chromium Code Reviews| 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 * Test fixture for output.js. | 9 * Test fixture for output.js. |
| 10 * @constructor | 10 * @constructor |
| 11 * @extends {ChromeVoxNextE2ETestBase} | 11 * @extends {ChromeVoxNextE2ETestBase} |
| 12 */ | 12 */ |
| 13 function OutputE2ETest() { | 13 function OutputE2ETest() { |
| 14 ChromeVoxNextE2ETest.call(this); | 14 ChromeVoxNextE2ETest.call(this); |
| 15 } | 15 } |
| 16 | 16 |
| 17 OutputE2ETest.prototype = { | 17 OutputE2ETest.prototype = { |
| 18 __proto__: ChromeVoxNextE2ETest.prototype, | 18 __proto__: ChromeVoxNextE2ETest.prototype, |
| 19 | 19 |
| 20 /** @override */ | 20 /** @override */ |
| 21 setUp: function() { | 21 setUp: function() { |
| 22 window.Dir = AutomationUtil.Dir; | 22 window.Dir = AutomationUtil.Dir; |
| 23 } | 23 } |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 TEST_F('OutputE2ETest', 'RenderBasic', function() { | 26 TEST_F('OutputE2ETest', 'Link', function() { |
| 27 this.runWithLoadedTree('<a href="#">Click here</a>', | 27 this.runWithLoadedTree('<a href="#">Click here</a>', |
| 28 function(root) { | 28 function(root) { |
| 29 var link = root.firstChild.firstChild; | 29 var link = root.firstChild.firstChild; |
| 30 var range = cursors.Range.fromNode(link); | 30 var range = cursors.Range.fromNode(link); |
| 31 var o = new Output().withSpeechAndBraille(range, null, 'navigate'); | 31 var o = new Output().withSpeechAndBraille(range, null, 'navigate'); |
| 32 assertEqualsJSON({string_: 'Click hereLink', 'spans_': [ | 32 assertEqualsJSON({string_: 'Click hereLink', 'spans_': [ |
| 33 {value: {}, start: 0, end: 0}, | 33 {value: {}, start: 0, end: 0}, |
| 34 {value: 'name', start: 0, end: 10}, | 34 {value: 'name', start: 0, end: 10}, |
| 35 | 35 |
| 36 // Split markers added for empty attributes. | 36 // Split markers added for empty attributes. |
| 37 {value: {}, start: 10, end: 10}, | 37 {value: {}, start: 10, end: 10}, |
| 38 {value: {}, start: 10, end: 10}, | 38 {value: {}, start: 10, end: 10}, |
| 39 {value: {}, start: 10, end: 10}, | 39 {value: {}, start: 10, end: 10}, |
| 40 | 40 |
| 41 // Link earcon. | 41 // Link earcon. |
| 42 {value: {}, start: 10, end: 14} | 42 {value: {}, start: 10, end: 14} |
| 43 ]}, | 43 ]}, |
| 44 o.getBuffer()); | 44 o.getBuffer()); |
| 45 }); | 45 }); |
| 46 }); | 46 }); |
| 47 | |
| 48 TEST_F('OutputE2ETest', 'Heading', function() { | |
| 49 this.runWithLoadedTree('<h2>Top news</h2>', | |
| 50 function(root) { | |
| 51 var heading = root.firstChild.firstChild; | |
| 52 var range = cursors.Range.fromNode(heading); | |
| 53 var o = new Output().withSpeechAndBraille(range, null, 'navigate'); | |
| 54 assertEqualsJSON({string_: 'Heading 2Top news', 'spans_': [ | |
| 55 {value: {}, start: 0, end: 0}, | |
| 56 {value: 'hierarchicalLevel', start: 8, end: 9}, | |
| 57 | |
| 58 // Split markers added for empty attributes. | |
| 59 {value: {}, start: 9, end: 9}, | |
| 60 | |
| 61 // Value text. | |
| 62 {value: 'value', start: 9, end: 17} | |
| 63 ]}, | |
| 64 o.getBuffer()); | |
| 65 }); | |
|
Peter Lundblad
2015/04/02 09:43:54
Check the braille output?
| |
| 66 }); | |
| OLD | NEW |