Bug 1490391 - 1. Add a test for text duplication bug; r=esawin

Add a test for the text duplication bug caused by committing some text
and then immediately starting another composition.

Differential Revision: https://phabricator.services.mozilla.com/D9849
This commit is contained in:
Jim Chen 2018-11-06 00:12:07 -05:00
Родитель 12453d9645
Коммит 8e5dc5d4db
1 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -372,6 +372,17 @@ public class testInputConnection extends JavascriptBridgeTest {
ic.deleteSurroundingText(1, 0);
assertTextAndSelectionAt("Can clear text", ic, "", 0);
// Bug 1490391 - Committing then setting composition can result in duplicates.
ic.commitText("far", 1);
ic.setComposingText("bar", 1);
assertTextAndSelectionAt("Can commit then set composition", ic, "farbar", 6);
ic.setComposingText("baz", 1);
assertTextAndSelectionAt("Composition still exists after setting", ic, "farbaz", 6);
ic.finishComposingText();
ic.deleteSurroundingText(6, 0);
assertTextAndSelectionAt("Can clear text", ic, "", 0);
// Make sure we don't leave behind stale events for the following test.
processGeckoEvents();
processInputConnectionEvents();