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

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

Issue 1318683002: Make cvox2 feedback more robust when focusing a text field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mock_feedback
Patch Set: EditableTextBase expects start < end Created 5 years, 3 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 '../../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
11 /** 11 /**
12 * Test fixture for Background. 12 * Test fixture for Background.
13 * @constructor 13 * @constructor
14 * @extends {ChromeVoxNextE2ETest} 14 * @extends {ChromeVoxNextE2ETest}
15 */ 15 */
16 function BackgroundTest() { 16 function BackgroundTest() {
17 ChromeVoxNextE2ETest.call(this); 17 ChromeVoxNextE2ETest.call(this);
18 } 18 }
19 19
20 BackgroundTest.prototype = { 20 BackgroundTest.prototype = {
21 __proto__: ChromeVoxNextE2ETest.prototype, 21 __proto__: ChromeVoxNextE2ETest.prototype,
22 22
23 /** @override */
24 setUp: function() {
25 global.backgroundObj.forceChromeVoxNextActive();
26 },
27
23 /** 28 /**
24 * @return {!MockFeedback} 29 * @return {!MockFeedback}
25 */ 30 */
26 createMockFeedback: function() { 31 createMockFeedback: function() {
27 var mockFeedback = new MockFeedback(this.newCallback(), 32 var mockFeedback = new MockFeedback(this.newCallback(),
28 this.newCallback.bind(this)); 33 this.newCallback.bind(this));
29 mockFeedback.install(); 34 mockFeedback.install();
30 return mockFeedback; 35 return mockFeedback;
31 }, 36 },
32 37
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 .call(textField.focus.bind(textField)) 337 .call(textField.focus.bind(textField))
333 .expectBraille('Edit me ed', {startIndex: 0}) 338 .expectBraille('Edit me ed', {startIndex: 0})
334 .call(route.bind(null, 3)) 339 .call(route.bind(null, 3))
335 .expectBraille('Edit me ed', {startIndex: 3}) 340 .expectBraille('Edit me ed', {startIndex: 3})
336 .call(function() { 341 .call(function() {
337 assertEquals(3, textField.textSelStart); 342 assertEquals(3, textField.textSelStart);
338 }); 343 });
339 mockFeedback.replay(); 344 mockFeedback.replay();
340 }); 345 });
341 }); 346 });
347
348 TEST_F('BackgroundTest', 'FocusInputElement', function() {
349 var mockFeedback = this.createMockFeedback();
350 this.runWithLoadedTree(
351 function() {/*!
352 <input id="name" value="Lancelot">
353 <input id="quest" value="Grail">
354 <input id="color" value="Blue">
355 */},
356 function(rootNode) {
357 var name = rootNode.find({ attributes: { value: 'Lancelot' } });
358 var quest = rootNode.find({ attributes: { value: 'Grail' } });
359 var color = rootNode.find({ attributes: { value: 'Blue' } });
360
361 mockFeedback.call(quest.focus.bind(quest))
362 .expectSpeech('Grail', 'Edit text')
363 .call(color.focus.bind(color))
364 .expectSpeech('Blue', 'Edit text')
365 .call(name.focus.bind(name))
366 .expectNextSpeechUtteranceIsNot('Blue')
367 .expectSpeech('Lancelot', 'Edit text');
368 mockFeedback.replay();
369 }.bind(this));
370 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698