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

Unified Diff: ui/base/ime/remote_input_method_win_unittest.cc

Issue 1257603006: Refactoring for the InputMethod & InputMethodDelegate interfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed compiling errors on chromeos. Created 5 years, 5 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 | « ui/base/ime/remote_input_method_win.cc ('k') | ui/keyboard/keyboard_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/remote_input_method_win_unittest.cc
diff --git a/ui/base/ime/remote_input_method_win_unittest.cc b/ui/base/ime/remote_input_method_win_unittest.cc
index a49662bfd84493e32515c06fbdd30317a36bfa37..3960801d9c08d0c287b0751451acba1a97de8a5d 100644
--- a/ui/base/ime/remote_input_method_win_unittest.cc
+++ b/ui/base/ime/remote_input_method_win_unittest.cc
@@ -138,10 +138,11 @@ class MockInputMethodDelegate : public internal::InputMethodDelegate {
}
private:
- bool DispatchKeyEventPostIME(const ui::KeyEvent& event) override {
- EXPECT_FALSE(event.HasNativeEvent());
- fabricated_key_events_.push_back(event.key_code());
- return true;
+ ui::EventDispatchDetails DispatchKeyEventPostIME(
+ ui::KeyEvent* event) override {
+ EXPECT_FALSE(event->HasNativeEvent());
+ fabricated_key_events_.push_back(event->key_code());
+ return ui::EventDispatchDetails();
}
std::vector<ui::KeyboardCode> fabricated_key_events_;
@@ -516,7 +517,7 @@ TEST(RemoteInputMethodWinTest, DispatchKeyEvent_NativeKeyEvent) {
ui::KeyEvent native_keydown(wm_keydown);
// This must not cause a crash.
- EXPECT_FALSE(input_method->DispatchKeyEvent(native_keydown));
+ input_method->DispatchKeyEvent(&native_keydown);
yukawa 2015/07/30 18:11:39 Does it make sense to check |native_keydown.handle
Shu Chen 2015/07/31 01:18:47 Yes, makes sense. Thanks for catching this.
EXPECT_TRUE(mock_text_input_client.inserted_text().empty());
EXPECT_TRUE(delegate_.fabricated_key_events().empty());
delegate_.Reset();
@@ -530,7 +531,7 @@ TEST(RemoteInputMethodWinTest, DispatchKeyEvent_NativeKeyEvent) {
// TextInputClient is not focused yet here.
- EXPECT_FALSE(input_method->DispatchKeyEvent(native_keydown));
+ input_method->DispatchKeyEvent(&native_keydown);
EXPECT_TRUE(mock_text_input_client.inserted_text().empty());
EXPECT_TRUE(delegate_.fabricated_key_events().empty());
delegate_.Reset();
@@ -540,7 +541,7 @@ TEST(RemoteInputMethodWinTest, DispatchKeyEvent_NativeKeyEvent) {
// TextInputClient is now focused here.
- EXPECT_FALSE(input_method->DispatchKeyEvent(native_keydown));
+ input_method->DispatchKeyEvent(&native_keydown);
EXPECT_TRUE(mock_text_input_client.inserted_text().empty());
EXPECT_TRUE(delegate_.fabricated_key_events().empty());
delegate_.Reset();
@@ -558,7 +559,7 @@ TEST(RemoteInputMethodWinTest, DispatchKeyEvent_NativeCharEvent) {
ui::KeyEvent native_char(wm_char);
// This must not cause a crash.
- EXPECT_FALSE(input_method->DispatchKeyEvent(native_char));
+ input_method->DispatchKeyEvent(&native_char);
EXPECT_TRUE(mock_text_input_client.inserted_text().empty());
EXPECT_TRUE(delegate_.fabricated_key_events().empty());
delegate_.Reset();
@@ -572,7 +573,7 @@ TEST(RemoteInputMethodWinTest, DispatchKeyEvent_NativeCharEvent) {
// TextInputClient is not focused yet here.
- EXPECT_FALSE(input_method->DispatchKeyEvent(native_char));
+ input_method->DispatchKeyEvent(&native_char);
EXPECT_TRUE(mock_text_input_client.inserted_text().empty());
EXPECT_TRUE(delegate_.fabricated_key_events().empty());
delegate_.Reset();
@@ -582,7 +583,7 @@ TEST(RemoteInputMethodWinTest, DispatchKeyEvent_NativeCharEvent) {
// TextInputClient is now focused here.
- EXPECT_TRUE(input_method->DispatchKeyEvent(native_char));
+ input_method->DispatchKeyEvent(&native_char);
EXPECT_EQ(L"A", mock_text_input_client.inserted_text());
EXPECT_TRUE(delegate_.fabricated_key_events().empty());
delegate_.Reset();
@@ -602,7 +603,7 @@ TEST(RemoteInputMethodWinTest, DispatchKeyEvent_FabricatedKeyDown) {
fabricated_keydown.set_character(L'A');
// This must not cause a crash.
- EXPECT_TRUE(input_method->DispatchKeyEvent(fabricated_keydown));
+ input_method->DispatchKeyEvent(&fabricated_keydown);
EXPECT_TRUE(mock_text_input_client.inserted_text().empty());
ASSERT_EQ(1, delegate_.fabricated_key_events().size());
EXPECT_EQ(L'A', delegate_.fabricated_key_events()[0]);
@@ -617,7 +618,7 @@ TEST(RemoteInputMethodWinTest, DispatchKeyEvent_FabricatedKeyDown) {
// TextInputClient is not focused yet here.
- EXPECT_TRUE(input_method->DispatchKeyEvent(fabricated_keydown));
+ input_method->DispatchKeyEvent(&fabricated_keydown);
EXPECT_TRUE(mock_text_input_client.inserted_text().empty());
ASSERT_EQ(1, delegate_.fabricated_key_events().size());
EXPECT_EQ(L'A', delegate_.fabricated_key_events()[0]);
@@ -627,7 +628,7 @@ TEST(RemoteInputMethodWinTest, DispatchKeyEvent_FabricatedKeyDown) {
input_method->SetFocusedTextInputClient(&mock_text_input_client);
// TextInputClient is now focused here.
- EXPECT_TRUE(input_method->DispatchKeyEvent(fabricated_keydown));
+ input_method->DispatchKeyEvent(&fabricated_keydown);
EXPECT_TRUE(mock_text_input_client.inserted_text().empty());
ASSERT_EQ(1, delegate_.fabricated_key_events().size());
EXPECT_EQ(L'A', delegate_.fabricated_key_events()[0]);
@@ -637,7 +638,7 @@ TEST(RemoteInputMethodWinTest, DispatchKeyEvent_FabricatedKeyDown) {
input_method->SetDelegate(NULL);
// RemoteInputMethodDelegateWin is no longer set here.
- EXPECT_FALSE(input_method->DispatchKeyEvent(fabricated_keydown));
+ input_method->DispatchKeyEvent(&fabricated_keydown);
EXPECT_TRUE(mock_text_input_client.inserted_text().empty());
}
@@ -652,7 +653,7 @@ TEST(RemoteInputMethodWinTest, DispatchKeyEvent_FabricatedChar) {
ui::KeyEvent fabricated_char(L'A', ui::VKEY_A, ui::EF_NONE);
// This must not cause a crash.
- EXPECT_TRUE(input_method->DispatchKeyEvent(fabricated_char));
+ input_method->DispatchKeyEvent(&fabricated_char);
EXPECT_TRUE(mock_text_input_client.inserted_text().empty());
EXPECT_TRUE(delegate_.fabricated_key_events().empty());
delegate_.Reset();
@@ -666,7 +667,7 @@ TEST(RemoteInputMethodWinTest, DispatchKeyEvent_FabricatedChar) {
// TextInputClient is not focused yet here.
- EXPECT_TRUE(input_method->DispatchKeyEvent(fabricated_char));
+ input_method->DispatchKeyEvent(&fabricated_char);
EXPECT_TRUE(mock_text_input_client.inserted_text().empty());
EXPECT_TRUE(delegate_.fabricated_key_events().empty());
delegate_.Reset();
@@ -676,7 +677,7 @@ TEST(RemoteInputMethodWinTest, DispatchKeyEvent_FabricatedChar) {
// TextInputClient is now focused here.
- EXPECT_TRUE(input_method->DispatchKeyEvent(fabricated_char));
+ input_method->DispatchKeyEvent(&fabricated_char);
EXPECT_EQ(L"A", mock_text_input_client.inserted_text());
EXPECT_TRUE(delegate_.fabricated_key_events().empty());
delegate_.Reset();
« no previous file with comments | « ui/base/ime/remote_input_method_win.cc ('k') | ui/keyboard/keyboard_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698