Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs

Issue 938623003: Fix ChromeVox next tests to fail instead of timing out where applicable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify async callback handling in the tests. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 /** 8 /**
9 * Test fixture for cvox2.cursors. 9 * Test fixture for cvox2.cursors.
10 * @constructor 10 * @constructor
11 * @extends {ChromeVoxNextE2ETest} 11 * @extends {ChromeVoxNextE2ETest}
12 */ 12 */
13 function CursorsTest() {} 13 function CursorsTest() {
14 ChromeVoxNextE2ETest.call(this);
15 }
14 16
15 CursorsTest.prototype = { 17 CursorsTest.prototype = {
16 __proto__: ChromeVoxNextE2ETest.prototype, 18 __proto__: ChromeVoxNextE2ETest.prototype,
17 19
18 /** Test cursors.Cursor. @const {string} */ 20 /** Test cursors.Cursor. @const {string} */
19 CURSOR: 'cursor', 21 CURSOR: 'cursor',
20 22
21 /** Test cursors.Range. @const {string} */ 23 /** Test cursors.Range. @const {string} */
22 RANGE: 'range', 24 RANGE: 'range',
23 25
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 102
101 // This occurs as a result of a load complete. 103 // This occurs as a result of a load complete.
102 var start = AutomationUtil.findNodePost(root, 104 var start = AutomationUtil.findNodePost(root,
103 FORWARD, 105 FORWARD,
104 AutomationPredicate.leaf); 106 AutomationPredicate.leaf);
105 107
106 var cursor = new cursors.Cursor(start, 0); 108 var cursor = new cursors.Cursor(start, 0);
107 if (!opt_testType || opt_testType == this.CURSOR) { 109 if (!opt_testType || opt_testType == this.CURSOR) {
108 var cursor = new cursors.Cursor(start, 0); 110 var cursor = new cursors.Cursor(start, 0);
109 this.cursorMoveAndAssert(cursor, moves); 111 this.cursorMoveAndAssert(cursor, moves);
110 testDone();
111 } else if (opt_testType == this.RANGE) { 112 } else if (opt_testType == this.RANGE) {
112 var range = new cursors.Range(cursor, cursor); 113 var range = new cursors.Range(cursor, cursor);
113 this.rangeMoveAndAssert(range, moves); 114 this.rangeMoveAndAssert(range, moves);
114 testDone();
115 } 115 }
116 }.bind(this)); 116 });
117 }, 117 },
118 118
119 simpleDoc: function() {/*! 119 simpleDoc: function() {/*!
120 <p>start <span>same line</span> 120 <p>start <span>same line</span>
121 <p>end 121 <p>end
122 */} 122 */}
123 }; 123 };
124 124
125 TEST_F('CursorsTest', 'CharacterCursor', function() { 125 TEST_F('CursorsTest', 'CharacterCursor', function() {
126 this.runCursorMovesOnDocument(this.simpleDoc, [ 126 this.runCursorMovesOnDocument(this.simpleDoc, [
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 [LINE, FORWARD, {value: 'end', index: 0}, {value: 'end', index: 3}], 260 [LINE, FORWARD, {value: 'end', index: 0}, {value: 'end', index: 3}],
261 261
262 [LINE, BACKWARD, 262 [LINE, BACKWARD,
263 {value: 'start ', index: 0}, {value: 'same line', index: 9}], 263 {value: 'start ', index: 0}, {value: 'same line', index: 9}],
264 264
265 [LINE, BACKWARD, 265 [LINE, BACKWARD,
266 {value: 'start ', index: 0}, {value: 'same line', index: 9}], 266 {value: 'start ', index: 0}, {value: 'same line', index: 9}],
267 ], this.RANGE); 267 ], this.RANGE);
268 }); 268 });
269 269
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698