diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /editor/libeditor/tests/test_bug1109465.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'editor/libeditor/tests/test_bug1109465.html')
-rw-r--r-- | editor/libeditor/tests/test_bug1109465.html | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/editor/libeditor/tests/test_bug1109465.html b/editor/libeditor/tests/test_bug1109465.html new file mode 100644 index 000000000..dc31e9bf0 --- /dev/null +++ b/editor/libeditor/tests/test_bug1109465.html @@ -0,0 +1,69 @@ +<!DOCTYPE> +<html> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=1109465 +--> +<head> + <title>Test for Bug 1109465</title> + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> +</head> +<body> +<div id="display"> + <textarea></textarea> +</div> +<div id="content" style="display: none"> + +</div> +<pre id="test"> +</pre> + +<script class="testbody" type="application/javascript"> + +/** Test for Bug 1109465 **/ +SimpleTest.waitForExplicitFinish(); +SimpleTest.waitForFocus(function() { + var t = document.querySelector("textarea"); + t.focus(); + + // Type foo\nbar and place the caret at the end of the last line + synthesizeKey("f", {}); + synthesizeKey("o", {}); + synthesizeKey("o", {}); + synthesizeKey("VK_RETURN", {}); + synthesizeKey("b", {}); + synthesizeKey("a", {}); + synthesizeKey("r", {}); + synthesizeKey("VK_UP", {}); + is(t.selectionStart, 3, "Correct start of selection"); + is(t.selectionEnd, 3, "Correct end of selection"); + + // Compose an IME string + synthesizeComposition({ type: "compositionstart" }); + var composingString = "\u306B"; + synthesizeCompositionChange( + { "composition": + { "string": composingString, + "clauses": + [ + { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE } + ] + }, + "caret": { "start": 1, "length": 0 } + }); + synthesizeComposition({ type: "compositioncommitasis" }); + is(t.value, "foo\u306B\nbar", "Correct value after composition"); + + // Now undo to test that the transaction merger has correctly detected the + // IMETextTxn. + synthesizeKey("Z", {accelKey: true}); + is(t.value, "foo\nbar", "Correct value after undo"); + + SimpleTest.finish(); +}); + +</script> +</body> + +</html> |