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

Unified Diff: content/renderer/render_view_browsertest.cc

Issue 2323983003: DO NOT SUBMIT: Bundle IME-related messages into one for batch edit (Closed)
Patch Set: fixed nits and fixed blimp test Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_browsertest.cc
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc
index 285e41db08eca907f6e3af27fa44858e69414ae5..3af42a031a9d05b98d5f7397f3968a3a8009799a 100644
--- a/content/renderer/render_view_browsertest.cc
+++ b/content/renderer/render_view_browsertest.cc
@@ -254,6 +254,18 @@ class RenderViewImplTest : public RenderViewTest {
FrameLoadWaiter(frame()).Wait();
}
+ void SetEditableSelectionOffsets(int start, int end) {
+ frame()->GetRenderWidget()->OnImeSetEditableSelectionOffsets(start, end);
+ }
+
+ void SetCompositionFromExistingText(
+ int start,
+ int end,
+ const std::vector<blink::WebCompositionUnderline>& underlines) {
+ frame()->GetRenderWidget()->OnImeSetCompositionFromExistingText(
+ start, end, underlines);
+ }
+
template<class T>
typename T::Param ProcessAndReadIPC() {
ProcessPendingMessages();
@@ -1685,9 +1697,9 @@ TEST_F(RenderViewImplTest, SetEditableSelectionAndComposition) {
"</body>"
"</html>");
ExecuteJavaScriptForTests("document.getElementById('test1').focus();");
- frame()->SetEditableSelectionOffsets(4, 8);
+ SetEditableSelectionOffsets(4, 8);
const std::vector<blink::WebCompositionUnderline> empty_underline;
- frame()->SetCompositionFromExistingText(7, 10, empty_underline);
+ SetCompositionFromExistingText(7, 10, empty_underline);
blink::WebTextInputInfo info = view()->webview()->textInputInfo();
EXPECT_EQ(4, info.selectionStart);
EXPECT_EQ(8, info.selectionEnd);
@@ -1699,31 +1711,6 @@ TEST_F(RenderViewImplTest, SetEditableSelectionAndComposition) {
EXPECT_EQ(0, info.selectionEnd);
}
-
-TEST_F(RenderViewImplTest, OnExtendSelectionAndDelete) {
- // Load an HTML page consisting of an input field.
- LoadHTML("<html>"
- "<head>"
- "</head>"
- "<body>"
- "<input id=\"test1\" value=\"abcdefghijklmnopqrstuvwxyz\"></input>"
- "</body>"
- "</html>");
- ExecuteJavaScriptForTests("document.getElementById('test1').focus();");
- frame()->SetEditableSelectionOffsets(10, 10);
- frame()->ExtendSelectionAndDelete(3, 4);
- blink::WebTextInputInfo info = view()->webview()->textInputInfo();
- EXPECT_EQ("abcdefgopqrstuvwxyz", info.value);
- EXPECT_EQ(7, info.selectionStart);
- EXPECT_EQ(7, info.selectionEnd);
- frame()->SetEditableSelectionOffsets(4, 8);
- frame()->ExtendSelectionAndDelete(2, 5);
- info = view()->webview()->textInputInfo();
- EXPECT_EQ("abuvwxyz", info.value);
- EXPECT_EQ(2, info.selectionStart);
- EXPECT_EQ(2, info.selectionEnd);
-}
-
// Test that the navigating specific frames works correctly.
TEST_F(RenderViewImplTest, NavigateSubframe) {
// Load page A.
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698