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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 .call(this.doCmd('continuousRead')) | 209 .call(this.doCmd('continuousRead')) |
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', 'LiveRegionAddElement', function() { | |
220 var mockFeedback = this.createMockFeedback(); | |
221 this.runWithLoadedTree( | |
222 function() {/*! | |
223 <h1>Document with live region</h1> | |
224 <p id="live" aria-live="polite"></p> | |
225 <button id="go">Go</button> | |
226 <script> | |
227 document.getElementById('go').addEventListener('click', function() { | |
228 document.getElementById('live').innerHTML = 'Hello, world'; | |
229 }, false); | |
230 </script> | |
231 */}, | |
232 function(rootNode) { | |
233 var go = rootNode.find({ role: RoleType.button }); | |
234 mockFeedback.call(go.doDefault.bind(go)) | |
235 .expectSpeech('Hello, world'); | |
236 mockFeedback.replay(); | |
237 }); | |
238 }); | |
239 | |
240 TEST_F('BackgroundTest', 'LiveRegionRemoveElement', function() { | |
241 var mockFeedback = this.createMockFeedback(); | |
242 this.runWithLoadedTree( | |
243 function() {/*! | |
244 <h1>Document with live region</h1> | |
245 <p id="live" aria-live="polite" aria-relevant="removals">Hello, world</p> | |
246 <button id="go">Go</button> | |
247 <script> | |
248 document.getElementById('go').addEventListener('click', function() { | |
249 document.getElementById('live').innerHTML = ''; | |
250 }, false); | |
251 </script> | |
252 */}, | |
253 function(rootNode) { | |
254 var go = rootNode.find({ role: RoleType.button }); | |
255 go.doDefault(); | |
256 mockFeedback.expectSpeech('removed:') | |
257 .expectSpeech('Hello, world'); | |
258 mockFeedback.replay(); | |
259 }); | |
260 }); | |
261 | |
262 TEST_F('BackgroundTest', 'InitialFocus', function() { | 219 TEST_F('BackgroundTest', 'InitialFocus', function() { |
263 var mockFeedback = this.createMockFeedback(); | 220 var mockFeedback = this.createMockFeedback(); |
264 this.runWithLoadedTree('<a href="a">a</a>', | 221 this.runWithLoadedTree('<a href="a">a</a>', |
265 function(rootNode) { | 222 function(rootNode) { |
266 mockFeedback.expectSpeech('a') | 223 mockFeedback.expectSpeech('a') |
267 .expectSpeech('Link'); | 224 .expectSpeech('Link'); |
268 mockFeedback.replay(); | 225 mockFeedback.replay(); |
269 }); | 226 }); |
270 }); | 227 }); |
271 | 228 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 .call(off) | 460 .call(off) |
504 .call(focusThen.bind(this, rootNode.find({ role: 'link' }), on)) | 461 .call(focusThen.bind(this, rootNode.find({ role: 'link' }), on)) |
505 .call(focusThen.bind(this, rootNode.find({ role: 'textField' }))) | 462 .call(focusThen.bind(this, rootNode.find({ role: 'textField' }))) |
506 .expectNextSpeechUtteranceIsNot('a') | 463 .expectNextSpeechUtteranceIsNot('a') |
507 .expectSpeech('Edit text'); | 464 .expectSpeech('Edit text'); |
508 | 465 |
509 mockFeedback.replay(); | 466 mockFeedback.replay(); |
510 } | 467 } |
511 ); | 468 ); |
512 }); | 469 }); |
OLD | NEW |