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

Unified Diff: content/renderer/render_view_browsertest.cc

Issue 2608293002: [reland, refactor] - Move textInputInfo() and textInputType() from WebWidget to WebInputMethodContr… (Closed)
Patch Set: Addressing wjmaclean@'s comments 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 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 28418a9bd5ef042aeacd384364d6b63009a6ed45..aee50d60b913609af4046083d8d39d807de69e0a 100644
--- a/content/renderer/render_view_browsertest.cc
+++ b/content/renderer/render_view_browsertest.cc
@@ -73,6 +73,7 @@
#include "third_party/WebKit/public/web/WebFrameContentDumper.h"
#include "third_party/WebKit/public/web/WebHistoryCommitType.h"
#include "third_party/WebKit/public/web/WebHistoryItem.h"
+#include "third_party/WebKit/public/web/WebInputMethodController.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebPerformance.h"
#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
@@ -1582,13 +1583,15 @@ TEST_F(RenderViewImplTest, SetEditableSelectionAndComposition) {
frame()->SetEditableSelectionOffsets(4, 8);
const std::vector<blink::WebCompositionUnderline> empty_underline;
frame()->SetCompositionFromExistingText(7, 10, empty_underline);
- blink::WebTextInputInfo info = view()->webview()->textInputInfo();
+ blink::WebInputMethodController* controller =
+ frame()->GetWebFrame()->inputMethodController();
+ blink::WebTextInputInfo info = controller->textInputInfo();
EXPECT_EQ(4, info.selectionStart);
EXPECT_EQ(8, info.selectionEnd);
EXPECT_EQ(7, info.compositionStart);
EXPECT_EQ(10, info.compositionEnd);
frame()->Unselect();
- info = view()->webview()->textInputInfo();
+ info = controller->textInputInfo();
EXPECT_EQ(0, info.selectionStart);
EXPECT_EQ(0, info.selectionEnd);
}
@@ -1605,13 +1608,15 @@ TEST_F(RenderViewImplTest, OnExtendSelectionAndDelete) {
ExecuteJavaScriptForTests("document.getElementById('test1').focus();");
frame()->SetEditableSelectionOffsets(10, 10);
frame()->ExtendSelectionAndDelete(3, 4);
- blink::WebTextInputInfo info = view()->webview()->textInputInfo();
+ blink::WebInputMethodController* controller =
+ frame()->GetWebFrame()->inputMethodController();
+ blink::WebTextInputInfo info = controller->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();
+ info = controller->textInputInfo();
EXPECT_EQ("abuvwxyz", info.value);
EXPECT_EQ(2, info.selectionStart);
EXPECT_EQ(2, info.selectionEnd);
@@ -1631,33 +1636,35 @@ TEST_F(RenderViewImplTest, OnDeleteSurroundingText) {
frame()->SetEditableSelectionOffsets(10, 10);
frame()->DeleteSurroundingText(3, 4);
- blink::WebTextInputInfo info = view()->webview()->textInputInfo();
+ blink::WebInputMethodController* controller =
+ frame()->GetWebFrame()->inputMethodController();
+ blink::WebTextInputInfo info = controller->textInputInfo();
EXPECT_EQ("abcdefgopqrstuvwxyz", info.value);
EXPECT_EQ(7, info.selectionStart);
EXPECT_EQ(7, info.selectionEnd);
frame()->SetEditableSelectionOffsets(4, 8);
frame()->DeleteSurroundingText(2, 5);
- info = view()->webview()->textInputInfo();
+ info = controller->textInputInfo();
EXPECT_EQ("abefgouvwxyz", info.value);
EXPECT_EQ(2, info.selectionStart);
EXPECT_EQ(6, info.selectionEnd);
frame()->SetEditableSelectionOffsets(5, 5);
frame()->DeleteSurroundingText(10, 0);
- info = view()->webview()->textInputInfo();
+ info = controller->textInputInfo();
EXPECT_EQ("ouvwxyz", info.value);
EXPECT_EQ(0, info.selectionStart);
EXPECT_EQ(0, info.selectionEnd);
frame()->DeleteSurroundingText(0, 10);
- info = view()->webview()->textInputInfo();
+ info = controller->textInputInfo();
EXPECT_EQ("", info.value);
EXPECT_EQ(0, info.selectionStart);
EXPECT_EQ(0, info.selectionEnd);
frame()->DeleteSurroundingText(10, 10);
- info = view()->webview()->textInputInfo();
+ info = controller->textInputInfo();
EXPECT_EQ("", info.value);
EXPECT_EQ(0, info.selectionStart);
« 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