| 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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 this.runWithLoadedTree(function(root) {/*! | 863 this.runWithLoadedTree(function(root) {/*! |
| 864 <input type="submit" aria-label="foo" value="foo"></input> | 864 <input type="submit" aria-label="foo" value="foo"></input> |
| 865 */}, function(root) { | 865 */}, function(root) { |
| 866 var btn = root.find({role: RoleType.button}); | 866 var btn = root.find({role: RoleType.button}); |
| 867 mockFeedback.call(btn.focus.bind(btn)) | 867 mockFeedback.call(btn.focus.bind(btn)) |
| 868 .expectSpeech('foo') | 868 .expectSpeech('foo') |
| 869 .expectSpeech('Button') | 869 .expectSpeech('Button') |
| 870 .replay(); | 870 .replay(); |
| 871 }); | 871 }); |
| 872 }); | 872 }); |
| 873 |
| 874 TEST_F('BackgroundTest', 'ActiveDescendantOnPopupButton', function() { |
| 875 var mockFeedback = this.createMockFeedback(); |
| 876 this.runWithLoadedTree(function(root) {/*! |
| 877 <button id="a" aria-activedescendant="b" aria-haspopup="true">a</button> |
| 878 <p id="b">b</p> |
| 879 <p id="c">c</p> |
| 880 <script> |
| 881 var alt = false; |
| 882 setInterval(function() { |
| 883 var id = alt ? 'b' : 'c'; |
| 884 document.getElementById('a').setAttribute('aria-activedescendant', id); |
| 885 alt = !alt; |
| 886 }, 500); |
| 887 </script> |
| 888 */}, function(root) { |
| 889 root.find({role: RoleType.popUpButton}).focus(); |
| 890 mockFeedback.expectSpeech('a') |
| 891 .expectSpeech('b') |
| 892 .expectSpeech('Button') |
| 893 .expectSpeech('b') |
| 894 .expectSpeech('c') |
| 895 .expectSpeech('b') |
| 896 .replay(); |
| 897 }); |
| 898 }); |
| OLD | NEW |