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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 }); | 184 }); |
185 }); | 185 }); |
186 | 186 |
187 TEST_F('OutputE2ETest', 'Input', function() { | 187 TEST_F('OutputE2ETest', 'Input', function() { |
188 this.runWithLoadedTree( | 188 this.runWithLoadedTree( |
189 '<input type="text"></input>' + | 189 '<input type="text"></input>' + |
190 '<input type="email"></input>' + | 190 '<input type="email"></input>' + |
191 '<input type="password"></input>' + | 191 '<input type="password"></input>' + |
192 '<input type="tel"></input>' + | 192 '<input type="tel"></input>' + |
193 '<input type="number"></input>' + | 193 '<input type="number"></input>' + |
194 // temporarily disabled to handle time role. crbug.com/480861 | 194 '<input type="time"></input>' + |
195 // '<input type="time"></input>' + | |
196 '<input type="date"></input>', | 195 '<input type="date"></input>', |
197 function(root) { | 196 function(root) { |
198 var expected = {string_: '', 'spans_': [ | 197 var expected = {string_: '', 'spans_': [ |
199 {value: 'name', start: 0, end: 0}, | 198 {value: 'name', start: 0, end: 0}, |
200 | 199 |
201 // Earcon | 200 // Earcon |
202 {value: {}, start: 0, end: 0}, | 201 {value: {}, start: 0, end: 0}, |
203 | 202 |
204 // Selection span. | 203 // Selection span. |
205 {value: {startIndex: 0, endIndex: 0}, start: 1, end: 1}, | 204 {value: {startIndex: 0, endIndex: 0}, start: 1, end: 1}, |
206 | 205 |
207 {value: 'value', start: 1, end: 1} | 206 {value: 'value', start: 1, end: 1} |
208 ]}; | 207 ]}; |
209 | 208 |
210 var expectedValues = [ | 209 var expectedValues = [ |
211 '||Edit text', | 210 '||Edit text', |
212 '||Edit text, email entry', | 211 '||Edit text, email entry', |
213 '||Password edit text', | 212 '||Password edit text', |
214 '||Edit text, number entry', | 213 '||Edit text, number entry', |
215 {string_: '||Spin button', spans_: [{value: 'name', start: 0, end: 0}, | 214 {string_: '||Spin button', spans_: [{value: 'name', start: 0, end: 0}, |
216 {value: {}, start: 0, end: 0}, | 215 {value: {}, start: 0, end: 0}, |
217 {value: {startIndex: 0, endIndex: 0}, start: 1, end: 1}, | 216 {value: {startIndex: 0, endIndex: 0}, start: 1, end: 1}, |
218 {value: 'value', start: 1, end: 1}, | 217 {value: 'value', start: 1, end: 1}, |
219 {value: 'role', start: 2, end: 13}]}, | 218 {value: 'role', start: 2, end: 13}]}, |
220 // temporarily disabled to handle time role. crbug.com/480861 | 219 {string_: '||inputTime', spans_: [{value: 'name', start: 0, end: 0}, |
221 // {string_: '||Time', spans_: [{value: 'name', start: 0, end: 0}, | 220 {value: 'value', start: 1, end: 1}, |
222 // {value: 'value', start: 1, end: 1}, | 221 {value: 'role', start: 2, end: 11}]}, |
223 // {value: 'role', start: 2, end: 6}]}, | |
224 {string_: '||Date control', spans_: [{value: 'name', start: 0, end: 0}, | 222 {string_: '||Date control', spans_: [{value: 'name', start: 0, end: 0}, |
225 {value: 'value', start: 1, end: 1}, | 223 {value: 'value', start: 1, end: 1}, |
226 {value: 'role', start: 2, end: 14}]} | 224 {value: 'role', start: 2, end: 14}]} |
227 ]; | 225 ]; |
228 | 226 |
229 var el = root.firstChild.firstChild; | 227 var el = root.firstChild.firstChild; |
230 expectedValues.forEach(function(expectedValue) { | 228 expectedValues.forEach(function(expectedValue) { |
231 var range = cursors.Range.fromNode(el); | 229 var range = cursors.Range.fromNode(el); |
232 var o = new Output().withSpeechAndBraille(range, null, 'navigate'); | 230 var o = new Output().withSpeechAndBraille(range, null, 'navigate'); |
233 if (typeof expectedValue == 'object') { | 231 if (typeof expectedValue == 'object') { |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 | 363 |
366 SYNC_TEST_F('OutputE2ETest', 'MessageIdValidity', function() { | 364 SYNC_TEST_F('OutputE2ETest', 'MessageIdValidity', function() { |
367 for (var key in Output.ROLE_INFO_) { | 365 for (var key in Output.ROLE_INFO_) { |
368 var value = Output.ROLE_INFO_[key]; | 366 var value = Output.ROLE_INFO_[key]; |
369 cvox.ChromeVox.msgs.getMsg(value.msgId); | 367 cvox.ChromeVox.msgs.getMsg(value.msgId); |
370 assertFalse(/[A-Z]+/.test(value.msgId)); | 368 assertFalse(/[A-Z]+/.test(value.msgId)); |
371 if (value.earconId) | 369 if (value.earconId) |
372 assertNotNullNorUndefined(cvox.AbstractEarcons[value.earconId]); | 370 assertNotNullNorUndefined(cvox.AbstractEarcons[value.earconId]); |
373 } | 371 } |
374 }); | 372 }); |
OLD | NEW |