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

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/background_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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
index d9951204d1cd3b2ee7aebac32a69dc62b51ac012..367ef13bced681773e8e893719974da568f6ea70 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
@@ -47,7 +47,7 @@ BackgroundTest.prototype = {
*/
doCmd: function(cmd) {
return function() {
- ChromeVoxState.instance.onGotCommand(cmd);
+ CommandHandler.onCommand(cmd);
};
},
@@ -437,7 +437,7 @@ TEST_F('BackgroundTest', 'EarconsForControls', function() {
TEST_F('BackgroundTest', 'ToggleChromeVoxVersion', function() {
var mockFeedback = this.createMockFeedback();
this.runWithLoadedTree(this.linksAndHeadingsDoc, function() {
- var gotCmd = ChromeVoxState.instance.onGotCommand;
+ var gotCmd = CommandHandler.onCommand;
// The command came from the background keyboard handler.
var togglerFromBackground = gotCmd.bind(gotCmd, 'toggleChromeVoxVersion');
@@ -582,7 +582,7 @@ TEST_F('BackgroundTest', 'FocusIframe', function() {
};
var b = ChromeVoxState.instance;
b.currentRange_ = cursors.Range.fromNode(button);
- b.onGotCommand('previousElement');
+ doCmd('previousElement');
assertFalse(didFocus);
}.bind(this));
});
@@ -769,7 +769,7 @@ TEST_F('BackgroundTest', 'ToggleButton', function() {
<div aria-pressed role="button">close</div>
*/}, function(root) {
var b = ChromeVoxState.instance;
- var move = b.onGotCommand.bind(b, 'nextObject');
+ var move = doCmd('nextObject');
mockFeedback.call(move)
.expectSpeech('ok')
.expectSpeech('Button')
@@ -977,7 +977,7 @@ TEST_F('BackgroundTest', 'Selection', function() {
// Fakes a toggleSelection command.
root.addEventListener('textSelectionChanged', function() {
if (root.focusOffset == 3)
- ChromeVoxState.instance.onGotCommand('toggleSelection');
+ CommandHandler.onCommand('toggleSelection');
}, true);
mockFeedback.call(doCmd('toggleSelection'))

Powered by Google App Engine
This is Rietveld 408576698