--- a/toolkit/content/tests/chrome/file_autocomplete_with_composition.js
+++ b/toolkit/content/tests/chrome/file_autocomplete_with_composition.js
@@ -83,47 +83,47 @@ nsDoTestsForAutoCompleteWithComposition.
// Simple composition when popup hasn't been shown.
// The autocomplete popup should not be shown during composition, but
// after compositionend, the popup should be shown.
{ description: "compositionstart shouldn't open the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
synthesizeKey("m", { type: "keydown", shiftKey: true }, aWindow);
synthesizeComposition({ type: "compositionstart" }, aWindow);
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "M",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
}, aWindow);
}, popup: false, value: "M", searchString: ""
},
{ description: "modifying composition string shouldn't open the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "Mo",
"clauses":
[
{ "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 2, "length": 0 }
}, aWindow);
}, popup: false, value: "Mo", searchString: ""
},
{ description: "compositionend should open the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "Mo",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 2, "length": 0 }
@@ -134,47 +134,47 @@ nsDoTestsForAutoCompleteWithComposition.
},
// If composition starts when popup is shown, the compositionstart event
// should cause closing the popup.
{ description: "compositionstart should close the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
synthesizeKey("z", { type: "keydown" }, aWindow);
synthesizeComposition({ type: "compositionstart" }, aWindow);
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "z",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
}, aWindow);
}, popup: false, value: "Moz", searchString: "Mo"
},
{ description: "modifying composition string shouldn't reopen the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "zi",
"clauses":
[
{ "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 2, "length": 0 }
}, aWindow);
}, popup: false, value: "Mozi", searchString: "Mo"
},
{ description: "compositionend should research the result and open the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "zi",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 2, "length": 0 }
@@ -184,62 +184,62 @@ nsDoTestsForAutoCompleteWithComposition.
}, popup: true, value: "Mozi", searchString: "Mozi"
},
// If composition is cancelled, the value shouldn't be changed.
{ description: "compositionstart should reclose the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
synthesizeKey("l", { type: "keydown" }, aWindow);
synthesizeComposition({ type: "compositionstart" }, aWindow);
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "l",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
}, aWindow);
}, popup: false, value: "Mozil", searchString: "Mozi"
},
{ description: "modifying composition string shouldn't reopen the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "ll",
"clauses":
[
{ "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 2, "length": 0 }
}, aWindow);
}, popup: false, value: "Mozill", searchString: "Mozi"
},
{ description: "modifying composition string to empty string shouldn't reopen the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
}, aWindow);
}, popup: false, value: "Mozi", searchString: "Mozi"
},
{ description: "cancled compositionend should reopen the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
@@ -252,62 +252,62 @@ nsDoTestsForAutoCompleteWithComposition.
// string should be the latest value.
{ description: "compositionstart with selected string should close the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
synthesizeKey("VK_LEFT", { shiftKey: true }, aWindow);
synthesizeKey("VK_LEFT", { shiftKey: true }, aWindow);
synthesizeKey("z", { type: "keydown" }, aWindow);
synthesizeComposition({ type: "compositionstart" }, aWindow);
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "z",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
}, aWindow);
}, popup: false, value: "Moz", searchString: "Mozi"
},
{ description: "modifying composition string shouldn't reopen the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "zi",
"clauses":
[
{ "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 2, "length": 0 }
}, aWindow);
}, popup: false, value: "Mozi", searchString: "Mozi"
},
{ description: "modifying composition string to empty string shouldn't reopen the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
}, aWindow);
}, popup: false, value: "Mo", searchString: "Mozi"
},
{ description: "canceled compositionend should seach the result with the latest value",
completeDefaultIndex: false,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
@@ -325,62 +325,62 @@ nsDoTestsForAutoCompleteWithComposition.
}, popup: false, value: "", searchString: ""
},
// composition which is canceled shouldn't cause opening the popup.
{ description: "compositionstart shouldn't open the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
synthesizeKey("m", { type: "keydown", shiftKey: true }, aWindow);
synthesizeComposition({ type: "compositionstart" }, aWindow);
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "M",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
}, aWindow);
}, popup: false, value: "M", searchString: ""
},
{ description: "modifying composition string shouldn't open the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "Mo",
"clauses":
[
{ "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 2, "length": 0 }
}, aWindow);
}, popup: false, value: "Mo", searchString: ""
},
{ description: "modifying composition string to empty string shouldn't open the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
}, aWindow);
}, popup: false, value: "", searchString: ""
},
{ description: "canceled compositionend shouldn't open the popup if it was closed",
completeDefaultIndex: false,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
@@ -398,62 +398,62 @@ nsDoTestsForAutoCompleteWithComposition.
},
// If popup is open at starting composition, the popup should be reopened
// after composition anyway.
{ description: "compositionstart shouldn't open the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
synthesizeKey("m", { type: "keydown", shiftKey: true }, aWindow);
synthesizeComposition({ type: "compositionstart" }, aWindow);
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "M",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
}, aWindow);
}, popup: false, value: "M", searchString: ""
},
{ description: "modifying composition string shouldn't open the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "Mo",
"clauses":
[
{ "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 2, "length": 0 }
}, aWindow);
}, popup: false, value: "Mo", searchString: ""
},
{ description: "modifying composition string to empty string shouldn't open the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
}, aWindow);
}, popup: false, value: "", searchString: ""
},
{ description: "canceled compositionend should open the popup if it was opened",
completeDefaultIndex: false,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
@@ -474,62 +474,62 @@ nsDoTestsForAutoCompleteWithComposition.
// Even if the popup is closed, composition which is canceled should open
// the popup if the value isn't empty.
// XXX This might not be good behavior, but anyway, this is minor issue...
{ description: "compositionstart shouldn't open the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
synthesizeKey("z", { type: "keydown", shiftKey: true }, aWindow);
synthesizeComposition({ type: "compositionstart" }, aWindow);
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "z",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
}, aWindow);
}, popup: false, value: "Moz", searchString: "Mo"
},
{ description: "modifying composition string shouldn't open the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "zi",
"clauses":
[
{ "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 2, "length": 0 }
}, aWindow);
}, popup: false, value: "Mozi", searchString: "Mo"
},
{ description: "modifying composition string to empty string shouldn't open the popup",
completeDefaultIndex: false,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
}, aWindow);
}, popup: false, value: "Mo", searchString: "Mo"
},
{ description: "canceled compositionend shouldn't open the popup if the popup was closed",
completeDefaultIndex: false,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
@@ -547,47 +547,47 @@ nsDoTestsForAutoCompleteWithComposition.
}, popup: false, value: "", searchString: ""
},
// Testing for nsIAutoCompleteInput.completeDefaultIndex being true.
{ description: "compositionstart shouldn't open the popup (completeDefaultIndex is true)",
completeDefaultIndex: true,
execute: function (aWindow) {
synthesizeKey("m", { type: "keydown", shiftKey: true }, aWindow);
synthesizeComposition({ type: "compositionstart" }, aWindow);
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "M",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
}, aWindow);
}, popup: false, value: "M", searchString: ""
},
{ description: "modifying composition string shouldn't open the popup (completeDefaultIndex is true)",
completeDefaultIndex: true,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "Mo",
"clauses":
[
{ "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 2, "length": 0 }
}, aWindow);
}, popup: false, value: "Mo", searchString: ""
},
{ description: "compositionend should open the popup (completeDefaultIndex is true)",
completeDefaultIndex: true,
execute: function (aWindow) {
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "Mo",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 2, "length": 0 }
--- a/widget/tests/window_composition_text_querycontent.xul
+++ b/widget/tests/window_composition_text_querycontent.xul
@@ -189,53 +189,53 @@ function runUndoRedoTest()
{
textarea.value = "";
textarea.focus();
// start composition
synthesizeComposition({ type: "compositionstart" });
// input raw characters
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u306D",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
});
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u306D\u3053",
"clauses":
[
{ "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 2, "length": 0 }
});
// convert
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u732B",
"clauses":
[
{ "length": 1,
"attr": COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT }
]
},
"caret": { "start": 1, "length": 0 }
});
// commit
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u732B",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 1, "length": 0 }
@@ -243,29 +243,29 @@ function runUndoRedoTest()
// end composition
synthesizeComposition({ type: "compositionend", data: "\u732B" });
// start composition
synthesizeComposition({ type: "compositionstart" });
// input raw characters
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u307E",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
});
// cancel the composition
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
@@ -273,64 +273,64 @@ function runUndoRedoTest()
// end composition
synthesizeComposition({ type: "compositionend", data: "" });
// start composition
synthesizeComposition({ type: "compositionstart" });
// input raw characters
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3080",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
});
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3080\u3059",
"clauses":
[
{ "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 2, "length": 0 }
});
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3080\u3059\u3081",
"clauses":
[
{ "length": 3, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 3, "length": 0 }
});
// convert
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u5A18",
"clauses":
[
{ "length": 1,
"attr": COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT }
]
},
"caret": { "start": 1, "length": 0 }
});
// commit
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u5A18",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 1, "length": 0 }
@@ -371,74 +371,74 @@ function runUndoRedoTest()
synthesizeKey(" ", {});
synthesizeKey("a", {});
synthesizeKey(" ", {});
// start composition
synthesizeComposition({ type: "compositionstart" });
// input raw characters
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3088",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
});
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3088\u3046",
"clauses":
[
{ "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 2, "length": 0 }
});
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3088\u3046\u304b",
"clauses":
[
{ "length": 3, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 3, "length": 0 }
});
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3088\u3046\u304b\u3044",
"clauses":
[
{ "length": 4, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 4, "length": 0 }
});
// convert
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u5996\u602a",
"clauses":
[
{ "length": 2, "attr": COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT }
]
},
"caret": { "start": 2, "length": 0 }
});
// commit
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u5996\u602a",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 2, "length": 0 }
@@ -626,17 +626,17 @@ function runCompositionTest()
return false;
}
caretRects[0] = caretRect;
// start composition
synthesizeComposition({ type: "compositionstart" });
// input first character
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
@@ -650,17 +650,17 @@ function runCompositionTest()
caretRect = synthesizeQueryCaretRect(1);
if (!checkQueryContentResult(caretRect,
"runCompositionTest: synthesizeQueryCaretRect #1-1")) {
return false;
}
caretRects[1] = caretRect;
// input second character
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC",
"clauses":
[
{ "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 2, "length": 0 }
@@ -683,17 +683,17 @@ function runCompositionTest()
is(caretRects[2].top, caretRects[1].top,
"runCompositionTest: caret is moved to another line (#1-2)");
is(caretRects[2].width, caretRects[1].width,
"runCompositionTest: caret width is wrong (#1-2)");
is(caretRects[2].height, caretRects[1].height,
"runCompositionTest: caret width is wrong (#1-2)");
// input third character
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC\u3081",
"clauses":
[
{ "length": 3, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 3, "length": 0 }
@@ -716,17 +716,17 @@ function runCompositionTest()
is(caretRects[3].top, caretRects[2].top,
"runCompositionTest: caret is moved to another line (#1-3)");
is(caretRects[3].width, caretRects[2].width,
"runCompositionTest: caret width is wrong (#1-3)");
is(caretRects[3].height, caretRects[2].height,
"runCompositionTest: caret height is wrong (#1-3)");
// moves the caret left
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC\u3081",
"clauses":
[
{ "length": 3, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 2, "length": 0 }
@@ -750,17 +750,17 @@ function runCompositionTest()
"runCompositionTest: caret rects are different (#1-3-1, top)");
// by bug 335359, the caret width depends on the right side's character.
is(caretRect.width, caretRects[2].width + 1,
"runCompositionTest: caret rects are different (#1-3-1, width)");
is(caretRect.height, caretRects[2].height,
"runCompositionTest: caret rects are different (#1-3-1, height)");
// moves the caret left
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC\u3081",
"clauses":
[
{ "length": 3, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
@@ -783,17 +783,17 @@ function runCompositionTest()
is(caretRect.top, caretRects[1].top,
"runCompositionTest: caret rects are different (#1-3-2, top)");
// by bug 335359, the caret width depends on the right side's character.
is(caretRect.width, caretRects[1].width + 1,
"runCompositionTest: caret rects are different (#1-3-2, width)");
is(caretRect.height, caretRects[1].height,
"runCompositionTest: caret rects are different (#1-3-2, height)");
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC\u3081\u3093",
"clauses":
[
{ "length": 4, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 4, "length": 0 }
@@ -801,98 +801,98 @@ function runCompositionTest()
if (!checkContent("\u3089\u30FC\u3081\u3093", "runCompositionTest", "#1-4") ||
!checkSelection(4, "", "runCompositionTest", "#1-4")) {
return;
}
// backspace
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC\u3081",
"clauses":
[
{ "length": 3, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 3, "length": 0 }
});
if (!checkContent("\u3089\u30FC\u3081", "runCompositionTest", "#1-5") ||
!checkSelection(3, "", "runCompositionTest", "#1-5")) {
return;
}
// re-input
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC\u3081\u3093",
"clauses":
[
{ "length": 4, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 4, "length": 0 }
});
if (!checkContent("\u3089\u30FC\u3081\u3093", "runCompositionTest", "#1-6") ||
!checkSelection(4, "", "runCompositionTest", "#1-6")) {
return;
}
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC\u3081\u3093\u3055",
"clauses":
[
{ "length": 5, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 5, "length": 0 }
});
if (!checkContent("\u3089\u30FC\u3081\u3093\u3055", "runCompositionTest", "#1-7") ||
!checkSelection(5, "", "runCompositionTest", "#1-7")) {
return;
}
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC\u3081\u3093\u3055\u3044",
"clauses":
[
{ "length": 6, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 6, "length": 0 }
});
if (!checkContent("\u3089\u30FC\u3081\u3093\u3055\u3044", "runCompositionTest", "#1-8") ||
!checkSelection(6, "", "runCompositionTest", "#1-8")) {
return;
}
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC\u3081\u3093\u3055\u3044\u3053",
"clauses":
[
{ "length": 7, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 7, "length": 0 }
});
if (!checkContent("\u3089\u30FC\u3081\u3093\u3055\u3044\u3053", "runCompositionTest", "#1-8") ||
!checkSelection(7, "", "runCompositionTest", "#1-8")) {
return;
}
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC\u3081\u3093\u3055\u3044\u3053\u3046",
"clauses":
[
{ "length": 8, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 8, "length": 0 }
@@ -900,17 +900,17 @@ function runCompositionTest()
if (!checkContent("\u3089\u30FC\u3081\u3093\u3055\u3044\u3053\u3046",
"runCompositionTest", "#1-9") ||
!checkSelection(8, "", "runCompositionTest", "#1-9")) {
return;
}
// convert
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8",
"clauses":
[
{ "length": 4,
"attr": COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT },
{ "length": 2,
"attr": COMPOSITION_ATTR_CONVERTEDTEXT }
@@ -921,17 +921,17 @@ function runCompositionTest()
if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8",
"runCompositionTest", "#1-10") ||
!checkSelection(4, "", "runCompositionTest", "#1-10")) {
return;
}
// change the selected clause
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8",
"clauses":
[
{ "length": 4,
"attr": COMPOSITION_ATTR_CONVERTEDTEXT },
{ "length": 2,
"attr": COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT }
@@ -942,17 +942,17 @@ function runCompositionTest()
if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8",
"runCompositionTest", "#1-11") ||
!checkSelection(6, "", "runCompositionTest", "#1-11")) {
return;
}
// reset clauses
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046",
"clauses":
[
{ "length": 5,
"attr": COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT },
{ "length": 3,
"attr": COMPOSITION_ATTR_CONVERTEDTEXT }
@@ -973,17 +973,17 @@ function runCompositionTest()
if (!checkQueryContentResult(textRect1,
"runCompositionTest: synthesizeQueryTextRect #1-12-1") ||
!checkQueryContentResult(textRect2,
"runCompositionTest: synthesizeQueryTextRect #1-12-2")) {
return false;
}
// commit the composition string
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 8, "length": 0 }
@@ -1010,68 +1010,68 @@ function runCompositionTest()
checkRect(textRect3, textRect1, "runCompositionTest: textRect #1-13-1");
checkRect(textRect4, textRect2, "runCompositionTest: textRect #1-13-2");
// restart composition
synthesizeComposition({ type: "compositionstart" });
// input characters
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3057",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
});
if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046\u3057",
"runCompositionTest", "#2-1") ||
!checkSelection(8 + 1, "", "runCompositionTest", "#2-1")) {
return;
}
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3058",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
});
if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046\u3058",
"runCompositionTest", "#2-2") ||
!checkSelection(8 + 1, "", "runCompositionTest", "#2-2")) {
return;
}
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3058\u3087",
"clauses":
[
{ "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 2, "length": 0 }
});
if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046\u3058\u3087",
"runCompositionTest", "#2-3") ||
!checkSelection(8 + 2, "", "runCompositionTest", "#2-3")) {
return;
}
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3058\u3087\u3046",
"clauses":
[
{ "length": 3, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 3, "length": 0 }
@@ -1079,17 +1079,17 @@ function runCompositionTest()
if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046\u3058\u3087\u3046",
"runCompositionTest", "#2-4") ||
!checkSelection(8 + 3, "", "runCompositionTest", "#2-4")) {
return;
}
// commit the composition string
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3058\u3087\u3046",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 3, "length": 0 }
@@ -1109,17 +1109,17 @@ function runCompositionTest()
if (!checkSelection(4, "\u3055\u884C\u3053\u3046\u3058\u3087\u3046", "runCompositionTest", "#3-1")) {
return;
}
// start composition with selection
synthesizeComposition({ type: "compositionstart" });
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u304A",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
@@ -1127,17 +1127,17 @@ function runCompositionTest()
if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u304A",
"runCompositionTest", "#3-2") ||
!checkSelection(4 + 1, "", "runCompositionTest", "#3-2")) {
return;
}
// remove the composition string
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
@@ -1145,17 +1145,17 @@ function runCompositionTest()
if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
"runCompositionTest", "#3-3") ||
!checkSelection(4, "", "runCompositionTest", "#3-3")) {
return;
}
// re-input the composition string
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3046",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
@@ -1163,17 +1163,17 @@ function runCompositionTest()
if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u3046",
"runCompositionTest", "#3-4") ||
!checkSelection(4 + 1, "", "runCompositionTest", "#3-4")) {
return;
}
// cancel the composition
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
@@ -1187,51 +1187,51 @@ function runCompositionTest()
return;
}
// bug 271815, some Chinese IMEs for Linux make empty composition string
// and compty clause information when it lists up Chinese characters on
// its candidate window.
synthesizeComposition({ type: "compositionstart" });
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
});
if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
"runCompositionTest", "#4-1") ||
!checkSelection(4, "", "runCompositionTest", "#4-1")) {
return;
}
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
});
if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
"runCompositionTest", "#4-2") ||
!checkSelection(4, "", "runCompositionTest", "#4-2")) {
return;
}
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u6700",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 1, "length": 0 }
@@ -1249,34 +1249,34 @@ function runCompositionTest()
"runCompositionTest", "#4-4") ||
!checkSelection(5, "", "runCompositionTest", "#4-4")) {
return;
}
// testing the canceling case
synthesizeComposition({ type: "compositionstart" });
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
});
if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u6700",
"runCompositionTest", "#4-5") ||
!checkSelection(5, "", "runCompositionTest", "#4-5")) {
return;
}
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
@@ -1296,34 +1296,34 @@ function runCompositionTest()
return;
}
// testing whether the empty composition string deletes selected string.
synthesizeKey("VK_LEFT", { shiftKey: true });
synthesizeComposition({ type: "compositionstart" });
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
});
if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
"runCompositionTest", "#4-8") ||
!checkSelection(4, "", "runCompositionTest", "#4-8")) {
return;
}
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u9AD8",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 1, "length": 0 }
@@ -1349,51 +1349,51 @@ function runCompositionTest()
!checkSelection(4, "", "runCompositionTest", "#4-11")) {
return;
}
// bug 23558, ancient Japanese IMEs on Window may send empty text event
// twice at canceling composition.
synthesizeComposition({ type: "compositionstart" });
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u6700",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
});
if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u6700",
"runCompositionTest", "#5-1") ||
!checkSelection(4 + 1, "", "runCompositionTest", "#5-1")) {
return;
}
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
});
if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
"runCompositionTest", "#5-2") ||
!checkSelection(4, "", "runCompositionTest", "#5-2")) {
return;
}
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 0, "length": 0 }
@@ -1539,17 +1539,17 @@ function runCompositionEventTest()
true, true);
input.addEventListener("input", formEventHandlerForInput,
true, true);
// test for normal case
initResults();
synthesizeComposition({ type: "compositionstart" });
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
@@ -1590,17 +1590,17 @@ function runCompositionEventTest()
kDescription + "input hasn't been handled by window #1");
is(windowEventData["input"], "\u3089",
kDescription + "value of input element wasn't modified (window) #1");
is(inputEventCounts["input"], 1,
kDescription + "input hasn't been handled by input #1");
is(inputEventData["input"], "\u3089",
kDescription + "value of input element wasn't modified (input) #1");
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC",
"clauses":
[
{ "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 2, "length": 0 }
@@ -1634,17 +1634,17 @@ function runCompositionEventTest()
is(windowEventData["input"], "\u3089\u30FC",
kDescription + "value of input element wasn't modified (window) #2");
is(inputEventCounts["input"], 2,
kDescription + "input hasn't been handled by input #2");
is(inputEventData["input"], "\u3089\u30FC",
kDescription + "value of input element wasn't modified (input) #2");
// text event shouldn't cause composition update, e.g., at committing.
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 2, "length": 0 }
@@ -1686,28 +1686,28 @@ function runCompositionEventTest()
// select the second character, then, data of composition start should be
// the selected character.
initResults();
synthesizeKey("VK_LEFT", { shiftKey: true });
synthesizeComposition({ type: "compositionstart" });
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
});
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 1, "length": 0 }
@@ -1766,28 +1766,28 @@ function runCompositionEventTest()
// preventDefault() should effect nothing.
preventDefault = true;
initResults();
synthesizeKey("A", { accelKey: true }); // Select All
synthesizeComposition({ type: "compositionstart" });
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u306D",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
});
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u306D",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 1, "length": 0 }
@@ -1848,28 +1848,28 @@ function runCompositionEventTest()
// stopPropagation() should effect nothing (except event count)
stopPropagation = true;
initResults();
synthesizeKey("A", { accelKey: true }); // Select All
synthesizeComposition({ type: "compositionstart" });
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u306E",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
});
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u306E",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 1, "length": 0 }
@@ -2233,17 +2233,17 @@ function runForceCommitTest()
// Make the composition in textarea commit by click in the textarea
textarea.focus();
textarea.value = "";
events = [];
synthesizeComposition({ type: "compositionstart" });
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u306E",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
@@ -2286,17 +2286,17 @@ function runForceCommitTest()
// Make the composition in textarea commit by click in another editor (input)
textarea.focus();
textarea.value = "";
input.value = "";
synthesizeComposition({ type: "compositionstart" });
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u306E",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
@@ -2331,17 +2331,17 @@ function runForceCommitTest()
"runForceCommitTest: the input has the committed text? #3");
// Make the composition in textarea commit by blur()
textarea.focus();
textarea.value = "";
synthesizeComposition({ type: "compositionstart" });
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u306E",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
@@ -2373,17 +2373,17 @@ function runForceCommitTest()
// Make the composition in textarea commit by input.focus()
textarea.focus();
textarea.value = "";
input.value = "";
synthesizeComposition({ type: "compositionstart" });
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u306E",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
@@ -2419,17 +2419,17 @@ function runForceCommitTest()
// Make the composition in textarea commit by click in another document's editor
textarea.focus();
textarea.value = "";
textareaInFrame.value = "";
synthesizeComposition({ type: "compositionstart" });
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u306E",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
@@ -2465,17 +2465,17 @@ function runForceCommitTest()
// Make the composition in textarea commit by another document's editor's focus()
textarea.focus();
textarea.value = "";
textareaInFrame.value = "";
synthesizeComposition({ type: "compositionstart" });
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u306E",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
@@ -2512,17 +2512,17 @@ function runForceCommitTest()
// Make the composition in a textarea commit by click in another editable document
textarea.focus();
textarea.value = "";
iframe2.contentDocument.body.innerHTML = "Text in the Body";
var iframe2BodyInnerHTML = iframe2.contentDocument.body.innerHTML;
synthesizeComposition({ type: "compositionstart" });
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u306E",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
@@ -2558,17 +2558,17 @@ function runForceCommitTest()
// Make the composition in an editable document commit by click in it
iframe2.contentWindow.focus();
iframe2.contentDocument.body.innerHTML = "Text in the Body";
iframe2BodyInnerHTML = iframe2.contentDocument.body.innerHTML;
synthesizeComposition({ type: "compositionstart" }, iframe2.contentWindow);
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u306E",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
@@ -2602,17 +2602,17 @@ function runForceCommitTest()
// Make the composition in an editable document commit by click in another document's editor
textarea.value = "";
iframe2.contentWindow.focus();
iframe2.contentDocument.body.innerHTML = "Text in the Body";
iframe2BodyInnerHTML = iframe2.contentDocument.body.innerHTML;
synthesizeComposition({ type: "compositionstart" }, iframe2.contentWindow);
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u306E",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
@@ -2651,17 +2651,17 @@ function runForceCommitTest()
iframe2.contentWindow.focus();
iframe2.contentDocument.body.innerHTML = "Text in the Body";
iframe2BodyInnerHTML = iframe2.contentDocument.body.innerHTML;
iframe3.contentDocument.body.innerHTML = "Text in the Body";
iframe3BodyInnerHTML = iframe2.contentDocument.body.innerHTML;
synthesizeComposition({ type: "compositionstart" }, iframe2.contentWindow);
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u306E",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
@@ -2754,34 +2754,34 @@ function runIsComposingTest()
expectedIsComposing = false;
description = "events before dispatching compositionstart";
synthesizeKey("VK_LEFT", {});
synthesizeKey("a", { type: "keydown" });
synthesizeComposition({ type: "compositionstart" });
expectedIsComposing = true;
description = "events after dispatching compositionstart";
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3042",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
});
synthesizeKey("a", { type: "keyup" });
// Although, firing keypress event during composition is a bug.
synthesizeKey("VK_INSERT", {});
description = "events for committing composition string";
synthesizeKey("VK_RETURN", { type: "keydown" });
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3042",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 1, "length": 0 }
@@ -2815,17 +2815,17 @@ function runRemoveContentTest(aCallback)
textarea.addEventListener("input", eventHandler, true);
textarea.addEventListener("text", eventHandler, true);
textarea.focus();
textarea.value = "";
synthesizeComposition({ type: "compositionstart" });
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u306E",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
@@ -2914,34 +2914,34 @@ function runTestOnAnotherContext(aPanelO
"height": r.bottom - r.top };
checkRectContainsRect(editorRect, parentRect, aTestName +
": the editor rect coordinates are wrong");
// start composition
synthesizeComposition({ type: "compositionstart" });
// input characters
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3078\u3093\u3057\u3093",
"clauses":
[
{ "length": 4, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 4, "length": 0 }
});
if (!checkContent("\u3078\u3093\u3057\u3093", aTestName, "#1-1") ||
!checkSelection(4, "", aTestName, "#1-1")) {
return;
}
// convert them #1
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u8FD4\u4FE1",
"clauses":
[
{ "length": 2,
"attr": COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT }
]
},
@@ -2949,17 +2949,17 @@ function runTestOnAnotherContext(aPanelO
});
if (!checkContent("\u8FD4\u4FE1", aTestName, "#1-2") ||
!checkSelection(2, "", aTestName, "#1-2")) {
return;
}
// convert them #2
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u5909\u8EAB",
"clauses":
[
{ "length": 2,
"attr": COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT }
]
},
@@ -2967,17 +2967,17 @@ function runTestOnAnotherContext(aPanelO
});
if (!checkContent("\u5909\u8EAB", aTestName, "#1-3") ||
!checkSelection(2, "", aTestName, "#1-3")) {
return;
}
// commit them
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u5909\u8EAB",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 2, "length": 0 }
@@ -3067,68 +3067,68 @@ function runMaxLengthTest()
input.focus();
var kDesc ="runMaxLengthTest";
// start composition
synthesizeComposition({ type: "compositionstart" });
// input first character
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
});
if (!checkContent("\u3089", kDesc, "#1-1") ||
!checkSelection(1, "", kDesc, "#1-1")) {
return;
}
// input second character
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC",
"clauses":
[
{ "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 2, "length": 0 }
});
if (!checkContent("\u3089\u30FC", kDesc, "#1-2") ||
!checkSelection(2, "", kDesc, "#1-2")) {
return;
}
// input third character
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC\u3081",
"clauses":
[
{ "length": 3, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 3, "length": 0 }
});
if (!checkContent("\u3089\u30FC\u3081", kDesc, "#1-3") ||
!checkSelection(3, "", kDesc, "#1-3")) {
return;
}
// input fourth character
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC\u3081\u3093",
"clauses":
[
{ "length": 4, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 4, "length": 0 }
@@ -3136,99 +3136,99 @@ function runMaxLengthTest()
if (!checkContent("\u3089\u30FC\u3081\u3093", kDesc, "#1-4") ||
!checkSelection(4, "", kDesc, "#1-4")) {
return;
}
// backspace
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC\u3081",
"clauses":
[
{ "length": 3, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 3, "length": 0 }
});
if (!checkContent("\u3089\u30FC\u3081", kDesc, "#1-5") ||
!checkSelection(3, "", kDesc, "#1-5")) {
return;
}
// re-input
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC\u3081\u3093",
"clauses":
[
{ "length": 4, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 4, "length": 0 }
});
if (!checkContent("\u3089\u30FC\u3081\u3093", kDesc, "#1-6") ||
!checkSelection(4, "", kDesc, "#1-6")) {
return;
}
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC\u3081\u3093\u3055",
"clauses":
[
{ "length": 5, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 5, "length": 0 }
});
if (!checkContent("\u3089\u30FC\u3081\u3093\u3055", kDesc, "#1-7") ||
!checkSelection(5, "", kDesc, "#1-7")) {
return;
}
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC\u3081\u3093\u3055\u3044",
"clauses":
[
{ "length": 6, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 6, "length": 0 }
});
if (!checkContent("\u3089\u30FC\u3081\u3093\u3055\u3044", kDesc, "#1-8") ||
!checkSelection(6, "", kDesc, "#1-8")) {
return;
}
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC\u3081\u3093\u3055\u3044\u3053",
"clauses":
[
{ "length": 7, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 7, "length": 0 }
});
if (!checkContent("\u3089\u30FC\u3081\u3093\u3055\u3044\u3053",
kDesc, "#1-8") ||
!checkSelection(7, "", kDesc, "#1-8")) {
return;
}
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3089\u30FC\u3081\u3093\u3055\u3044\u3053\u3046",
"clauses":
[
{ "length": 8, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 8, "length": 0 }
@@ -3236,17 +3236,17 @@ function runMaxLengthTest()
if (!checkContent("\u3089\u30FC\u3081\u3093\u3055\u3044\u3053\u3046",
kDesc, "#1-9") ||
!checkSelection(8, "", kDesc, "#1-9")) {
return;
}
// convert
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8",
"clauses":
[
{ "length": 4,
"attr": COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT },
{ "length": 2,
"attr": COMPOSITION_ATTR_CONVERTEDTEXT }
@@ -3256,17 +3256,17 @@ function runMaxLengthTest()
});
if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8", kDesc, "#1-10") ||
!checkSelection(4, "", kDesc, "#1-10")) {
return;
}
// commit the composition string
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 6, "length": 0 }
@@ -3279,34 +3279,34 @@ function runMaxLengthTest()
synthesizeComposition({ type: "compositionend",
data: "\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8" });
// restart composition
synthesizeComposition({ type: "compositionstart" });
// input characters
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3057",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
});
if (!checkContent("\u30E9\u3057", kDesc, "#2-1") ||
!checkSelection(1 + 1, "", kDesc, "#2-1")) {
return;
}
// commit the composition string
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u3058",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 1, "length": 0 }
@@ -3353,34 +3353,34 @@ function runMaxLengthTest()
// the carest is at start of the content.
input.value = "X";
input.selectionStart = input.selectionEnd = 0;
// start composition
synthesizeComposition({ type: "compositionstart" });
// input characters
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u9B54",
"clauses":
[
{ "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 1, "length": 0 }
});
if (!checkContent("\u9B54X", kDesc, "#4-1") ||
!checkSelection(1, "", kDesc, "#4-1")) {
return;
}
// commit the composition string
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u9B54",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 1, "length": 0 }
@@ -3394,34 +3394,34 @@ function runMaxLengthTest()
}
synthesizeComposition({ type: "compositionend", data: "\u9B54" });
// start composition
synthesizeComposition({ type: "compositionstart" });
// input characters
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u9B54\u6CD5",
"clauses":
[
{ "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
]
},
"caret": { "start": 2, "length": 0 }
});
if (!checkContent("\u9B54\u6CD5X", kDesc, "#5-1") ||
!checkSelection(2, "", kDesc, "#5-1")) {
return;
}
// commit the composition string
- synthesizeText(
+ synthesizeCompositionChange(
{ "composition":
{ "string": "\u9B54\u6CD5",
"clauses":
[
{ "length": 0, "attr": 0 }
]
},
"caret": { "start": 2, "length": 0 }