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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Issue 1999423002: tyrbot test for commitText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: SetHasCompositionTextToTrue 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
Index: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
index 0da99fbab737c560a75ea2eaf40735879c553bfa..cad1081f460b9fdc34ed64bf145e52a9b3f39891 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
@@ -1231,8 +1231,8 @@ TEST_F(RenderWidgetHostViewAuraTest, FinishCompositionByMouse) {
EXPECT_EQ(2U, sink_->message_count());
if (sink_->message_count() == 2) {
- // Verify mouse event happens after the confirm-composition event.
- EXPECT_EQ(InputMsg_ImeConfirmComposition::ID,
+ // Verify mouse event happens after the finish composing text event.
+ EXPECT_EQ(InputMsg_ImeFinishComposingText::ID,
sink_->GetMessageAt(0)->type());
EXPECT_EQ(InputMsg_HandleInputEvent::ID,
sink_->GetMessageAt(1)->type());
@@ -4355,11 +4355,11 @@ TEST_F(InputMethodResultAuraTest, ConfirmCompositionText) {
ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT);
SetHasCompositionTextToTrue();
EXPECT_TRUE(!!RunAndReturnIPCSent(ime_call, processes_[index],
- InputMsg_ImeConfirmComposition::ID));
+ InputMsg_ImeFinishComposingText::ID));
}
}
-// This test is for ui::TextInputClient::ConfirmCompositionText.
+// This test is for ui::TextInputClient::ClearCompositionText.
TEST_F(InputMethodResultAuraTest, ClearCompositionText) {
base::Closure ime_call =
base::Bind(&ui::TextInputClient::ClearCompositionText,
@@ -4372,15 +4372,28 @@ TEST_F(InputMethodResultAuraTest, ClearCompositionText) {
}
}
-// This test is for that ui::TextInputClient::InsertText.
-TEST_F(InputMethodResultAuraTest, InsertText) {
+// This test is for ui::TextInputClient::InsertText with empty text.
+TEST_F(InputMethodResultAuraTest, FinishComposingText) {
base::Closure ime_call =
base::Bind(&ui::TextInputClient::InsertText,
base::Unretained(text_input_client()), base::string16());
for (auto index : active_view_sequence_) {
ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT);
+ SetHasCompositionTextToTrue();
+ EXPECT_TRUE(!!RunAndReturnIPCSent(ime_call, processes_[index],
+ InputMsg_ImeFinishComposingText::ID));
+ }
+}
+
+// This test is for ui::TextInputClient::InsertText with non-empty text.
+TEST_F(InputMethodResultAuraTest, CommitText) {
+ base::Closure ime_call = base::Bind(&ui::TextInputClient::InsertText,
+ base::Unretained(text_input_client()),
+ base::UTF8ToUTF16("hello"));
+ for (auto index : active_view_sequence_) {
+ ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT);
EXPECT_TRUE(!!RunAndReturnIPCSent(ime_call, processes_[index],
- InputMsg_ImeConfirmComposition::ID));
+ InputMsg_ImeCommitText::ID));
}
}
@@ -4395,7 +4408,7 @@ TEST_F(InputMethodResultAuraTest, FinishImeCompositionSession) {
SetHasCompositionTextToTrue();
EXPECT_TRUE(!!RunAndReturnIPCSent(ime_finish_session_call,
processes_[index],
- InputMsg_ImeConfirmComposition::ID));
+ InputMsg_ImeFinishComposingText::ID));
}
}

Powered by Google App Engine
This is Rietveld 408576698