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 06e90281b3084ef6437b35b01a94e697a4591dd5..5b517e808acf35fee5ad83091dc82a9053c7758c 100644 |
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs |
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs |
@@ -505,3 +505,25 @@ TEST_F('BackgroundTest', 'ModeSwitching', function() { |
assertEquals('classic', global.backgroundObj.mode); |
}.bind(this)); |
}); |
+ |
+TEST_F('BackgroundTest', 'FocusIframe', function() { |
+ this.runWithLoadedTree( function() {/*! |
+ <iframe tabindex=0 src="data:text/html,<p>Inside</p>"></iframe> |
+ <button>outside</button> |
+ */}, function(root) { |
+ var iframe = root.find({role: 'iframe'}); |
+ var button = root.find({role: 'button'}); |
+ |
+ assertEquals('iframe', iframe.role); |
+ assertEquals('button', button.role); |
+ |
+ var didFocus = false; |
+ iframe.focus = function() { |
+ didFocus = true; |
+ }; |
+ var b = global.backgroundObj; |
+ b.currentRange_ = cursors.Range.fromNode(button); |
+ b.onGotCommand('previousElement'); |
+ assertFalse(didFocus); |
+ }.bind(this)); |
+}); |