Index: third_party/WebKit/LayoutTests/fast/events/composition-event-source-device-event-sender.html |
diff --git a/third_party/WebKit/LayoutTests/fast/events/composition-event-source-device-event-sender.html b/third_party/WebKit/LayoutTests/fast/events/composition-event-source-device-event-sender.html |
index f56b59e1d4b201af2bbb1d848c73e3a571bac72f..b8ce4ff8732d96e0dd946fba5afbcdf07f4e3a1b 100644 |
--- a/third_party/WebKit/LayoutTests/fast/events/composition-event-source-device-event-sender.html |
+++ b/third_party/WebKit/LayoutTests/fast/events/composition-event-source-device-event-sender.html |
@@ -14,12 +14,20 @@ if (window.eventSender) { |
for (var evt of ['compositionstart', 'compositionupdate', 'compositionend']) { |
document.addEventListener(evt, compositionHandler); |
} |
- |
+ |
var input = document.getElementById('input'); |
input.focus(); |
+ // We need to force a text input update here so that later the call to |
+ // RenderWidget::resetInputMethod() will lead to finishComposingText(). |
+ // Normally this would not be needed if the focus was due to user gesture. |
+ // But on Mac, even with user gesture, we wait for the next compositing |
+ // to update text input state frame. That is why we are explicitly calling |
+ // this method here. |
+ textInputController.forceTextInputStateUpdate(); |
+ |
textInputController.setMarkedText('abcde', 1, 3); |
- |
+ |
input.blur(); |
} else { |
debug('This test requires eventSender.'); |