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

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

Issue 2939753002: Fix EditingTest.RichText* (Closed)
Patch Set: Rebase. Created 3 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs
index 568c687a76c41c08ff70841d367c3206b523c80f..6c5deea43bf9444251488fa99233e6056fc1083a 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs
@@ -212,8 +212,7 @@ TEST_F('EditingTest', 'SingleCharacterLine', function() {
]);
});
-// Fails flakily, see https://crbug.com/724847.
-TEST_F('EditingTest', 'DISABLED_RichTextMoveByLine', function() {
+TEST_F('EditingTest', 'RichTextMoveByLine', function() {
editing.useRichText = true;
var mockFeedback = this.createMockFeedback();
this.runWithLoadedTree(function() {/*!
@@ -242,26 +241,26 @@ TEST_F('EditingTest', 'DISABLED_RichTextMoveByLine', function() {
*/}, function(root) {
var input = root.find({role: RoleType.TEXT_FIELD});
var moveByLine = input.doDefault.bind(input);
- mockFeedback.call(input.focus.bind(input))
- .expectSpeech('Text area')
- .call(moveByLine)
- .expectSpeech('\n')
- .expectBraille('\n')
- .call(moveByLine)
- .expectSpeech('This is a ', 'test', 'Link', ' of rich text')
- .expectBraille('This is a test lnk of rich text')
- .call(moveByLine)
- .expectSpeech('\n')
- .expectBraille('\n')
- .call(moveByLine)
- .expectSpeech('hello', 'Heading 2')
- .expectBraille('hello h2')
- .replay();
+ this.listenOnce(input, 'focus', function() {
+ mockFeedback.call(moveByLine)
+ .expectSpeech('\n')
+ .expectBraille('\n')
+ .call(moveByLine)
+ .expectSpeech('This is a ', 'test', 'Link', ' of rich text')
+ .expectBraille('This is a test lnk of rich text')
+ .call(moveByLine)
+ .expectSpeech('\n')
+ .expectBraille('\n')
+ .call(moveByLine)
+ .expectSpeech('hello', 'Heading 2')
+ .expectBraille('hello h2')
+ .replay();
+ });
+ input.focus();
});
});
-// Fails flakily, see https://crbug.com/732000.
-TEST_F('EditingTest', 'DISABLED_RichTextMoveByCharacter', function() {
+TEST_F('EditingTest', 'RichTextMoveByCharacter', function() {
editing.useRichText = true;
var mockFeedback = this.createMockFeedback();
this.runWithLoadedTree(function() {/*!
@@ -286,54 +285,53 @@ TEST_F('EditingTest', 'DISABLED_RichTextMoveByCharacter', function() {
</script>
*/}, function(root) {
var input = root.find({role: RoleType.TEXT_FIELD});
- var moveByChar = input.doDefault.bind(input)
+ var moveByChar = input.doDefault.bind(input);
var lineText = 'This is a test.';
- mockFeedback.call(input.focus.bind(input))
- .expectSpeech(lineText)
- .expectSpeech('Text area')
- .call(moveByChar)
- .expectSpeech('h')
- .expectBraille(lineText, { startIndex: 1, endIndex: 1 })
- .call(moveByChar)
- .expectSpeech('i')
- .expectBraille(lineText, { startIndex: 2, endIndex: 2 })
- .call(moveByChar)
- .expectSpeech('s')
- .expectBraille(lineText, { startIndex: 3, endIndex: 3 })
- .call(moveByChar)
- .expectSpeech(' ')
- .expectBraille(lineText, { startIndex: 4, endIndex: 4 })
-
- .call(moveByChar)
- .expectSpeech('i')
- .expectSpeech('Bold start')
- .expectBraille(lineText, { startIndex: 5, endIndex: 5 })
-
- .call(moveByChar)
- .expectSpeech('s')
- .expectSpeech('Bold end')
- .expectBraille(lineText, { startIndex: 6, endIndex: 6 })
-
- .call(moveByChar)
- .expectSpeech(' ')
- .expectBraille(lineText, { startIndex: 7, endIndex: 7 })
-
- .call(moveByChar)
- .expectSpeech('a')
- .expectBraille(lineText, { startIndex: 8, endIndex: 8 })
-
- .call(moveByChar)
- .expectSpeech(' ')
- .expectBraille(lineText, { startIndex: 9, endIndex: 9 })
-
- .replay();
+ this.listenOnce(input, 'focus', function() {
+ mockFeedback.call(moveByChar)
+ .expectSpeech('h')
+ .expectBraille(lineText, { startIndex: 1, endIndex: 1 })
+ .call(moveByChar)
+ .expectSpeech('i')
+ .expectBraille(lineText, { startIndex: 2, endIndex: 2 })
+ .call(moveByChar)
+ .expectSpeech('s')
+ .expectBraille(lineText, { startIndex: 3, endIndex: 3 })
+ .call(moveByChar)
+ .expectSpeech(' ')
+ .expectBraille(lineText, { startIndex: 4, endIndex: 4 })
+
+ .call(moveByChar)
+ .expectSpeech('i')
+ .expectSpeech('Bold start')
+ .expectBraille(lineText, { startIndex: 5, endIndex: 5 })
+
+ .call(moveByChar)
+ .expectSpeech('s')
+ .expectSpeech('Bold end')
+ .expectBraille(lineText, { startIndex: 6, endIndex: 6 })
+
+ .call(moveByChar)
+ .expectSpeech(' ')
+ .expectBraille(lineText, { startIndex: 7, endIndex: 7 })
+
+ .call(moveByChar)
+ .expectSpeech('a')
+ .expectBraille(lineText, { startIndex: 8, endIndex: 8 })
+
+ .call(moveByChar)
+ .expectSpeech(' ')
+ .expectBraille(lineText, { startIndex: 9, endIndex: 9 })
+
+ .replay();
+ });
+ input.focus();
});
});
// Tests specifically for cursor workarounds.
-// Fails flakily, see https://crbug.com/731825.
-TEST_F('EditingTest', 'DISABLED_RichTextMoveByCharacterNodeWorkaround', function() {
+TEST_F('EditingTest', 'RichTextMoveByCharacterNodeWorkaround', function() {
editing.useRichText = true;
var mockFeedback = this.createMockFeedback();
this.runWithLoadedTree(function() {/*!
@@ -350,27 +348,27 @@ TEST_F('EditingTest', 'DISABLED_RichTextMoveByCharacterNodeWorkaround', function
var moveByChar = input.doDefault.bind(input)
var lineText = 'hello world';
- mockFeedback.call(input.focus.bind(input))
- .expectSpeech(lineText)
- .expectSpeech('Text area')
- .call(moveByChar)
- .expectSpeech('e')
- .expectBraille(lineText, { startIndex: 1, endIndex: 1 })
- .call(moveByChar)
- .expectSpeech('l')
- .expectBraille(lineText, { startIndex: 2, endIndex: 2 })
- .call(moveByChar)
- .expectSpeech('l')
- .expectBraille(lineText, { startIndex: 3, endIndex: 3 })
- .call(moveByChar)
- .expectSpeech('o')
- .expectBraille(lineText, { startIndex: 4, endIndex: 4 })
- .call(moveByChar)
- .expectSpeech(' ')
- .expectBraille(lineText, { startIndex: 5, endIndex: 5 })
- .call(moveByChar)
- .expectSpeech('w')
- .expectBraille(lineText, { startIndex: 6, endIndex: 6 })
- .replay();
+ this.listenOnce(input, 'focus', function() {
+ mockFeedback.call(moveByChar)
+ .expectSpeech('e')
+ .expectBraille(lineText, { startIndex: 1, endIndex: 1 })
+ .call(moveByChar)
+ .expectSpeech('l')
+ .expectBraille(lineText, { startIndex: 2, endIndex: 2 })
+ .call(moveByChar)
+ .expectSpeech('l')
+ .expectBraille(lineText, { startIndex: 3, endIndex: 3 })
+ .call(moveByChar)
+ .expectSpeech('o')
+ .expectBraille(lineText, { startIndex: 4, endIndex: 4 })
+ .call(moveByChar)
+ .expectSpeech(' ')
+ .expectBraille(lineText, { startIndex: 5, endIndex: 5 })
+ .call(moveByChar)
+ .expectSpeech('w')
+ .expectBraille(lineText, { startIndex: 6, endIndex: 6 })
+ .replay();
+ });
+ input.focus();
});
});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698