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 2932d2a8f73f60881a18b09f6dc733097f7ebadf..82810f95a0d6354b845c04ee2469497e09c6c62e 100644 |
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs |
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs |
@@ -20,6 +20,11 @@ function BackgroundTest() { |
BackgroundTest.prototype = { |
__proto__: ChromeVoxNextE2ETest.prototype, |
+ /** @override */ |
+ setUp: function() { |
+ global.backgroundObj.forceChromeVoxNextActive(); |
+ }, |
+ |
/** |
* @return {!MockFeedback} |
*/ |
@@ -339,3 +344,27 @@ TEST_F('BackgroundTest', 'BrailleRouting', function() { |
mockFeedback.replay(); |
}); |
}); |
+ |
+TEST_F('BackgroundTest', 'FocusInputElement', function() { |
+ var mockFeedback = this.createMockFeedback(); |
+ this.runWithLoadedTree( |
+ function() {/*! |
+ <input id="name" value="Lancelot"> |
+ <input id="quest" value="Grail"> |
+ <input id="color" value="Blue"> |
+ */}, |
+ function(rootNode) { |
+ var name = rootNode.find({ attributes: { value: 'Lancelot' } }); |
+ var quest = rootNode.find({ attributes: { value: 'Grail' } }); |
+ var color = rootNode.find({ attributes: { value: 'Blue' } }); |
+ |
+ mockFeedback.call(quest.focus.bind(quest)) |
+ .expectSpeech('Grail', 'Edit text') |
+ .call(color.focus.bind(color)) |
+ .expectSpeech('Blue', 'Edit text') |
+ .call(name.focus.bind(name)) |
+ .expectNextSpeechUtteranceIsNot('Blue') |
+ .expectSpeech('Lancelot', 'Edit text'); |
+ mockFeedback.replay(); |
+ }.bind(this)); |
+}); |