Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Side by Side Diff: content/renderer/render_widget_browsertest.cc

Issue 2568093003: Support parsing BackgroundSpans and UnderlineSpans in Android IME's commitText() (Closed)
Patch Set: Use addCompositionUnderlines() where I said I couldn't Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/strings/utf_string_conversions.h" 5 #include "base/strings/utf_string_conversions.h"
6 #include "content/common/resize_params.h" 6 #include "content/common/resize_params.h"
7 #include "content/public/test/render_view_test.h" 7 #include "content/public/test/render_view_test.h"
8 #include "content/renderer/render_view_impl.h" 8 #include "content/renderer/render_view_impl.h"
9 #include "content/renderer/render_widget.h" 9 #include "content/renderer/render_widget.h"
10 #include "third_party/WebKit/public/web/WebFrameWidget.h" 10 #include "third_party/WebKit/public/web/WebFrameWidget.h"
(...skipping 18 matching lines...) Expand all
29 29
30 bool next_paint_is_resize_ack() { 30 bool next_paint_is_resize_ack() {
31 return widget()->next_paint_is_resize_ack(); 31 return widget()->next_paint_is_resize_ack();
32 } 32 }
33 33
34 blink::WebInputMethodController* GetInputMethodController() { 34 blink::WebInputMethodController* GetInputMethodController() {
35 return widget()->GetInputMethodController(); 35 return widget()->GetInputMethodController();
36 } 36 }
37 37
38 void CommitText(std::string text) { 38 void CommitText(std::string text) {
39 widget()->OnImeCommitText(base::UTF8ToUTF16(text), 39 widget()->OnImeCommitText(
40 gfx::Range::InvalidRange(), 0); 40 base::UTF8ToUTF16(text),
41 std::vector<blink::WebCompositionUnderline>(),
42 gfx::Range::InvalidRange(), 0);
41 } 43 }
42 44
43 ui::TextInputType GetTextInputType() { return widget()->GetTextInputType(); } 45 ui::TextInputType GetTextInputType() { return widget()->GetTextInputType(); }
44 46
45 void SetFocus(bool focused) { widget()->OnSetFocus(focused); } 47 void SetFocus(bool focused) { widget()->OnSetFocus(focused); }
46 }; 48 };
47 49
48 TEST_F(RenderWidgetTest, OnResize) { 50 TEST_F(RenderWidgetTest, OnResize) {
49 // The initial bounds is empty, so setting it to the same thing should do 51 // The initial bounds is empty, so setting it to the same thing should do
50 // nothing. 52 // nothing.
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 EXPECT_EQ("hello", GetInputMethodController()->textInputInfo().value.utf8()); 199 EXPECT_EQ("hello", GetInputMethodController()->textInputInfo().value.utf8());
198 200
199 // Now give focus back again and commit text. 201 // Now give focus back again and commit text.
200 SetFocus(true); 202 SetFocus(true);
201 CommitText(text); 203 CommitText(text);
202 EXPECT_EQ("hello world", 204 EXPECT_EQ("hello world",
203 GetInputMethodController()->textInputInfo().value.utf8()); 205 GetInputMethodController()->textInputInfo().value.utf8());
204 } 206 }
205 207
206 } // namespace content 208 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_widget.cc ('k') | third_party/WebKit/Source/core/editing/InputMethodController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698