| 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 | 7 |
| 8 GEN_INCLUDE(['../../testing/mock_tts.js']); | 8 GEN_INCLUDE(['../../testing/mock_tts.js']); |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 <button id="go">Go</button> | 173 <button id="go">Go</button> |
| 174 <script> | 174 <script> |
| 175 document.getElementById('go').addEventListener('click', function() { | 175 document.getElementById('go').addEventListener('click', function() { |
| 176 document.getElementById('live').innerHTML = 'Hello, world'; | 176 document.getElementById('live').innerHTML = 'Hello, world'; |
| 177 }, false); | 177 }, false); |
| 178 </script> | 178 </script> |
| 179 */}, | 179 */}, |
| 180 function(rootNode) { | 180 function(rootNode) { |
| 181 var go = rootNode.find({ role: chrome.automation.RoleType.button }); | 181 var go = rootNode.find({ role: chrome.automation.RoleType.button }); |
| 182 go.doDefault(); | 182 go.doDefault(); |
| 183 cvox.ChromeVox.tts.expectSpeech('Hello, world', testDone); | 183 cvox.ChromeVox.tts.expectSpeech('Hello, world'); |
| 184 cvox.ChromeVox.tts.finishExpectations(); | 184 cvox.ChromeVox.tts.finishExpectations(this.newCallback()); |
| 185 }.bind(this)); | 185 }.bind(this)); |
| 186 }); | 186 }); |
| 187 | 187 |
| 188 TEST_F('BackgroundTest', 'LiveRegionRemoveElement', function() { | 188 TEST_F('BackgroundTest', 'LiveRegionRemoveElement', function() { |
| 189 this.runWithLoadedTree( | 189 this.runWithLoadedTree( |
| 190 function() {/*! | 190 function() {/*! |
| 191 <h1>Document with live region</h1> | 191 <h1>Document with live region</h1> |
| 192 <p id="live" aria-live="polite" aria-relevant="removals">Hello, world</p> | 192 <p id="live" aria-live="polite" aria-relevant="removals">Hello, world</p> |
| 193 <button id="go">Go</button> | 193 <button id="go">Go</button> |
| 194 <script> | 194 <script> |
| 195 document.getElementById('go').addEventListener('click', function() { | 195 document.getElementById('go').addEventListener('click', function() { |
| 196 document.getElementById('live').innerHTML = ''; | 196 document.getElementById('live').innerHTML = ''; |
| 197 }, false); | 197 }, false); |
| 198 </script> | 198 </script> |
| 199 */}, | 199 */}, |
| 200 function(rootNode) { | 200 function(rootNode) { |
| 201 var go = rootNode.find({ role: chrome.automation.RoleType.button }); | 201 var go = rootNode.find({ role: chrome.automation.RoleType.button }); |
| 202 go.doDefault(); | 202 go.doDefault(); |
| 203 cvox.ChromeVox.tts.expectSpeech('removed:'); | 203 cvox.ChromeVox.tts.expectSpeech('removed:'); |
| 204 cvox.ChromeVox.tts.expectSpeech('Hello, world', testDone); | 204 cvox.ChromeVox.tts.expectSpeech('Hello, world'); |
| 205 cvox.ChromeVox.tts.finishExpectations(); | 205 cvox.ChromeVox.tts.finishExpectations(this.newCallback()); |
| 206 }.bind(this)); | 206 }.bind(this)); |
| 207 }); | 207 }); |
| 208 | 208 |
| 209 // TODO(plundblad): This test finishes prematurely and breaks if that gets |
| 210 // fixed. |
| 209 TEST_F('BackgroundTest', 'ShowContextMenu', function() { | 211 TEST_F('BackgroundTest', 'ShowContextMenu', function() { |
| 210 this.runWithLoadedTree('<a href="a">a</a>', | 212 this.runWithLoadedTree('<a href="a">a</a>', |
| 211 function(rootNode) { | 213 function(rootNode) { |
| 212 cvox.ChromeVox.tts.expectSpeech(' menu opened', testDone); | 214 cvox.ChromeVox.tts.expectSpeech(' menu opened', testDone); |
| 213 | 215 |
| 214 var go = rootNode.find({ role: chrome.automation.RoleType.link }); | 216 var go = rootNode.find({ role: chrome.automation.RoleType.link }); |
| 215 go.addEventListener('focus', function(e) { | 217 go.addEventListener('focus', function(e) { |
| 216 this.doCmd('showContextMenu')(); | 218 this.doCmd('showContextMenu')(); |
| 217 }.bind(this), true); | 219 }.bind(this), true); |
| 218 go.focus(); | 220 go.focus(); |
| 219 }.bind(this)); | 221 }.bind(this)); |
| 220 }); | 222 }); |
| 221 | 223 |
| 224 // TODO(plundblad): This test finishes prematurely and breaks if that gets |
| 225 // fixed. |
| 222 TEST_F('BackgroundTest', 'InitialFocus', function() { | 226 TEST_F('BackgroundTest', 'InitialFocus', function() { |
| 223 this.runWithLoadedTree('<a href="a">a</a>', | 227 this.runWithLoadedTree('<a href="a">a</a>', |
| 224 function(rootNode) { | 228 function(rootNode) { |
| 225 cvox.ChromeVox.tts.expectSpeech('a link', testDone); | 229 cvox.ChromeVox.tts.expectSpeech('a link', testDone); |
| 226 | 230 |
| 227 rootNode.focus(); | 231 rootNode.focus(); |
| 228 }.bind(this)); | 232 }.bind(this)); |
| 229 }); | 233 }); |
| 230 | 234 |
| 235 // TODO(plundblad): This test finishes prematurely and breaks if that gets |
| 236 // fixed. |
| 231 TEST_F('BackgroundTest', 'AriaLabel', function() { | 237 TEST_F('BackgroundTest', 'AriaLabel', function() { |
| 232 this.runWithLoadedTree('<a aria-label="foo" href="a">a</a>', | 238 this.runWithLoadedTree('<a aria-label="foo" href="a">a</a>', |
| 233 function(rootNode) { | 239 function(rootNode) { |
| 234 cvox.ChromeVox.tts.expectSpeech('foo link', testDone); | 240 cvox.ChromeVox.tts.expectSpeech('foo link', testDone); |
| 235 | 241 |
| 236 rootNode.focus(); | 242 rootNode.focus(); |
| 237 }.bind(this)); | 243 }.bind(this)); |
| 238 }); | 244 }); |
| OLD | NEW |