| 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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 this.runWithLoadedTree(this.iframesDoc, function(rootNode) { | 623 this.runWithLoadedTree(this.iframesDoc, function(rootNode) { |
| 624 chrome.automation.getDesktop(function(desktopNode) { | 624 chrome.automation.getDesktop(function(desktopNode) { |
| 625 runTestIfIframeIsLoaded(rootNode); | 625 runTestIfIframeIsLoaded(rootNode); |
| 626 | 626 |
| 627 desktopNode.addEventListener('loadComplete', function(evt) { | 627 desktopNode.addEventListener('loadComplete', function(evt) { |
| 628 runTestIfIframeIsLoaded(rootNode); | 628 runTestIfIframeIsLoaded(rootNode); |
| 629 }, true); | 629 }, true); |
| 630 }); | 630 }); |
| 631 }); | 631 }); |
| 632 }); | 632 }); |
| 633 |
| 634 TEST_F('BackgroundTest', 'SelectOptionSelected', function() { |
| 635 var mockFeedback = this.createMockFeedback(); |
| 636 this.runWithLoadedTree(function() {/*! |
| 637 <select> |
| 638 <option>apple |
| 639 <option>banana |
| 640 <option>grapefruit |
| 641 </select> |
| 642 */}, function(root) { |
| 643 var select = root.find({role: 'popUpButton'}); |
| 644 var clickSelect = select.doDefault.bind(select); |
| 645 var lastOption = select.lastChild.lastChild; |
| 646 var selectLastOption = lastOption.doDefault.bind(lastOption); |
| 647 |
| 648 mockFeedback.call(clickSelect) |
| 649 .expectSpeech('apple') |
| 650 .expectSpeech('Button') |
| 651 .call(selectLastOption) |
| 652 .expectNextSpeechUtteranceIsNot('apple') |
| 653 .expectSpeech('grapefruit') |
| 654 .replay(); |
| 655 }); |
| 656 }); |
| OLD | NEW |