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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 var editable = rootNode.find({ role: RoleType.textField }); | 389 var editable = rootNode.find({ role: RoleType.textField }); |
390 var nonEditable = rootNode.find({ role: RoleType.paragraph }); | 390 var nonEditable = rootNode.find({ role: RoleType.paragraph }); |
391 | 391 |
392 this.listenOnce(editable, 'focus', assertExists); | 392 this.listenOnce(editable, 'focus', assertExists); |
393 this.listenOnce(nonEditable, 'focus', assertDoesntExist); | 393 this.listenOnce(nonEditable, 'focus', assertDoesntExist); |
394 | 394 |
395 editable.focus(); | 395 editable.focus(); |
396 nonEditable.focus(); | 396 nonEditable.focus(); |
397 }.bind(this)); | 397 }.bind(this)); |
398 }); | 398 }); |
| 399 |
| 400 TEST_F('BackgroundTest', 'EarconsForControls', function() { |
| 401 var mockFeedback = this.createMockFeedback(); |
| 402 this.runWithLoadedTree( |
| 403 function() {/*! |
| 404 <p>Initial focus will be on something that's not a control.</p> |
| 405 <a href="#">MyLink</a> |
| 406 <button>MyButton</button> |
| 407 <input type=checkbox> |
| 408 <input type=checkbox checked> |
| 409 <input> |
| 410 <select multiple><option>1</option></select> |
| 411 <select><option>2</option></select> |
| 412 <input type=range value=5> |
| 413 */}, |
| 414 function(rootNode) { |
| 415 var doCmd = this.doCmd.bind(this); |
| 416 |
| 417 mockFeedback.call(doCmd('nextElement')) |
| 418 .expectSpeech('MyLink') |
| 419 .expectEarcon(cvox.Earcon.LINK) |
| 420 .call(doCmd('nextElement')) |
| 421 .expectSpeech('MyButton') |
| 422 .expectEarcon(cvox.Earcon.BUTTON) |
| 423 .call(doCmd('nextElement')) |
| 424 .expectSpeech('Check box') |
| 425 .expectEarcon(cvox.Earcon.CHECK_OFF) |
| 426 .call(doCmd('nextElement')) |
| 427 .expectSpeech('Check box') |
| 428 .expectEarcon(cvox.Earcon.CHECK_ON) |
| 429 .call(doCmd('nextElement')) |
| 430 .expectSpeech('Edit text') |
| 431 .expectEarcon(cvox.Earcon.EDITABLE_TEXT) |
| 432 .call(doCmd('nextElement')) |
| 433 .expectSpeech('List box') |
| 434 .expectEarcon(cvox.Earcon.LISTBOX) |
| 435 .call(doCmd('nextElement')) |
| 436 .expectSpeech('Button', 'has pop up') |
| 437 .expectEarcon(cvox.Earcon.POP_UP_BUTTON) |
| 438 .call(doCmd('nextElement')) |
| 439 .expectSpeech(/slider/) |
| 440 .expectEarcon(cvox.Earcon.SLIDER); |
| 441 |
| 442 mockFeedback.replay(); |
| 443 }.bind(this)); |
| 444 }); |
OLD | NEW |