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

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs

Issue 2447773002: Use setSequentialFocusNavigationStartingPoint in ChromeVox (Closed)
Patch Set: Links or controls Created 4 years, 2 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 9e13d94a0f782b74c11ef52a903930cb8b62ef3b..47becb01d34d3b25181f281fea1f75797129fa27 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
@@ -573,7 +573,7 @@ TEST_F('BackgroundTest', 'ModeSwitching', function() {
}.bind(this));
});
-TEST_F('BackgroundTest', 'FocusIframe', function() {
+TEST_F('BackgroundTest', 'ShouldNotFocusIframe', function() {
this.runWithLoadedTree( function() {/*!
<iframe tabindex=0 src="data:text/html,<p>Inside</p>"></iframe>
<button>outside</button>
@@ -585,9 +585,9 @@ TEST_F('BackgroundTest', 'FocusIframe', function() {
assertEquals('button', button.role);
var didFocus = false;
- iframe.focus = function() {
+ iframe.addEventListener('focus', function() {
didFocus = true;
- };
+ });
var b = ChromeVoxState.instance;
b.currentRange_ = cursors.Range.fromNode(button);
doCmd('previousElement');
@@ -595,6 +595,27 @@ TEST_F('BackgroundTest', 'FocusIframe', function() {
}.bind(this));
});
+TEST_F('BackgroundTest', 'ShouldFocusLink', function() {
+ this.runWithLoadedTree( function() {/*!
+ <div><a href="#">mylink</a></div>
+ <button>after</button>
+ */}, function(root) {
+ var link = root.find({role: RoleType.link});
+ var button = root.find({role: RoleType.button});
+
+ assertEquals('link', link.role);
+ assertEquals('button', button.role);
+
+ var didFocus = false;
+ link.addEventListener('focus', this.newCallback(function() {
+ // Success
+ }));
+ var b = ChromeVoxState.instance;
+ b.currentRange_ = cursors.Range.fromNode(button);
+ doCmd('previousElement');
+ });
+});
+
TEST_F('BackgroundTest', 'NoisySlider', function() {
var mockFeedback = this.createMockFeedback();
this.runWithLoadedTree( function() {/*!

Powered by Google App Engine
This is Rietveld 408576698