Chromium Code Reviews| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 SYNC_TEST_F('BackgroundTest', 'ClassicNamespaces', function() { | 62 SYNC_TEST_F('BackgroundTest', 'ClassicNamespaces', function() { |
| 63 assertEquals('object', typeof(cvox)); | 63 assertEquals('object', typeof(cvox)); |
| 64 assertEquals('function', typeof(cvox.ChromeVoxBackground)); | 64 assertEquals('function', typeof(cvox.ChromeVoxBackground)); |
| 65 }); | 65 }); |
| 66 | 66 |
| 67 /** Tests that ChromeVox next is in this context. */ | 67 /** Tests that ChromeVox next is in this context. */ |
| 68 SYNC_TEST_F('BackgroundTest', 'NextNamespaces', function() { | 68 SYNC_TEST_F('BackgroundTest', 'NextNamespaces', function() { |
| 69 assertEquals('function', typeof(Background)); | 69 assertEquals('function', typeof(Background)); |
| 70 }); | 70 }); |
| 71 | 71 |
| 72 /** Tests that ChromeVox reads the desktop tree. */ | |
| 73 TEST_F('BackgroundTest', 'DesktopFocus', function() { | |
|
dmazzoni
2015/03/26 18:44:58
Why are we losing this test?
David Tseng
2015/03/26 23:20:47
The initial desktop tree is just the root. Until a
dmazzoni
2015/03/26 23:32:04
I know we can't iterate over all windows easily, b
David Tseng
2015/03/27 17:04:38
How about if we add a helper binding that can focu
| |
| 74 function findStatusTray(root) { | |
| 75 if (root.role == chrome.automation.RoleType.button && | |
| 76 root.attributes.name && | |
| 77 root.attributes.name.indexOf('Status tray') != -1) { | |
| 78 return root; | |
| 79 } | |
| 80 for (var i = 0; i < root.children.length; i++) { | |
| 81 var found = findStatusTray(root.children[i]); | |
| 82 if (found) | |
| 83 return found; | |
| 84 } | |
| 85 return null; | |
| 86 } | |
| 87 | |
| 88 chrome.automation.getDesktop(this.newCallback(function(root) { | |
| 89 var testButton = findStatusTray(root); | |
| 90 cvox.ChromeVox.tts.expectSpeech('Status tray', this.newCallback()); | |
| 91 testButton.focus(); | |
| 92 })); | |
| 93 }); | |
| 94 | |
| 95 /** Tests feedback once a page loads. */ | 72 /** Tests feedback once a page loads. */ |
| 96 TEST_F('BackgroundTest', 'MANUAL_InitialFeedback', function() { | 73 TEST_F('BackgroundTest', 'MANUAL_InitialFeedback', function() { |
| 97 cvox.ChromeVox.tts.expectSpeech('start', this.newCallback()); | 74 cvox.ChromeVox.tts.expectSpeech('start', this.newCallback()); |
| 98 | 75 |
| 99 this.runWithTab(function() {/*! | 76 this.runWithTab(function() {/*! |
| 100 <p>start | 77 <p>start |
| 101 <p>end | 78 <p>end |
| 102 */}); | 79 */}); |
| 103 }); | 80 }); |
| 104 | 81 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 TEST_F('BackgroundTest', 'MANUAL_ContinuousRead', function() { | 154 TEST_F('BackgroundTest', 'MANUAL_ContinuousRead', function() { |
| 178 this.runWithLoadedTree(this.linksAndHeadingsDoc, function() { | 155 this.runWithLoadedTree(this.linksAndHeadingsDoc, function() { |
| 179 cvox.ChromeVox.tts.expectSpeech('start'); | 156 cvox.ChromeVox.tts.expectSpeech('start'); |
| 180 cvox.ChromeVox.tts.expectSpeechAfter('start', this.doCmd('continuousRead')); | 157 cvox.ChromeVox.tts.expectSpeechAfter('start', this.doCmd('continuousRead')); |
| 181 cvox.ChromeVox.tts.expectSpeech('alpha Link'); | 158 cvox.ChromeVox.tts.expectSpeech('alpha Link'); |
| 182 cvox.ChromeVox.tts.expectSpeech('beta Link'); | 159 cvox.ChromeVox.tts.expectSpeech('beta Link'); |
| 183 cvox.ChromeVox.tts.expectSpeech('Heading charlie', function() {}); | 160 cvox.ChromeVox.tts.expectSpeech('Heading charlie', function() {}); |
| 184 cvox.ChromeVox.tts.finishExpectations(this.newCallback()); | 161 cvox.ChromeVox.tts.finishExpectations(this.newCallback()); |
| 185 }); | 162 }); |
| 186 }); | 163 }); |
| OLD | NEW |