OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 mockFeedback.replay(); | 89 mockFeedback.replay(); |
90 }); | 90 }); |
91 }); | 91 }); |
92 | 92 |
93 TEST_F('LiveRegionsTest', 'LiveRegionChangeAtomic', function() { | 93 TEST_F('LiveRegionsTest', 'LiveRegionChangeAtomic', function() { |
94 LiveRegions.LIVE_REGION_QUEUE_TIME_MS = 0; | 94 LiveRegions.LIVE_REGION_QUEUE_TIME_MS = 0; |
95 var mockFeedback = this.createMockFeedback(); | 95 var mockFeedback = this.createMockFeedback(); |
96 this.runWithLoadedTree( | 96 this.runWithLoadedTree( |
97 function() {/*! | 97 function() {/*! |
98 <div id="live" aria-live="polite" aria-atomic="true"> | 98 <div id="live" aria-live="polite" aria-atomic="true"> |
99 <div id="a"></div><div id="b">Bravo</div><div id="c"></div> | 99 <div></div><div>Bravo</div><div></div> |
100 </div> | 100 </div> |
101 <button id="go">Go</button> | 101 <button id="go">Go</button> |
102 <script> | 102 <script> |
103 document.getElementById('go').addEventListener('click', function() { | 103 document.getElementById('go').addEventListener('click', function() { |
104 document.getElementById('c').textContent = 'Charlie'; | 104 document.querySelectorAll('div div')[2].textContent = 'Charlie'; |
105 document.getElementById('a').textContent = 'Alpha'; | 105 document.querySelectorAll('div div')[0].textContent = 'Alpha'; |
David Tseng
2017/04/03 17:20:18
nit: unsure why this was changed (prvious form had
David Tseng
2017/04/03 17:21:48
Just read DOminic's comment on this. Please ignore
| |
106 }, false); | 106 }, false); |
107 </script> | 107 </script> |
108 */}, | 108 */}, |
109 function(rootNode) { | 109 function(rootNode) { |
110 var go = rootNode.find({ role: RoleType.BUTTON }); | 110 var go = rootNode.find({ role: RoleType.BUTTON }); |
111 mockFeedback.call(go.doDefault.bind(go)) | 111 mockFeedback.call(go.doDefault.bind(go)) |
112 .expectCategoryFlushSpeech('Alpha Bravo Charlie') | 112 .expectCategoryFlushSpeech('Alpha Bravo Charlie') |
113 mockFeedback.replay(); | 113 mockFeedback.replay(); |
114 }); | 114 }); |
115 }); | 115 }); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
243 var focusAfterNodeChange = window.setTimeout.bind(window, function() { | 243 var focusAfterNodeChange = window.setTimeout.bind(window, function() { |
244 root.firstChild.nextSibling.focus(); | 244 root.firstChild.nextSibling.focus(); |
245 }, 1000); | 245 }, 1000); |
246 mockFeedback.call(focusAfterNodeChange) | 246 mockFeedback.call(focusAfterNodeChange) |
247 .expectSpeech('hello!') | 247 .expectSpeech('hello!') |
248 .expectNextSpeechUtteranceIsNot('hello!') | 248 .expectNextSpeechUtteranceIsNot('hello!') |
249 .expectNextSpeechUtteranceIsNot('hello!') ; | 249 .expectNextSpeechUtteranceIsNot('hello!') ; |
250 mockFeedback.replay(); | 250 mockFeedback.replay(); |
251 }); | 251 }); |
252 }); | 252 }); |
OLD | NEW |