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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 </script> | 214 </script> |
215 */}, | 215 */}, |
216 function(rootNode) { | 216 function(rootNode) { |
217 var go = rootNode.find({ role: RoleType.button }); | 217 var go = rootNode.find({ role: RoleType.button }); |
218 mockFeedback.call(go.doDefault.bind(go)) | 218 mockFeedback.call(go.doDefault.bind(go)) |
219 .expectCategoryFlushSpeech('Live1') | 219 .expectCategoryFlushSpeech('Live1') |
220 .expectCategoryFlushSpeech('Live2'); | 220 .expectCategoryFlushSpeech('Live2'); |
221 mockFeedback.replay(); | 221 mockFeedback.replay(); |
222 }); | 222 }); |
223 }); | 223 }); |
| 224 |
| 225 TEST_F('LiveRegionsTest', 'SilentOnNodeChange', function() { |
| 226 var mockFeedback = this.createMockFeedback(); |
| 227 this.runWithLoadedTree(function() {/*! |
| 228 <p>start</p> |
| 229 <button>first</button> |
| 230 <div role="button" id="live" aria-live="polite"> |
| 231 hello! |
| 232 </div> |
| 233 <script> |
| 234 var live = document.getElementById('live'); |
| 235 var pressed = true; |
| 236 setInterval(function() { |
| 237 live.setAttribute('aria-pressed', pressed); |
| 238 pressed = !pressed; |
| 239 }, 50); |
| 240 </script> |
| 241 */}, |
| 242 function(root) { |
| 243 var focusAfterNodeChange = window.setTimeout.bind(window, function() { |
| 244 root.firstChild.nextSibling.focus(); |
| 245 }, 1000); |
| 246 mockFeedback.call(focusAfterNodeChange) |
| 247 .expectSpeech('hello!') |
| 248 .expectNextSpeechUtteranceIsNot('hello!') |
| 249 .expectNextSpeechUtteranceIsNot('hello!') ; |
| 250 mockFeedback.replay(); |
| 251 }); |
| 252 }); |
OLD | NEW |