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 // Include test fixture. | 5 // Include test fixture. |
6 GEN_INCLUDE(['../../testing/chromevox_next_e2e_test_base.js', | 6 GEN_INCLUDE(['../../testing/chromevox_next_e2e_test_base.js', |
7 '../../testing/assert_additions.js']); | 7 '../../testing/assert_additions.js']); |
8 | 8 |
9 GEN_INCLUDE(['../../testing/mock_feedback.js']); | 9 GEN_INCLUDE(['../../testing/mock_feedback.js']); |
10 | 10 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 mockFeedback.call(doCmd('nextHeading')) | 103 mockFeedback.call(doCmd('nextHeading')) |
104 .expectSpeech('Heading 1', 'charlie') | 104 .expectSpeech('Heading 1', 'charlie') |
105 .expectBraille('h1 charlie'); | 105 .expectBraille('h1 charlie'); |
106 mockFeedback.call(doCmd('nextHeading')) | 106 mockFeedback.call(doCmd('nextHeading')) |
107 .expectSpeech('Heading 2', 'foxtraut') | 107 .expectSpeech('Heading 2', 'foxtraut') |
108 .expectBraille('h2 foxtraut'); | 108 .expectBraille('h2 foxtraut'); |
109 mockFeedback.call(doCmd('previousHeading')) | 109 mockFeedback.call(doCmd('previousHeading')) |
110 .expectSpeech('Heading 1', 'charlie') | 110 .expectSpeech('Heading 1', 'charlie') |
111 .expectBraille('h1 charlie'); | 111 .expectBraille('h1 charlie'); |
112 | 112 |
113 mockFeedback.call(doCmd('nextElement')) | 113 mockFeedback.call(doCmd('nextObject')) |
114 .expectSpeech('delta', 'Link') | 114 .expectSpeech('delta', 'Link') |
115 .expectBraille('delta lnk'); | 115 .expectBraille('delta lnk'); |
116 mockFeedback.call(doCmd('nextElement')) | 116 mockFeedback.call(doCmd('nextObject')) |
117 .expectSpeech('echo', 'Link') | 117 .expectSpeech('echo', 'Link') |
118 .expectBraille('echo lnk'); | 118 .expectBraille('echo lnk'); |
119 mockFeedback.call(doCmd('nextElement')) | 119 mockFeedback.call(doCmd('nextObject')) |
120 .expectSpeech('Heading 2', 'foxtraut') | 120 .expectSpeech('Heading 2', 'foxtraut') |
121 .expectBraille('h2 foxtraut'); | 121 .expectBraille('h2 foxtraut'); |
122 mockFeedback.call(doCmd('nextElement')) | 122 mockFeedback.call(doCmd('nextObject')) |
123 .expectSpeech('end') | 123 .expectSpeech('end') |
124 .expectBraille('end'); | 124 .expectBraille('end'); |
125 mockFeedback.call(doCmd('previousElement')) | 125 mockFeedback.call(doCmd('previousObject')) |
126 .expectSpeech('Heading 2', 'foxtraut') | 126 .expectSpeech('Heading 2', 'foxtraut') |
127 .expectBraille('h2 foxtraut'); | 127 .expectBraille('h2 foxtraut'); |
128 mockFeedback.call(doCmd('nextLine')) | 128 mockFeedback.call(doCmd('nextLine')) |
129 .expectSpeech('end', 'of test') | 129 .expectSpeech('end', 'of test') |
130 .expectBraille('end of test'); | 130 .expectBraille('end of test'); |
131 | 131 |
132 mockFeedback.call(doCmd('goToBeginning')) | 132 mockFeedback.call(doCmd('jumpToTop')) |
133 .expectSpeech('start') | 133 .expectSpeech('start') |
134 .expectBraille('start'); | 134 .expectBraille('start'); |
135 mockFeedback.call(doCmd('goToEnd')) | 135 mockFeedback.call(doCmd('jumpToBottom')) |
136 .expectSpeech('of test') | 136 .expectSpeech('of test') |
137 .expectBraille('of test'); | 137 .expectBraille('of test'); |
138 | 138 |
139 mockFeedback.replay(); | 139 mockFeedback.replay(); |
140 }); | 140 }); |
141 }); | 141 }); |
142 | 142 |
143 TEST_F('BackgroundTest', 'CaretNavigation', function() { | 143 TEST_F('BackgroundTest', 'CaretNavigation', function() { |
144 // TODO(plundblad): Add braille expectaions when crbug.com/523285 is fixed. | 144 // TODO(plundblad): Add braille expectaions when crbug.com/523285 is fixed. |
145 var mockFeedback = this.createMockFeedback(); | 145 var mockFeedback = this.createMockFeedback(); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 .expectSpeech('banana', /3 of 3/) | 199 .expectSpeech('banana', /3 of 3/) |
200 .expectBraille('banana mnuitm 3/3'); | 200 .expectBraille('banana mnuitm 3/3'); |
201 mockFeedback.replay(); | 201 mockFeedback.replay(); |
202 }); | 202 }); |
203 }); | 203 }); |
204 | 204 |
205 TEST_F('BackgroundTest', 'ContinuousRead', function() { | 205 TEST_F('BackgroundTest', 'ContinuousRead', function() { |
206 var mockFeedback = this.createMockFeedback(); | 206 var mockFeedback = this.createMockFeedback(); |
207 this.runWithLoadedTree(this.linksAndHeadingsDoc, function() { | 207 this.runWithLoadedTree(this.linksAndHeadingsDoc, function() { |
208 mockFeedback.expectSpeech('start') | 208 mockFeedback.expectSpeech('start') |
209 .call(this.doCmd('continuousRead')) | 209 .call(this.doCmd('readFromHere')) |
210 .expectSpeech( | 210 .expectSpeech( |
211 'start', | 211 'start', |
212 'alpha', 'Link', | 212 'alpha', 'Link', |
213 'beta', 'Link', | 213 'beta', 'Link', |
214 'Heading 1', 'charlie'); | 214 'Heading 1', 'charlie'); |
215 mockFeedback.replay(); | 215 mockFeedback.replay(); |
216 }); | 216 }); |
217 }); | 217 }); |
218 | 218 |
219 TEST_F('BackgroundTest', 'InitialFocus', function() { | 219 TEST_F('BackgroundTest', 'InitialFocus', function() { |
(...skipping 29 matching lines...) Expand all Loading... |
249 .call(function() { | 249 .call(function() { |
250 // When shown, the context menu pushes a new message loop so test | 250 // When shown, the context menu pushes a new message loop so test |
251 // messages sent to the browser do not get processed. Ensure we | 251 // messages sent to the browser do not get processed. Ensure we |
252 // exit the context menu here. | 252 // exit the context menu here. |
253 go.showContextMenu(); | 253 go.showContextMenu(); |
254 }); | 254 }); |
255 mockFeedback.replay(); | 255 mockFeedback.replay(); |
256 | 256 |
257 var go = rootNode.find({ role: RoleType.link }); | 257 var go = rootNode.find({ role: RoleType.link }); |
258 this.listenOnce(go, 'focus', function(e) { | 258 this.listenOnce(go, 'focus', function(e) { |
259 this.doCmd('showContextMenu')(); | 259 this.doCmd('contextMenu')(); |
260 }.bind(this), true); | 260 }.bind(this), true); |
261 go.focus(); | 261 go.focus(); |
262 }.bind(this)); | 262 }.bind(this)); |
263 }); | 263 }); |
264 | 264 |
265 TEST_F('BackgroundTest', 'BrailleRouting', function() { | 265 TEST_F('BackgroundTest', 'BrailleRouting', function() { |
266 var mockFeedback = this.createMockFeedback(); | 266 var mockFeedback = this.createMockFeedback(); |
267 var route = function(position) { | 267 var route = function(position) { |
268 assertTrue(global.backgroundObj.onBrailleKeyEvent( | 268 assertTrue(global.backgroundObj.onBrailleKeyEvent( |
269 {command: cvox.BrailleKeyCommand.ROUTING, | 269 {command: cvox.BrailleKeyCommand.ROUTING, |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 <input type=checkbox> | 367 <input type=checkbox> |
368 <input type=checkbox checked> | 368 <input type=checkbox checked> |
369 <input> | 369 <input> |
370 <select multiple><option>1</option></select> | 370 <select multiple><option>1</option></select> |
371 <select><option>2</option></select> | 371 <select><option>2</option></select> |
372 <input type=range value=5> | 372 <input type=range value=5> |
373 */}, | 373 */}, |
374 function(rootNode) { | 374 function(rootNode) { |
375 var doCmd = this.doCmd.bind(this); | 375 var doCmd = this.doCmd.bind(this); |
376 | 376 |
377 mockFeedback.call(doCmd('nextElement')) | 377 mockFeedback.call(doCmd('nextObject')) |
378 .expectSpeech('MyLink') | 378 .expectSpeech('MyLink') |
379 .expectEarcon(cvox.Earcon.LINK) | 379 .expectEarcon(cvox.Earcon.LINK) |
380 .call(doCmd('nextElement')) | 380 .call(doCmd('nextObject')) |
381 .expectSpeech('MyButton') | 381 .expectSpeech('MyButton') |
382 .expectEarcon(cvox.Earcon.BUTTON) | 382 .expectEarcon(cvox.Earcon.BUTTON) |
383 .call(doCmd('nextElement')) | 383 .call(doCmd('nextObject')) |
384 .expectSpeech('Check box') | 384 .expectSpeech('Check box') |
385 .expectEarcon(cvox.Earcon.CHECK_OFF) | 385 .expectEarcon(cvox.Earcon.CHECK_OFF) |
386 .call(doCmd('nextElement')) | 386 .call(doCmd('nextObject')) |
387 .expectSpeech('Check box') | 387 .expectSpeech('Check box') |
388 .expectEarcon(cvox.Earcon.CHECK_ON) | 388 .expectEarcon(cvox.Earcon.CHECK_ON) |
389 .call(doCmd('nextElement')) | 389 .call(doCmd('nextObject')) |
390 .expectSpeech('Edit text') | 390 .expectSpeech('Edit text') |
391 .expectEarcon(cvox.Earcon.EDITABLE_TEXT) | 391 .expectEarcon(cvox.Earcon.EDITABLE_TEXT) |
392 .call(doCmd('nextElement')) | 392 .call(doCmd('nextObject')) |
393 .expectSpeech('List box') | 393 .expectSpeech('List box') |
394 .expectEarcon(cvox.Earcon.LISTBOX) | 394 .expectEarcon(cvox.Earcon.LISTBOX) |
395 .call(doCmd('nextElement')) | 395 .call(doCmd('nextObject')) |
396 .expectSpeech('Button', 'has pop up') | 396 .expectSpeech('Button', 'has pop up') |
397 .expectEarcon(cvox.Earcon.POP_UP_BUTTON) | 397 .expectEarcon(cvox.Earcon.POP_UP_BUTTON) |
398 .call(doCmd('nextElement')) | 398 .call(doCmd('nextObject')) |
399 .expectSpeech(/slider/) | 399 .expectSpeech(/slider/) |
400 .expectEarcon(cvox.Earcon.SLIDER); | 400 .expectEarcon(cvox.Earcon.SLIDER); |
401 | 401 |
402 mockFeedback.replay(); | 402 mockFeedback.replay(); |
403 }.bind(this)); | 403 }.bind(this)); |
404 }); | 404 }); |
405 | 405 |
406 TEST_F('BackgroundTest', 'ToggleChromeVoxVersion', function() { | 406 TEST_F('BackgroundTest', 'ToggleChromeVoxVersion', function() { |
407 var mockFeedback = this.createMockFeedback(); | 407 var mockFeedback = this.createMockFeedback(); |
408 this.runWithLoadedTree(this.linksAndHeadingsDoc, function() { | 408 this.runWithLoadedTree(this.linksAndHeadingsDoc, function() { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 var didFocus = false; | 522 var didFocus = false; |
523 iframe.focus = function() { | 523 iframe.focus = function() { |
524 didFocus = true; | 524 didFocus = true; |
525 }; | 525 }; |
526 var b = global.backgroundObj; | 526 var b = global.backgroundObj; |
527 b.currentRange_ = cursors.Range.fromNode(button); | 527 b.currentRange_ = cursors.Range.fromNode(button); |
528 b.onGotCommand('previousElement'); | 528 b.onGotCommand('previousElement'); |
529 assertFalse(didFocus); | 529 assertFalse(didFocus); |
530 }.bind(this)); | 530 }.bind(this)); |
531 }); | 531 }); |
OLD | NEW |