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

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

Issue 2195343003: Support navigation within editable nodes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. Created 4 years, 4 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 db8f1e92d617272daf73cd8ae7020005bd559b71..865d6a5a46d46af9601ae35b7164d5b4ebab7ce9 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
@@ -376,15 +376,17 @@ TEST_F('BackgroundTest', 'UseEditableState', function() {
assertTrue(
!ChromeVoxState.desktopAutomationHandler.editableTextHandler_);
evt.stopPropagation();
+
+ // Focus the other text field here to make this test not racey.
+ editable.focus();
});
var editable = rootNode.find({ role: RoleType.textField });
var nonEditable = rootNode.find({ role: RoleType.paragraph });
- this.listenOnce(editable, 'focus', assertExists);
this.listenOnce(nonEditable, 'focus', assertDoesntExist);
+ this.listenOnce(editable, 'focus', assertExists);
- editable.focus();
nonEditable.focus();
}.bind(this));
});
@@ -942,6 +944,7 @@ TEST_F('BackgroundTest', 'SymetricComplexHeading', function() {
TEST_F('BackgroundTest', 'ContentEditableJumpSyncsRange', function() {
var mockFeedback = this.createMockFeedback();
this.runWithLoadedTree(function(root) {/*!
+ <p>start</p>
<div contenteditable>
<h1>Top News</h1>
<h1>Most Popular</h1>
@@ -955,13 +958,15 @@ TEST_F('BackgroundTest', 'ContentEditableJumpSyncsRange', function() {
};
};
- mockFeedback.call(doCmd('nextHeading'))
+ mockFeedback.call(doCmd('nextEditText'))
+ .expectSpeech('Top News')
+ .call(doCmd('nextHeading'))
.expectSpeech('Top News')
.call(assertRangeHasText('Top News'))
.call(doCmd('nextHeading'))
.expectSpeech('Most Popular')
.call(assertRangeHasText('Most Popular'))
- .call(doCmd('nextLine'))
+ .call(doCmd('nextHeading'))
.expectSpeech('Sports')
.call(assertRangeHasText('Sports'))
.replay();
@@ -1132,3 +1137,20 @@ TEST_F('BackgroundTest', 'HeadingLevels', function() {
mockFeedback.replay();
});
});
+
+TEST_F('BackgroundTest', 'EditableNavigation', function() {
+ var mockFeedback = this.createMockFeedback();
+ this.runWithLoadedTree(function(root) {/*!
+ <div contenteditable>this is a test</div>
+ */}, function(root) {
+ mockFeedback.call(doCmd('nextObject'))
+ .expectSpeech('this is a test')
+ .call(doCmd('nextObject'))
+ .expectSpeech(/data*/)
+ .call(doCmd('nextObject'))
+ .expectSpeech('this is a test')
+ .call(doCmd('nextWord'))
+ .expectSpeech('is', 'selected')
+ .replay();
+ });
+});

Powered by Google App Engine
This is Rietveld 408576698