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 7e7f4806bff9443e9fbe559fbf7a0186b70274d4..a25c02fcf72490e8c24cdcdff6944f0b2e5a269d 100644 |
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs |
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs |
@@ -23,6 +23,7 @@ BackgroundTest.prototype = { |
setUp: function() { |
this.mockTts = new MockTts(); |
cvox.ChromeVox.tts = this.mockTts; |
+ global.backgroundObj.forceChromeVoxNextActive(); |
Peter Lundblad
2015/08/20 08:30:06
ChromeVoxE2ETest.runWithTab already adds chromevox
David Tseng
2015/08/20 17:52:47
That logic depends on a load complete event to be
|
}, |
/** |
@@ -242,3 +243,30 @@ TEST_F('BackgroundTest', 'AriaLabel', function() { |
rootNode.focus(); |
}.bind(this)); |
}); |
+ |
+TEST_F('BackgroundTest', 'FocusInputElement', function() { |
+ this.runWithLoadedTree( |
+ function() {/*! |
+ <input id="name" value="Lancelot"> |
+ <input id="quest" value="Grail"> |
+ <input id="color" value="Blue"> |
+ */}, |
+ function(rootNode) { |
+ cvox.ChromeVox.tts.expectSpeech('Grail'); |
+ cvox.ChromeVox.tts.expectSpeech('Edit text'); |
+ |
+ cvox.ChromeVox.tts.expectSpeech('Blue'); |
+ cvox.ChromeVox.tts.expectSpeech('Edit text'); |
+ |
+ var quest = rootNode.find({ attributes: { value: 'Grail' } }); |
+ quest.focus(); |
+ |
+ window.setTimeout(this.newCallback(function() { |
+ var color = rootNode.find({ attributes: { value: 'Blue' } }); |
+ color.focus(); |
+ |
+ cvox.ChromeVox.tts.finishExpectations(this.newCallback()); |
+ }), 100); |
David Tseng
2015/08/19 17:19:25
Can you do this without a timeout (e.g. by adding
Peter Lundblad
2015/08/20 08:30:06
I bet this will flake on some memmory bot. We shou
David Tseng
2015/08/20 17:52:47
See my suggestion above (about focus event handler
|
+ |
+ }.bind(this)); |
Peter Lundblad
2015/08/20 08:30:06
Superflous bind.
|
+}); |