| Index: third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-compositionupdate.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-compositionupdate.html b/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-compositionupdate.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6db79337f91fa73c460cd3039fb49d49ec588bc7
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-compositionupdate.html
|
| @@ -0,0 +1,36 @@
|
| +<title>InputEvent order WRT 'compositionupdate'</title>
|
| +<script src="../../../resources/testharness.js"></script>
|
| +<script src="../../../resources/testharnessreport.js"></script>
|
| +<p id="editable" contenteditable></p>
|
| +<script>
|
| +test(function() {
|
| + assert_not_equals(textInputController, undefined, 'This test requires textInputController.');
|
| +
|
| + var eventOrderRecorder = [];
|
| + const editable = document.getElementById('editable');
|
| + ['beforeinput', 'input', 'compositionstart', 'compositionupdate', 'compositionend'].forEach(
|
| + eventType => document.addEventListener(eventType, function(event) {
|
| + eventOrderRecorder.push(`${eventType}:${event.inputType}-${event.data}-${editable.innerHTML}`);
|
| + })
|
| + );
|
| +
|
| + editable.focus();
|
| + textInputController.setComposition("w");
|
| + textInputController.setComposition("wo");
|
| + textInputController.insertText("work");
|
| + console.log(eventOrderRecorder);
|
| + assert_array_equals(eventOrderRecorder,
|
| + ['compositionstart:undefined--',
|
| + 'beforeinput:insertText-w-',
|
| + 'compositionupdate:undefined-w-',
|
| + 'input:insertText-w-w',
|
| + 'beforeinput:insertText-wo-w',
|
| + 'compositionupdate:undefined-wo-w',
|
| + 'input:insertText-wo-wo',
|
| + 'beforeinput:insertText-work-wo',
|
| + 'compositionupdate:undefined-work-wo',
|
| + 'input:insertText-work-work',
|
| + 'compositionend:undefined-work-work']
|
| + );
|
| +}, '"compositionupdate" should fire before "input" and after "beforeinput".');
|
| +</script>
|
|
|