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 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 | 1118 |
1119 TEST_F('BackgroundTest', 'HeadingLevels', function() { | 1119 TEST_F('BackgroundTest', 'HeadingLevels', function() { |
1120 var mockFeedback = this.createMockFeedback(); | 1120 var mockFeedback = this.createMockFeedback(); |
1121 this.runWithLoadedTree(function(root) {/*! | 1121 this.runWithLoadedTree(function(root) {/*! |
1122 <h1>1</h1><h2>2</h2><h3>3</h3><h4>4</h4><h5>5</h5><h6>6</h6> | 1122 <h1>1</h1><h2>2</h2><h3>3</h3><h4>4</h4><h5>5</h5><h6>6</h6> |
1123 */}, function(root) { | 1123 */}, function(root) { |
1124 var makeLevelAssertions = function(level) { | 1124 var makeLevelAssertions = function(level) { |
1125 mockFeedback.call(doCmd('nextHeading' + level)) | 1125 mockFeedback.call(doCmd('nextHeading' + level)) |
1126 .expectSpeech('Heading ' + level) | 1126 .expectSpeech('Heading ' + level) |
1127 .call(doCmd('nextHeading' + level)) | 1127 .call(doCmd('nextHeading' + level)) |
1128 .expectSpeech('No next level ' + level + ' heading.') | 1128 .expectEarcon('wrap') |
1129 .call(doCmd('previousHeading' + level)) | 1129 .call(doCmd('previousHeading' + level)) |
1130 .expectSpeech('No previous level ' + level + ' heading.'); | 1130 .expectEarcon('wrap'); |
1131 }; | 1131 }; |
1132 for (var i = 1; i <= 6; i++) | 1132 for (var i = 1; i <= 6; i++) |
1133 makeLevelAssertions(i); | 1133 makeLevelAssertions(i); |
1134 mockFeedback.replay(); | 1134 mockFeedback.replay(); |
1135 }); | 1135 }); |
1136 }); | 1136 }); |
1137 | 1137 |
1138 TEST_F('BackgroundTest', 'EditableNavigation', function() { | 1138 TEST_F('BackgroundTest', 'EditableNavigation', function() { |
1139 var mockFeedback = this.createMockFeedback(); | 1139 var mockFeedback = this.createMockFeedback(); |
1140 this.runWithLoadedTree(function(root) {/*! | 1140 this.runWithLoadedTree(function(root) {/*! |
(...skipping 17 matching lines...) Expand all Loading... |
1158 <input type="text"></input> | 1158 <input type="text"></input> |
1159 */}, function(root) { | 1159 */}, function(root) { |
1160 this.listenOnce(root, 'focus', function(e) { | 1160 this.listenOnce(root, 'focus', function(e) { |
1161 var focus = ChromeVoxState.instance.currentRange.start.node; | 1161 var focus = ChromeVoxState.instance.currentRange.start.node; |
1162 assertEquals(RoleType.textField, focus.role); | 1162 assertEquals(RoleType.textField, focus.role); |
1163 assertTrue(focus.state.focused); | 1163 assertTrue(focus.state.focused); |
1164 }); | 1164 }); |
1165 doCmd('nextEditText')(); | 1165 doCmd('nextEditText')(); |
1166 }); | 1166 }); |
1167 }); | 1167 }); |
OLD | NEW |