| Index: content/public/test/text_input_test_utils.cc
|
| diff --git a/content/public/test/text_input_test_utils.cc b/content/public/test/text_input_test_utils.cc
|
| index e37b5dc435f2efd81adc2b6ef6a70cd8e71945d0..5405d908bcd7fcd11b05bb5b709eeb518e85b46b 100644
|
| --- a/content/public/test/text_input_test_utils.cc
|
| +++ b/content/public/test/text_input_test_utils.cc
|
| @@ -71,7 +71,7 @@ class TextInputManagerTester::InternalObserver
|
| on_text_selection_changed_callback_ = callback;
|
| }
|
|
|
| - const RenderWidgetHostView* GetUpdatedView() const { return updated_view_; }
|
| + RenderWidgetHostView* GetUpdatedView() const { return updated_view_; }
|
|
|
| bool text_input_state_changed() const { return text_input_state_changed_; }
|
|
|
| @@ -262,6 +262,23 @@ bool DoesFrameHaveFocusedEditableElement(RenderFrameHost* frame) {
|
| ->has_focused_editable_element();
|
| }
|
|
|
| +void SendImeCommitTextToWidget(
|
| + RenderWidgetHost* rwh,
|
| + const base::string16& text,
|
| + const std::vector<ui::CompositionUnderline>& underlines,
|
| + const gfx::Range& replacement_range,
|
| + int relative_cursor_pos) {
|
| + std::vector<blink::WebCompositionUnderline> web_composition_underlines;
|
| + for (auto underline : underlines) {
|
| + web_composition_underlines.emplace_back(
|
| + static_cast<int>(underline.start_offset),
|
| + static_cast<int>(underline.end_offset), underline.color,
|
| + underline.thick, underline.background_color);
|
| + }
|
| + RenderWidgetHostImpl::From(rwh)->ImeCommitText(
|
| + text, web_composition_underlines, replacement_range, relative_cursor_pos);
|
| +}
|
| +
|
| size_t GetRegisteredViewsCountFromTextInputManager(WebContents* web_contents) {
|
| std::unordered_set<RenderWidgetHostView*> views;
|
| TextInputManager* manager =
|
| @@ -325,7 +342,7 @@ const RenderWidgetHostView* TextInputManagerTester::GetActiveView() {
|
| return observer_->text_input_manager()->active_view_for_testing();
|
| }
|
|
|
| -const RenderWidgetHostView* TextInputManagerTester::GetUpdatedView() {
|
| +RenderWidgetHostView* TextInputManagerTester::GetUpdatedView() {
|
| return observer_->GetUpdatedView();
|
| }
|
|
|
|
|