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 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 el = el.nextSibling; | 131 el = el.nextSibling; |
132 range = cursors.Range.fromNode(el); | 132 range = cursors.Range.fromNode(el); |
133 o = new Output().withSpeechAndBraille(range, null, 'navigate'); | 133 o = new Output().withSpeechAndBraille(range, null, 'navigate'); |
134 assertEqualsJSON({string_: 'Heading 6f', 'spans_': [ | 134 assertEqualsJSON({string_: 'Heading 6f', 'spans_': [ |
135 // Attributes. | 135 // Attributes. |
136 {value: 'name', start: 9, end: 10} | 136 {value: 'name', start: 9, end: 10} |
137 ]}, o.toSpannable()); | 137 ]}, o.toSpannable()); |
138 }); | 138 }); |
139 }); | 139 }); |
| 140 |
| 141 TEST_F('OutputE2ETest', 'Audio', function() { |
| 142 this.runWithLoadedTree('<audio src="foo.mp3" controls></audio>', |
| 143 function(root) { |
| 144 var el = root.firstChild.firstChild.firstChild.firstChild; |
| 145 var range = cursors.Range.fromNode(el); |
| 146 var o = new Output().withSpeechAndBraille(range, null, 'navigate'); |
| 147 assertEqualsJSON({string_: 'media control|Tool bar|||play|Button', |
| 148 spans_: |
| 149 // Entered container toolbar. |
| 150 |
| 151 // Button. |
| 152 [{value: 'name', start: 23, end: 23}, |
| 153 {value: 'value', start: 24, end: 24}, |
| 154 {value: 'description', start: 25, end: 29}, |
| 155 {value: 'role', start: 30, end: 36}, |
| 156 |
| 157 // Button earcon. |
| 158 {value: {}, start: 30, end: 36}] |
| 159 }, o.toSpannableForTest()); |
| 160 |
| 161 el = el.nextSibling; |
| 162 var prevRange = range; |
| 163 range = cursors.Range.fromNode(el); |
| 164 var o = new Output().withSpeechAndBraille(range, prevRange, 'navigate'); |
| 165 assertEqualsJSON({string_: '0, , slider|audio time scrubber', |
| 166 spans_: |
| 167 [{value: 'help', start: 12, end: 31}] |
| 168 }, o.toSpannableForTest()); |
| 169 }); |
| 170 }); |
OLD | NEW |