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

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

Issue 2150623002: Refactor: Extract a KeyboardHandler and CommandHandler from Background (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. Created 4 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 25 matching lines...) Expand all
36 return mockFeedback; 36 return mockFeedback;
37 }, 37 },
38 38
39 /** 39 /**
40 * Create a function which performs the command |cmd|. 40 * Create a function which performs the command |cmd|.
41 * @param {string} cmd 41 * @param {string} cmd
42 * @return {function() : void} 42 * @return {function() : void}
43 */ 43 */
44 doCmd: function(cmd) { 44 doCmd: function(cmd) {
45 return function() { 45 return function() {
46 ChromeVoxState.instance.onGotCommand(cmd); 46 CommandHandler.onCommand(cmd);
47 }; 47 };
48 }, 48 },
49 }; 49 };
50 50
51 TEST_F('LiveRegionsTest', 'LiveRegionAddElement', function() { 51 TEST_F('LiveRegionsTest', 'LiveRegionAddElement', function() {
52 var mockFeedback = this.createMockFeedback(); 52 var mockFeedback = this.createMockFeedback();
53 this.runWithLoadedTree( 53 this.runWithLoadedTree(
54 function() {/*! 54 function() {/*!
55 <h1>Document with live region</h1> 55 <h1>Document with live region</h1>
56 <p id="live" aria-live="polite"></p> 56 <p id="live" aria-live="polite"></p>
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 var focusAfterNodeChange = window.setTimeout.bind(window, function() { 243 var focusAfterNodeChange = window.setTimeout.bind(window, function() {
244 root.firstChild.nextSibling.focus(); 244 root.firstChild.nextSibling.focus();
245 }, 1000); 245 }, 1000);
246 mockFeedback.call(focusAfterNodeChange) 246 mockFeedback.call(focusAfterNodeChange)
247 .expectSpeech('hello!') 247 .expectSpeech('hello!')
248 .expectNextSpeechUtteranceIsNot('hello!') 248 .expectNextSpeechUtteranceIsNot('hello!')
249 .expectNextSpeechUtteranceIsNot('hello!') ; 249 .expectNextSpeechUtteranceIsNot('hello!') ;
250 mockFeedback.replay(); 250 mockFeedback.replay();
251 }); 251 });
252 }); 252 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698